item

package
v0.0.0-...-9d48049 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: Unlicense Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeleteFeedItemsCommand

type DeleteFeedItemsCommand struct {
	FeedID int
}

type FetchFeedNewItemsCommand

type FetchFeedNewItemsCommand struct {
	FeedID int
}

type GetFeedItemsCommand

type GetFeedItemsCommand struct {
	FeedID int
}

type Item

type Item struct {
	ID        int
	Title     string
	Desc      string
	Dir       string
	Link      string
	IsNew     bool
	Starred   bool
	Timestamp time.Time
}

type ReadFeedItemsCommand

type ReadFeedItemsCommand struct {
	FeedID int
}

type Repository

type Repository interface {
	UpsertItems(feedID int, items []*Item) error
	GetUnreadItems() ([]*Item, error)
	GetStarredItems() ([]*Item, error)
	GetFeedItems(feedID int) ([]*Item, error)
	UpdateItem(id int, starred bool, isNew bool) error
	ReadFeedItems(feedID int) error
	UnreadFeedItems(feedID int) error
	GetStarredItemsCount() (int, error)
	GetUnreadItemsCount() (int, error)
	DeleteFeedItems(feedID int) error
}

type ServiceImpl

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

func NewService

func NewService(repository Repository) *ServiceImpl

func (*ServiceImpl) DeleteFeedItems

func (s *ServiceImpl) DeleteFeedItems(command *DeleteFeedItemsCommand) error

func (*ServiceImpl) GetFeedItems

func (s *ServiceImpl) GetFeedItems(command *GetFeedItemsCommand) ([]*Item, error)

func (*ServiceImpl) GetStarredItems

func (s *ServiceImpl) GetStarredItems() ([]*Item, error)

func (*ServiceImpl) GetStarredItemsCount

func (s *ServiceImpl) GetStarredItemsCount() (int, error)

func (*ServiceImpl) GetUnreadItems

func (s *ServiceImpl) GetUnreadItems() ([]*Item, error)

func (*ServiceImpl) GetUnreadItemsCount

func (s *ServiceImpl) GetUnreadItemsCount() (int, error)

func (*ServiceImpl) ReadFeedItems

func (s *ServiceImpl) ReadFeedItems(command *ReadFeedItemsCommand) error

func (*ServiceImpl) UnreadFeedItems

func (s *ServiceImpl) UnreadFeedItems(command *UnreadFeedItemsCommand) error

func (*ServiceImpl) UpdateItem

func (s *ServiceImpl) UpdateItem(command *UpdateItemCommand) error

func (*ServiceImpl) UpsertItems

func (s *ServiceImpl) UpsertItems(command *UpsertItemsCommand) error

type UnreadFeedItemsCommand

type UnreadFeedItemsCommand struct {
	FeedID int
}

type UpdateItemCommand

type UpdateItemCommand struct {
	ID      int
	Starred bool
	IsNew   bool
}

type UpsertItemsCommand

type UpsertItemsCommand struct {
	FeedID int
	Items  []*Item
}

Jump to

Keyboard shortcuts

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