state

package
v0.0.0-...-73d26f1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

type State struct {
	Username string `json:"username"`
	URL      string `json:"url"`
	// optional fields that might be filled up down the road
	ETag         string       `json:"etag,omitempty"`
	LastModified string       `json:"lastmodified,omitempty"`
	Feed         *gofeed.Feed `json:"feed,omitempty"`
}

State contains cache information that can be re-used later on. A state is scoped around a single username.

func LoadState

func LoadState(username string) (*State, error)

LoadState loads a state from disk. The path is computed from a username.

func NewState

func NewState(username string) *State

NewState creates a new state based on a specific username.

func (*State) Save

func (s *State) Save() error

Save serializes the state and dumps it to the disk.

Jump to

Keyboard shortcuts

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