rjio2

package
v0.0.0-...-0cb40df Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(option *FetchOption)

func RenderRss

func RenderRss(items []Item, config *Config) (string, error)

Types

type Config

type Config struct {
	TrackingPrefix string
	TemplatePath   string
}

type Feed

type Feed struct {
	Name  string
	URL   string
	Items []Item
}

type FeedSourceConfig

type FeedSourceConfig struct {
	Sources []FeedSourceConfigItem `yaml:"sources"`
}

type FeedSourceConfigItem

type FeedSourceConfigItem struct {
	Href string `yaml:"href" json:"url"`
	Slug string `yaml:"slug" json:"slug"`
}

type FetchOption

type FetchOption struct {
	SourcePath     string
	TemplatePath   string
	OutputPath     string
	TrackingPrefix string
}

type FileStorage

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

func NewFileStorage

func NewFileStorage(prefix string) *FileStorage

func (FileStorage) GetTemplate

func (storage FileStorage) GetTemplate(filename string) string

func (FileStorage) StoreRSS

func (storage FileStorage) StoreRSS(filename string, str string)

type Item

type Item struct {
	ID           int64     `json:"id"`
	FeedID       int64     `json:"feedId"`
	GUID         string    `json:"guid"`
	Title        string    `json:"title"`
	Description  string    `json:"description"`
	PubDate      time.Time `json:"pubdate"`
	Raw          string    `json:"raw"`
	EnclosureUrl string    `json:"enclosureUrl"`
	Entry        string    `json:"entry"`
}

Item represents an item in a feed

func ApplyEnclosurePrefix

func ApplyEnclosurePrefix(items []Item, prefix string) ([]Item, error)

apply prefix to enclosure url

type Storage

type Storage interface {
	GetTemplate(filename string)
	GetOPML(filename string)
	StoreRSS(filename string)
}

Jump to

Keyboard shortcuts

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