model

package
v0.12.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package model defines data types that are used throughout the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bookmark added in v0.3.0

type Bookmark struct {
	ID           int64     `json:"id"`
	ItemID       int64     `json:"item_id"`
	Deadline     time.Time `json:"deadline"`
	Comment      string    `json:"comment"`
	Finished     bool      `json:"finished"`
	FinishedWhen time.Time `json:"finish_stamp"`
}

Bookmark represents my intention to read some article at some point in the future.

type Feed

type Feed struct {
	ID              int64
	Name            string
	Language        string
	URL             *url.URL
	Homepage        *url.URL
	RefreshInterval time.Duration
	LastRefresh     time.Time
	Active          bool
}

Feed is an RSS feed we can subscribe to.

func (*Feed) IsDue

func (f *Feed) IsDue() bool

IsDue returns true if the feed is due for a refresh.

type Item

type Item struct {
	ID            int64
	FeedID        int64
	Title         string
	URL           *url.URL
	Rating        rating.Rating
	GuessedRating rating.Rating
	Timestamp     time.Time
	Body          string
	Stripped      string
	// contains filtered or unexported fields
}

Item is a news article, blog post, etc.

func (*Item) EffectiveRating

func (i *Item) EffectiveRating() rating.Rating

EffectiveRating returns an Item's guessed Rating if it is unrated, otherwise the Item's Rating.

func (*Item) IDStr

func (i *Item) IDStr() string

IDstr returns the Item's ID rendered as a string.

func (*Item) IsBoring

func (i *Item) IsBoring() bool

IsBoring returns true if the Item has been rated as Boring.

func (*Item) IsProbablyBoring added in v0.12.0

func (i *Item) IsProbablyBoring() bool

IsProbablyBoring returns true if the Item has been rated as Boring or if the Critic thinks it is more Boring than Interesting.

func (*Item) IsRated

func (i *Item) IsRated() bool

IsRated returns true if the Item has been rated.

func (*Item) Strip

func (i *Item) Strip() string

Strip returns the Item's Title + Body, stripped of all HTML elements. The result is cached, subsequent calls return the cached value.

CAVEAT: Caching is result per Item only at this point.

type Tag

type Tag struct {
	ID       int64  `json:"id"`
	ParentID int64  `json:"parent"`
	Name     string `json:"name"`
	Level    int    `json:"level"`
	FullName string `json:"full_name"`
	// contains filtered or unexported fields
}

Tag is a descriptive bit of text we can attach to Items.

func (*Tag) IDStr

func (t *Tag) IDStr() string

IDstr returns the Tag's ID rendered as a string.

func (*Tag) Parent

func (t *Tag) Parent() string

Parent returns the Tags ParentID as a string, or an empty string if ParentID is 0.

type TagLink struct {
	ID     int64
	TagID  int64
	ItemID int64
}

TagLink attaches a Tag to an Item.

Directories

Path Synopsis
Package rating defines constants for rating news Items.
Package rating defines constants for rating news Items.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址