reader

package
v0.0.0-...-7a5cd37 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config *config.Config, store storage.Store, log *slog.Logger) *reader

func ParseRss

func ParseRss(url string) ([]models.Post, error)

Получение среза постов/нововстей

Types

type Channel

type Channel struct {
	Title       string `xml:"title"`
	Description string `xml:"description"`
	Link        string `xml:"link"`
	Items       []Item `xml:"item"`
}

Метаданные Канала новостей

type Feed

type Feed struct {
	XMLName xml.Name `xml:"rss"`
	Chanel  Channel  `xml:"channel"`
}

Подписка

func GetRss

func GetRss(url string) (*Feed, error)

Получение подписки новостей

type Item

type Item struct {
	Title       string `xml:"title"`
	Description string `xml:"description"`
	Link        string `xml:"link"`
	PubDate     string `xml:"pubDate"`
	Author      string `xml:"author"`
	Guid        string `xml:"guid"`
}

Отдельная новость в подписке

Jump to

Keyboard shortcuts

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