reader

package
v0.0.0-...-00092a5 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ManualFetchInterval = time.Hour
	MinFetchInterval    = time.Hour
	MaxFetchInterval    = 24 * time.Hour
	ErrorFetchInterval  = time.Hour
)
View Source
const (
	MaxMediaSize               = 10 * 1024 * 1024
	MediaDownloadTimeout       = 30 * time.Second
	GlobalImageDownloadTimeout = 2 * time.Minute
)
View Source
const (
	MaxImagesPerFeedItem = 20
)

Variables

View Source
var (
	ErrMediaTooLarge = errors.New("media file exceeds maximum size limit")
	ErrMediaTimeout  = errors.New("media download exceeded timeout limit")
)

Functions

func CalculateNextFetchTime

func CalculateNextFetchTime(consecutiveEmptyFetches int, avgItemsPerDay float64, wasManual bool) time.Time

func CreateImageReplacer

func CreateImageReplacer(md string, uploadFunc func(url string) (string, error)) markdown.ErrorReplacer

Types

type Cleaner

type Cleaner struct{}

func DefaultCleaner

func DefaultCleaner() *Cleaner

func (*Cleaner) CleanField

func (c *Cleaner) CleanField(in string) string

func (*Cleaner) HTMLToMarkdown

func (c *Cleaner) HTMLToMarkdown(in string) (string, error)

type Feed

type Feed struct {
	Title       string
	Description string
	Items       []*Item
}

type Fetcher

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

func NewFetcher

func NewFetcher(httpClient *http.Client) *Fetcher

func (*Fetcher) Fetch

func (f *Fetcher) Fetch(ctx context.Context, rssURL string) (*Feed, error)

func (*Fetcher) FetchMedia

func (f *Fetcher) FetchMedia(ctx context.Context, mediaURL string) (io.ReadCloser, error)

type Item

type Item struct {
	URL         string
	Title       string
	Summary     string
	PublishedAt *time.Time
}

Jump to

Keyboard shortcuts

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