Documentation ¶
Index ¶
- Variables
- type Config
- type Filter
- type Store
- func (s *Store) Close() error
- func (s *Store) Count(condition []*notification.Condition) (int, error)
- func (s *Store) List(condition []*notification.Condition, start string, asc bool, count int) (result []*notificationqueue.Receipt, iter string, err error)
- func (s *Store) Open() error
- func (s *Store) Remove(id string) (*notificationqueue.Receipt, error)
- func (s *Store) RetentionDays() (int, error)
- func (s *Store) Save(receipt *notificationqueue.Receipt) error
- func (s *Store) SupportedConditions() ([]string, error)
Constants ¶
This section is empty.
Variables ¶
var SupportedConditions []string
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { //kvdb config Database *kvdb.Config //Limit count limit,defalut value is notificationquque.DefaultStoreListLimit Limit int //RetentionDays data rretention in days RetentionDays int }
StoreConfig key-value receipt store config
func (*Config) CreateStore ¶
CreateStore create store
type Filter ¶
type Filter struct { Status *notificationdelivery.DeliveryStatus InMessage string NotificationFilter *notification.PlainFilter }
func (*Filter) ApplyCondition ¶
func (f *Filter) ApplyCondition(cond *notification.Condition) error
ApplyCondition apply search condition to filter ErrConditionNotSupported should be returned if condition keyword is not supported
func (*Filter) FilterReceipt ¶
func (f *Filter) FilterReceipt(r *notificationqueue.Receipt, ctx *notification.ConditionContext) (bool, error)
FilterReceipt filter receipt with given context Return if Receipt is valid
type Store ¶
type Store struct { DB *kvdb.Database DataRetentionDays int Limit int // contains filtered or unexported fields }
func (*Store) Count ¶
func (s *Store) Count(condition []*notification.Condition) (int, error)
Count count store with given search conditions
func (*Store) List ¶
func (s *Store) List(condition []*notification.Condition, start string, asc bool, count int) (result []*notificationqueue.Receipt, iter string, err error)
List list no more than count notifactions in store with given search conditions form start position . Count should be greater than 0. Found receipts and next list position iter will be returned. Return largest id receipts if asc is false.
func (*Store) Remove ¶
func (s *Store) Remove(id string) (*notificationqueue.Receipt, error)
Remove remove receipt by given notification id and return removed receipt.
func (*Store) RetentionDays ¶
RetentionDays log retention period in day.
func (*Store) Save ¶
func (s *Store) Save(receipt *notificationqueue.Receipt) error
Save save given notificaiton to store. Receipt with same notification id will be overwritten.
func (*Store) SupportedConditions ¶
SupportedConditions return supported condition keyword list