feeds

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNamespace

func AddNamespace(feed *gofeed.Feed, ns, uri string)

func GetHashes

func GetHashes(pairs []ItemHashPair) []string

func ItemHashKey

func ItemHashKey(item *gofeed.Item) (string, error)

ItemHashKey creates a deterministic ID based on the item's attributes.

func SetExtension

func SetExtension(item *gofeed.Item, prefix, name, value string)

Types

type Feeds

type Feeds interface {
	ParseFeed(ctx context.Context, content io.Reader) (*gofeed.Feed, error)
	RenderFeed(ctx context.Context, feed *gofeed.Feed) (string, error)
	FilterItems(ctx context.Context, feed *gofeed.Feed, domains []string) []ItemHashPair
	RenderItem(ctx context.Context, item *gofeed.Item) (string, error)
	ExtractCategories(item *gofeed.Item) []string
}

func NewFeeds

func NewFeeds(ctx context.Context, cfg *config.Config) Feeds

NewFeeds initializes a new feeds service

type ItemHashPair

type ItemHashPair struct {
	Hash string
	Item *gofeed.Item
}

ItemHashPair holds a feed item and its generated key

Jump to

Keyboard shortcuts

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