embeddedstore

package
v0.0.0-...-c7c8722 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

RequiredKvdbFeatures required kvdb featuers

Functions

This section is empty.

Types

type Config

type Config struct {
	//Database kvdb config
	Database *kvdb.Config
	//Limit count limit,defalut value is notificationquque.DefaultStoreListLimit
	Limit int
}

Config draft box config

func (*Config) CreateStore

func (c *Config) CreateStore() (notification.Store, error)

CreateStore create draftbox with config

type Store

type Store struct {
	DB    *kvdb.Database
	Limit int
	// contains filtered or unexported fields
}

Store draftbox struct

func New

func New() *Store

New create new Store

func (*Store) Close

func (s *Store) Close() error

Close close draftbox and return any error if raised

func (*Store) Count

func (s *Store) Count(condition []*notification.Condition) (int, error)

Count draft box with given search conditions

func (*Store) List

func (s *Store) List(condition []*notification.Condition, start string, asc bool, count int) (result []*notification.Notification, iter string, err error)

List list no more than count notifactions in draftbox with given search conditions form start position . Count should be greater than 0. Found notifications and next list position iter will be returnes. Return largest id notification if asc is false.

func (*Store) Open

func (s *Store) Open() error

Open open draftbox and return any error if raised

func (*Store) Remove

func (s *Store) Remove(id string) (*notification.Notification, error)

Remove remove notification by given id and return removed notification.

func (*Store) Save

func (s *Store) Save(n *notification.Notification) error

Save save given notificaiton to draft box. Notification with same id will be overwritten.

func (*Store) SupportedConditions

func (s *Store) SupportedConditions() ([]string, error)

SupportedConditions return supported condition keyword list

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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