utils

package
v0.0.0-...-df0c874 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: CC0-1.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FeedProvider

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

func NewFeedProvider

func NewFeedProvider(cfg FeedProviderCfg) (*FeedProvider, error)

func (*FeedProvider) Stop

func (obj *FeedProvider) Stop() error

func (*FeedProvider) WritePage

func (obj *FeedProvider) WritePage(w io.Writer, pageName string) error

type FeedProviderCfg

type FeedProviderCfg struct {
	DatabaseFile string
	PageTemplate *template.Template
	Frequency    time.Duration
	Period       time.Duration
	Sources      []Source
	Logger       *log.Logger
}

type Record

type Record struct {
	CollectDate time.Time
	Date        time.Time
	Title       string
	Url         string
	Tags        []string
	Source      string
}

type Source

type Source interface {
	Collect(chan<- Record, time.Time) error
}

type TemplateCfg

type TemplateCfg struct {
	Records     []Record
	CurrentPage string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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