storage

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	GithubToken        string
	GithubGistID       string
	GithubGistFileName string
}

Config contains params for the storage

func LoadConfig

func LoadConfig(params map[string]string) *Config

LoadConfig returns a new shiny config

func (*Config) HelpLines

func (c *Config) HelpLines() []string

HelpLines returns a string slice with config format help lines

func (*Config) String

func (c *Config) String() string

func (*Config) ValidateParams

func (c *Config) ValidateParams() error

ValidateParams validates params for the config

type Storage

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

Storage knows how to load and save last published time of the feeds

func New

func New(config *Config) *Storage

New constructs a new Storage

func (Storage) LoadTimes

func (s Storage) LoadTimes(urls []string) (map[string]time.Time, error)

LoadTimes maps each feed url to the last published time for the feed

func (Storage) SaveTimes

func (s Storage) SaveTimes(times map[string]time.Time) error

SaveTimes saves last published time for each feed

Jump to

Keyboard shortcuts

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