store

package
v3.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

CacheBucketName bucket name

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

FeedBucketName bucket name

View Source
var OutputBucketName = []byte("OUTPUT")

OutputBucketName 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, quota model.Quota) (*BoltStore, error)

NewBoltStore creates a data store backed by BoltDB

func (*BoltStore) BuildInitialIndex

func (store *BoltStore) BuildInitialIndex() error

BuildInitialIndex create initial index (only if empty)

func (*BoltStore) ClearCache

func (store *BoltStore) ClearCache() error

ClearCache removes all items from the cache.

func (*BoltStore) ClearOutputs

func (store *BoltStore) ClearOutputs() error

ClearOutputs clear all outputs

func (*BoltStore) Close

func (store *BoltStore) Close() error

Close the DB.

func (*BoltStore) CountFeeds

func (store *BoltStore) CountFeeds() (int, error)

CountFeeds returns total numer of feeds.

func (*BoltStore) DeleteFeed

func (store *BoltStore) DeleteFeed(id string) (*model.FeedDef, error)

DeleteFeed removes a feed.

func (*BoltStore) DeleteOutput

func (store *BoltStore) DeleteOutput(ID string) (*model.OutputDef, error)

DeleteOutput removes a output.

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(*model.FeedDef) error) error

ForEachFeed iterates over all feeds

func (*BoltStore) ForEachOutput

func (store *BoltStore) ForEachOutput(cb func(*model.OutputDef) error) error

ForEachOutput iterates over all outputs

func (*BoltStore) GetFeed

func (store *BoltStore) GetFeed(id string) (*model.FeedDef, 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) GetOutput

func (store *BoltStore) GetOutput(ID string) (*model.OutputDef, error)

GetOutput returns a stored Output.

func (*BoltStore) ListFeeds

func (store *BoltStore) ListFeeds(page, size int) (*model.FeedDefPage, error)

ListFeeds returns a paginated list of feeds.

func (*BoltStore) ListOutputs

func (store *BoltStore) ListOutputs(page, limit int) (*model.OutputDefCollection, error)

ListOutputs returns a paginated list of outputs.

func (*BoltStore) SaveFeed

func (store *BoltStore) SaveFeed(feed *model.FeedDef) error

SaveFeed stores a feed.

func (*BoltStore) SaveOutput

func (store *BoltStore) SaveOutput(output model.OutputDef) (*model.OutputDef, error)

SaveOutput stores a output.

func (*BoltStore) SearchFeeds

func (store *BoltStore) SearchFeeds(query string, page, size int) (*model.FeedDefPage, error)

SearchFeeds search feeds using search index

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