feed

package
v0.0.0-...-fb59710 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: EUPL-1.2 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFeedNotFound    = errors.New("feed not found")
	ErrFeedInvalid     = errors.New("invalid feed format")
	ErrFeedUnreachable = errors.New("feed URL unreachable")
)

Common errors returned by the feed service.

Functions

This section is empty.

Types

type Option

type Option func(*Service)

Option configures the feed service.

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

WithHTTPClient sets a custom HTTP client.

func WithTimeout

func WithTimeout(d time.Duration) Option

WithTimeout sets the HTTP request timeout.

type ParsedFeed

type ParsedFeed struct {
	Feed     *models.Feed
	Articles []*models.Article
}

ParsedFeed contains the parsed feed metadata and articles.

type Service

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

Service handles RSS/Atom feed parsing.

func NewService

func NewService(opts ...Option) *Service

NewService creates a new feed parsing service.

func (*Service) FetchAndParse

func (s *Service) FetchAndParse(ctx context.Context, url string) (*ParsedFeed, error)

FetchAndParse fetches a feed from the given URL and parses it.

func (*Service) ParseString

func (s *Service) ParseString(content string) (*ParsedFeed, error)

ParseString parses feed content from a string.

Jump to

Keyboard shortcuts

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