rsshelp

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RssBody added in v1.0.4

type RssBody struct {
	Channel RssChannel `xml:"channel"`
}

RssBody rss内容body

func (*RssBody) Parse added in v1.0.4

func (rss *RssBody) Parse(r io.Reader) error

type RssChannel added in v1.0.4

type RssChannel struct {
	Title       string `xml:"title"`
	Description string `xml:"description"`
	Link        string `xml:"link"`
	PubDate     string `xml:"pubDate"`
	Language    string `xml:"language"`
	Copyright   string `xml:"copyright"`
	Generator   string `xml:"generator"`
	Image       struct {
		Title string `xml:"title"`
		Url   string `xml:"url"`
		Link  string `xml:"link"`
	} `xml:"image"`
	Items []*RssItems `xml:"item"`
}

type RssFetcher

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

func NewRssFetcher

func NewRssFetcher(l v1log.ILog) *RssFetcher

func (*RssFetcher) AddHandler

func (w *RssFetcher) AddHandler(h RssHandler)

func (*RssFetcher) AddRss

func (w *RssFetcher) AddRss(name, url string)

func (*RssFetcher) AddRssMeta

func (w *RssFetcher) AddRssMeta(meta ...*RssMeta)

func (*RssFetcher) Fetch

func (w *RssFetcher) Fetch()

func (*RssFetcher) FetchHandler

func (w *RssFetcher) FetchHandler(handlers ...RssHandler)

FetchHandler 顺序拉取

type RssHandler

type RssHandler func(meta *RssMeta, body *RssBody)

type RssItems added in v1.0.4

type RssItems struct {
	Title       string `json:"title" xml:"title"`             //新闻标题
	Author      string `json:"author" xml:"author"`           //作者
	Link        string `json:"link" xml:"link"`               //连接
	PubDate     string `json:"pubDate" xml:"pubDate"`         //发布日期/时间
	Description string `json:"description" xml:"description"` //描述信息
}

type RssMeta added in v1.0.4

type RssMeta struct {
	Name   string
	RssUrl string
}

RssMeta 源信息

Jump to

Keyboard shortcuts

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