Versions in this module Expand all Collapse all v1 v1.1.1 Feb 13, 2022 Changes in this version + const E_cancelled + const E_no_item_to_get + const E_not_found_any_collection_key + const E_remove_problem + const E_upsert_problem + type Collection struct + func CreateCollection(config *CollectionConfig) (*Collection, error) + func (c *Collection) Delete(ctx context.Context, key interface{}) error + func (c *Collection) GC() error + func (c *Collection) Get(ctx context.Context, key interface{}) (interface{}, bool) + func (c *Collection) IsKeyExisted(key interface{}) bool + func (c *Collection) Iter(ctx context.Context, key interface{}, ...) + func (c *Collection) Key() string + func (c *Collection) Len() int + func (c *Collection) Upsert(ctx context.Context, key interface{}, value interface{}) error + func (c *Collection) Upserts(ctx context.Context, in ...*CollectionKV) (int, error) + type CollectionConfig struct + Capacity int + ExpireDuration time.Duration + GCInterval time.Duration + Key string + type CollectionKV struct + Key interface{} + Value interface{} + type CollectionValue struct + Created int64 + Value interface{} + type Engine struct + func Start(cfs ...*CollectionConfig) *Engine + func (e *Engine) AddCollection(cfs ...*CollectionConfig) error + func (e *Engine) Collection() map[string]*Collection + func (e *Engine) CollectionConfig() map[string]*CollectionConfig + func (e *Engine) Info() + func (e *Engine) Select(ctx context.Context, collectionKey string) *Session + type GetterFn func(interface{}) (interface{}, error) + type ICollection interface + Delete func(ctx context.Context, key interface{}) error + GC func() + Get func(ctx context.Context, key interface{}) (interface{}, bool) + IsKeyExisted func(key interface{}) bool + Iter func(ctx context.Context, key interface{}, ...) + Key func() string + Len func() int + Upsert func(ctx context.Context, key, value interface{}) error + Upserts func(ctx context.Context, in ...*CollectionKV) (int, error) + type IEngine interface + AddCollection func(cf ...*CollectionConfig) error + Collection func() map[string]*Collection + CollectionConfig func() map[string]*CollectionConfig + Info func() + Select func(ctx context.Context, collectionKey string) ICollection + type ISession interface + Close func() + Delete func(key interface{}, setterFns ...SetterFn) error + Exec func(outptr interface{}) error + Filter func(iter func(interface{}, int) bool, getterFns ...GetterFn) ISession + Get func(iter func(interface{}, int) bool, getterFns ...GetterFn) error + Upsert func(key, value interface{}, setterFns ...SetterFn) error + type Session struct + func (s *Session) Close() + func (s *Session) Delete(key interface{}, setterFns ...SetterFn) error + func (s *Session) Exec(outptr interface{}) (bool, error) + func (s *Session) Filter(key interface{}, iter func(interface{}, int) bool, getterFns ...GetterFn) *Session + func (s *Session) Get(key interface{}, iter func(interface{}, int) bool, getterFns ...GetterFn) *Session + func (s *Session) KeyBulder(sim interface{}) interface{} + func (s *Session) Upsert(key interface{}, value interface{}, setterFns ...SetterFn) error + type SessionConfig struct + type SetterFn func(interface{}, interface{}) error