store

package
v3.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemoryStore

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

InMemoryStore is a data store backed by InMemoryDB

func NewInMemoryStore

func NewInMemoryStore() *InMemoryStore

NewInMemoryStore creates a data store backed by InMemoryDB

func (*InMemoryStore) BuildInitialIndex

func (store *InMemoryStore) BuildInitialIndex() error

BuildInitialIndex create initial index (only if empty)

func (*InMemoryStore) ClearCache

func (store *InMemoryStore) ClearCache() error

ClearCache removes all items from the cache.

func (*InMemoryStore) ClearOutputs

func (store *InMemoryStore) ClearOutputs() error

ClearOutputs clear all outputs

func (*InMemoryStore) Close

func (store *InMemoryStore) Close() error

Close the DB

func (*InMemoryStore) CountFeeds

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

CountFeeds returns total numer of feeds.

func (*InMemoryStore) DeleteFeed

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

DeleteFeed removes a feed.

func (*InMemoryStore) DeleteOutput

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

DeleteOutput removes a output.

func (*InMemoryStore) EvictFromCache

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

EvictFromCache manage the cache eviction.

func (*InMemoryStore) ExistsFeed

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

ExistsFeed returns true if a feed exists for this url.

func (*InMemoryStore) ForEachFeed

func (store *InMemoryStore) ForEachFeed(cb func(*model.FeedDef) error) error

ForEachFeed iterates over all feeds

func (*InMemoryStore) ForEachOutput

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

ForEachOutput iterates over all outputs

func (*InMemoryStore) GetFeed

func (store *InMemoryStore) GetFeed(id string) (*model.FeedDef, error)

GetFeed returns a stored Feed.

func (*InMemoryStore) GetFromCache

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

GetFromCache returns a cached item.

func (*InMemoryStore) GetOutput

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

GetOutput returns a stored Output.

func (*InMemoryStore) ListFeeds

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

ListFeeds returns a paginated list of feeds.

func (*InMemoryStore) ListOutputs

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

ListOutputs returns a paginated list of outputs.

func (*InMemoryStore) SaveFeed

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

SaveFeed stores a feed.

func (*InMemoryStore) SaveOutput

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

SaveOutput stores a output.

func (*InMemoryStore) SearchFeeds

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

SearchFeeds search feeds using search index

func (*InMemoryStore) StoreToCache

func (store *InMemoryStore) 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