entity

package
v0.0.0-...-3ee5860 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromTimestampPb

func FromTimestampPb(pb *timestamppb.Timestamp) *time.Time

Types

type Entry

type Entry struct {
	ID           ID
	FeedID       ID
	Title        string
	IsRead       bool
	IsBookmarked bool
	ExtID        string
	Updated      *time.Time
	Published    *time.Time
	Description  *string
	Content      *string
	URL          *string
}

func FromEntryPb

func FromEntryPb(pb *api.Entry) *Entry

type EntryEditOp

type EntryEditOp struct {
	ID           ID
	IsRead       *bool
	IsBookmarked *bool
}

type EntryNotFoundError

type EntryNotFoundError struct{ ID any }

func (EntryNotFoundError) Error

func (e EntryNotFoundError) Error() string

type Feed

type Feed struct {
	ID          ID
	Title       string
	Description *string
	FeedURL     string
	SiteURL     *string
	Subscribed  time.Time
	LastPulled  time.Time
	Updated     *time.Time
	IsStarred   bool
	Tags        []string
	Entries     map[ID]*Entry
}

func FromFeedPb

func FromFeedPb(pb *api.Feed) *Feed

func FromFeedPbs

func FromFeedPbs(pbs []*api.Feed) []*Feed

func (*Feed) EntriesSlice

func (f *Feed) EntriesSlice() []*Entry

EntriesSlice returns a slice of entries sorted by read status (unread first), update date (oldest first), and published date (oldest first).

func (*Feed) NumEntriesRead

func (f *Feed) NumEntriesRead() int

func (*Feed) NumEntriesTotal

func (f *Feed) NumEntriesTotal() int

func (*Feed) NumEntriesUnread

func (f *Feed) NumEntriesUnread() int

func (*Feed) Outline

func (f *Feed) Outline() (*opml.Outline, error)

type FeedEditOp

type FeedEditOp struct {
	ID          ID
	Title       *string
	Description *string
	Tags        *[]string
	IsStarred   *bool
}

type FeedNotFoundError

type FeedNotFoundError struct{ ID any }

func (FeedNotFoundError) Error

func (e FeedNotFoundError) Error() string

type ID

type ID = uint32

func ToFeedID

func ToFeedID(raw string) (ID, error)

func ToFeedIDs

func ToFeedIDs(raw []string) ([]ID, error)

type PullResult

type PullResult struct {
	// contains filtered or unexported fields
}

PullResult is a container for a pull operation.

func NewPullResultFromError

func NewPullResultFromError(url *string, err error) PullResult

func NewPullResultFromFeed

func NewPullResultFromFeed(url *string, feed *Feed) PullResult

func (PullResult) Error

func (msg PullResult) Error() error

func (PullResult) Feed

func (msg PullResult) Feed() *Feed

func (*PullResult) SetError

func (msg *PullResult) SetError(err error)

func (*PullResult) SetStatus

func (msg *PullResult) SetStatus(status PullStatus)

func (PullResult) URL

func (msg PullResult) URL() string

type PullStatus

type PullStatus int
const (
	PullSuccess PullStatus = iota
	PullFail
)

type Stats

type Stats struct {
	NumFeeds             uint32
	NumEntries           uint32
	NumEntriesUnread     uint32
	LastPullTime         *time.Time
	MostRecentUpdateTime *time.Time
}

func FromStatsPb

func FromStatsPb(pb *api.GetStatsResponse_Stats) *Stats

type Subscription

type Subscription struct {
	Title *string
	Feeds []*Feed
}

func NewSubscriptionFromOPML

func NewSubscriptionFromOPML(doc *opml.Doc) (*Subscription, error)

func NewSubscriptionFromRawOPML

func NewSubscriptionFromRawOPML(payload []byte) (*Subscription, error)

func (*Subscription) Export

func (sub *Subscription) Export() ([]byte, error)

Jump to

Keyboard shortcuts

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