store

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CACHE_BUCKET = []byte("CACHE")

CACHE_BUCKET bucket name

View Source
var FEED_BUCKET = []byte("FEED")

FEED_BUCKET bucket name

Functions

This section is empty.

Types

type BoltStore

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

BoltStore is a data store backed by BoltDB

func NewBoltStore

func NewBoltStore(datasource *url.URL) (*BoltStore, error)

NewBoltStore creates a data store backed by BoltDB

func (*BoltStore) ClearCache

func (store *BoltStore) ClearCache() error

ClearCache removes all items from the cache.

func (*BoltStore) DeleteFeed

func (store *BoltStore) DeleteFeed(id string) (*app.Feed, error)

DeleteFeed removes a feed.

func (*BoltStore) EvictFromCache

func (store *BoltStore) EvictFromCache(before time.Time) error

EvictFromCache manage the cache eviction.

func (*BoltStore) ExistsFeed

func (store *BoltStore) ExistsFeed(url string) bool

ExistsFeed returns true if a feed exists for this url.

func (*BoltStore) ForEachFeed

func (store *BoltStore) ForEachFeed(cb func(*app.Feed) error) error

ForEachFeed iterates over all feeds

func (*BoltStore) GetFeed

func (store *BoltStore) GetFeed(id string) (*app.Feed, error)

GetFeed returns a stored Feed.

func (*BoltStore) GetFromCache

func (store *BoltStore) GetFromCache(key string) (*model.CacheItem, error)

GetFromCache returns a cached item.

func (*BoltStore) ListFeeds

func (store *BoltStore) ListFeeds(page, limit int) (*app.FeedCollection, error)

ListFeeds returns a paginated list of feeds.

func (*BoltStore) SaveFeed

func (store *BoltStore) SaveFeed(feed *app.Feed) error

SaveFeed stores a feed.

func (*BoltStore) Shutdown added in v1.2.0

func (store *BoltStore) Shutdown() error

Shutdown the DB.

func (*BoltStore) StoreToCache

func (store *BoltStore) StoreToCache(key string, item *model.CacheItem) error

StoreToCache stores a item into the cache.

Jump to

Keyboard shortcuts

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