feed

package
v0.0.0-...-e46c3b8 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2021 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Details

type Details struct {
	FeedURL     string `json:"feedUrl"`
	Title       string `json:"title"`
	Author      string `json:"author"`
	Description string `json:"description"`
}

Details represents feed details extracted from given URL.

type ErrInvalURL

type ErrInvalURL struct {
	URL string
	// contains filtered or unexported fields
}

ErrInvalURL is used to report invalid URLs.

func (ErrInvalURL) Context

func (err ErrInvalURL) Context() ctxerr.Context

Context returns error Context.

func (ErrInvalURL) Error

func (err ErrInvalURL) Error() string

func (ErrInvalURL) HttpStatusCode

func (err ErrInvalURL) HttpStatusCode() int

HttpStatusCode returns http status code for the error.

func (ErrInvalURL) Text

func (err ErrInvalURL) Text() string

Text returns human readable error text.

func (ErrInvalURL) Unwrap

func (err ErrInvalURL) Unwrap() error

type ErrParseFeed

type ErrParseFeed struct {
	URL string
	// contains filtered or unexported fields
}

ErrParseFeed is used to report errors from parsing feeds.

func (ErrParseFeed) Context

func (err ErrParseFeed) Context() ctxerr.Context

Context returns error Context.

func (ErrParseFeed) Error

func (err ErrParseFeed) Error() string

func (ErrParseFeed) HttpStatusCode

func (err ErrParseFeed) HttpStatusCode() int

HttpStatusCode returns http status code for the error.

func (ErrParseFeed) Text

func (err ErrParseFeed) Text() string

Text returns human readable error text.

func (ErrParseFeed) Unwrap

func (err ErrParseFeed) Unwrap() error

type Item

type Item struct {
	URL         string    `json:"url"`
	Title       string    `json:"title"`
	Description string    `json:"description"`
	PublishedAt time.Time `json:"publishedAt"`
}

Item represents feed entry/item.

type Service

type Service interface {
	Details(ctx context.Context, url string) (*Details, ctxerr.Error)
	FeedBatches(ctx context.Context, url string, batchSize uint) ([][]*Item, ctxerr.Error)
}

Service abstracts the feed service.

func Use

func Use(logger *zap.Logger) Service

Use constructs Service wich uses the given logger.

Jump to

Keyboard shortcuts

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