feed

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddFeedCommand

type AddFeedCommand struct {
	URL string
}

type DeleteFeedCommand

type DeleteFeedCommand struct {
	FeedID int
}

type Feed

type Feed struct {
	ID          int
	Title       string
	Description string
	Link        string
	URL         string
	Lang        string
	UpdatedAt   time.Time
	UnreadCount int
}

type Finder

type Finder interface {
	FindFeeds(url string) ([]string, error)
}

type Parser

type Parser interface {
	ParseURL(url string) (*gofeed.Feed, error)
}

type Repository

type Repository interface {
	AddFeed(feed *Feed) (int, error)
	GetFeed(id int) (*Feed, error)
	ListFeeds() ([]*Feed, error)
	DeleteFeed(id int) error
}

type ServiceImpl

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

func NewService

func NewService(repository Repository, parser Parser, finder Finder) *ServiceImpl

func (*ServiceImpl) AddFeed

func (s *ServiceImpl) AddFeed(command *AddFeedCommand) (*Feed, error)

func (*ServiceImpl) DeleteFeed

func (s *ServiceImpl) DeleteFeed(command *DeleteFeedCommand) error

func (*ServiceImpl) FetchItems

func (s *ServiceImpl) FetchItems(feedID int) ([]*item.Item, error)

func (*ServiceImpl) ListFeeds

func (s *ServiceImpl) ListFeeds() ([]*Feed, error)

Jump to

Keyboard shortcuts

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