Versions in this module Expand all Collapse all v0 v0.21.18 Oct 13, 2021 v0.21.17 Sep 16, 2021 Changes in this version + const NoExpire + var ErrNewTableCache = errors.New("failed new table") + var ErrOrderSetMustBeBool = errors.New("order set must be bool") + var ErrTableExists = errors.New("table already exists") + var ErrUnknownTableOption = errors.New("unknown table option") + var ErrUnknownTableValueMode = errors.New("unknown table value mode") + type Cache interface + All func() []string + Delete func(tab string) bool + DeleteObject func(tab string, key interface{}) bool + DeleteObjects func(tab string) + GetTableCache func(tab string) (TableCache, bool) + Insert func(tab string, key, value interface{}) bool + InsertExpire func(tab string, key, value interface{}, expire time.Duration) bool + Lookup func(tab string, key interface{}) ([]interface{}, bool) + LookupAll func(tab string) (map[interface{}][]interface{}, bool) + Member func(tab string, key interface{}) bool + Members func(tab string) ([]interface{}, bool) + New func(tab string, options ...OptionFunc) error + SetExpire func(tab string, key interface{}, expire time.Duration) bool + func New() Cache + type DataValues struct + Exists map[interface{}]bool + Expire *time.Time + Key interface{} + Values []interface{} + type EvictCallback func(key interface{}, value interface{}) + type LRU struct + func NewLRU(name string, opts Options) (*LRU, error) + func (p *LRU) DeleteObject(key interface{}) (present bool) + func (p *LRU) DeleteObjects() + func (p *LRU) Insert(key, value interface{}) (evicted bool) + func (p *LRU) InsertExpire(key, value interface{}, expire time.Duration) bool + func (p *LRU) Lookup(key interface{}) ([]interface{}, bool) + func (p *LRU) LookupAll() (items map[interface{}][]interface{}, ok bool) + func (p *LRU) Member(key interface{}) bool + func (p *LRU) Members() (keys []interface{}, ok bool) + func (p *LRU) RemoveOldest() (key, value interface{}, ok bool) + func (p *LRU) SetExpire(key interface{}, expire time.Duration) bool + type OptionFunc func(*Options) + func OptionEvict(evict EvictCallback) OptionFunc + func OptionKeySize(size int) OptionFunc + func OptionValueMode(mode ValueMode) OptionFunc + type Options struct + Evict EvictCallback + Size int + ValueMode ValueMode + type TableCache interface + DeleteObject func(key interface{}) bool + DeleteObjects func() + Insert func(key, values interface{}) bool + InsertExpire func(key, value interface{}, expire time.Duration) bool + Lookup func(key interface{}) ([]interface{}, bool) + LookupAll func() (map[interface{}][]interface{}, bool) + Member func(key interface{}) bool + Members func() ([]interface{}, bool) + SetExpire func(key interface{}, expire time.Duration) bool + func NewTableCache(name string, opts ...OptionFunc) (TableCache, error) + type ValueMode int + const ValueModeBag + const ValueModeDuplicateBag + const ValueModeUnique