pure2rss

package
v0.0.0-...-0486874 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoDataError = fmt.Errorf("no data found")

Functions

func CrawlerTimeout

func CrawlerTimeout(d time.Duration) crawlerOption

Types

type Cache

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

func NewCache

func NewCache(path string) (*Cache, error)

func (*Cache) Load

func (c *Cache) Load(url string) (Post, error)

func (*Cache) LoadCategory

func (c *Cache) LoadCategory(category string) ([]Post, error)

func (*Cache) Persist

func (c *Cache) Persist() error

func (*Cache) Store

func (c *Cache) Store(p Post) error

type Crawler

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

func NewCrawler

func NewCrawler(sitemapURL string, options ...crawlerOption) *Crawler

func (*Crawler) Done

func (c *Crawler) Done() <-chan error
func (c *Crawler) OnIndexLink(f func(Link) bool)
func (c *Crawler) OnPostLink(f func(Link))

func (*Crawler) Run

func (c *Crawler) Run()
type Link struct {
	Loc     string
	LastMod time.Time
}

func ParseSiteMap

func ParseSiteMap(reader io.Reader) ([]Link, error)

func ParseSiteMapList

func ParseSiteMapList(data io.Reader) ([]Link, error)

type Post

type Post struct {
	PostLink    PostLink
	Title       string
	Summary     string
	PublishDate time.Time
	Tags        []string
}

func FetchAndAndParsePost

func FetchAndAndParsePost(c *http.Client, postLink PostLink) (Post, error)
type PostLink struct {
	Link     Link
	Lang     string
	Category string
	Slug     string
}
func ParsePostLink(link Link) (PostLink, error)

Jump to

Keyboard shortcuts

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