storage

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type Storage

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

func New

func New(db *bolt.DB, cfg config.Config) *Storage

func (*Storage) ClearFeeds

func (st *Storage) ClearFeeds() error

func (*Storage) ClearWebhookStats added in v0.2.3

func (st *Storage) ClearWebhookStats() error

func (*Storage) CullItems

func (st *Storage) CullItems(cf config.ConfigFeed, limit int) error

CullItems deletes the oldest items when there are more items then a limit

func (*Storage) DB

func (st *Storage) DB() *bolt.DB

func (*Storage) GetFeedStats

func (st *Storage) GetFeedStats(name string) (*app.FeedStats, error)

GetFeedStats returns the stats for a feed.

func (*Storage) GetItemState

func (st *Storage) GetItemState(cf config.ConfigFeed, item *gofeed.Item) (app.ItemState, error)

GetItemState return the state of an item.

func (*Storage) GetWebhookStats

func (st *Storage) GetWebhookStats(name string) (*app.WebhookStats, error)

func (*Storage) Init

func (st *Storage) Init() error

Init creates all required buckets and deletes obsolete buckets.

func (*Storage) ItemCount

func (st *Storage) ItemCount(cf config.ConfigFeed) int

func (*Storage) ListFeeds

func (st *Storage) ListFeeds() ([]string, error)

func (*Storage) ListItems

func (st *Storage) ListItems(feed string) ([]*app.ProcessedItem, error)

func (*Storage) RecordItem

func (st *Storage) RecordItem(cf config.ConfigFeed, item *gofeed.Item) error

func (*Storage) UpdateFeedStats

func (st *Storage) UpdateFeedStats(name string, f func(fs *app.FeedStats) error) error

UpdateFeedStats executes a function that updates the stats for feed by name.

func (*Storage) UpdateWebhookStats

func (st *Storage) UpdateWebhookStats(name string, f func(ws *app.WebhookStats) error) error

UpdateWebhookStats executes a function that updates the stats for webhook by name.

Jump to

Keyboard shortcuts

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