db

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Archive

type Archive struct {
	Path string
	Data Data
}

Archive represents the location and the data of a given archive

func NewArchive

func NewArchive(path string) Archive

NewArchive will create a new Archive struct with the given path

func (*Archive) Add

func (a *Archive) Add(guid string, timestamp int64) error

Add will add the guid to the archive. Keep in mind that this is only in memory until Persist() is called

func (*Archive) Contains

func (a *Archive) Contains(guid string) bool

Contains will return true, if the guid is already part of the archive

func (*Archive) Persist

func (a *Archive) Persist() error

Persist will write the current data to the disk at the given path

func (*Archive) Read

func (a *Archive) Read()

Read will refresh the data included in the archive from the set path

type Data

type Data struct {
	Items []Item `json:"items"`
}

Data is just a list of guids that have already been processed for a given feed

type Item

type Item struct {
	Guid      string `json:"guid"`
	Timestamp int64  `json:"timestamp"`
}

Jump to

Keyboard shortcuts

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