Documentation ¶
Index ¶
- type Option
- type Store
- func (store *Store) Clear()
- func (store *Store) Del(key string) error
- func (store *Store) DelMulti(keys []string)
- func (store *Store) Get(key string) (value interface{}, ok bool)
- func (store *Store) GetDel(key string) (value interface{}, ok bool)
- func (store *Store) GetMulti(keys []string) map[string]interface{}
- func (store *Store) GetSet(key string, ttl time.Duration, getValue func(key string) (interface{}, error)) (interface{}, error)
- func (store *Store) GetSetMulti(keys []string, ttl time.Duration, ...) map[string]interface{}
- func (store *Store) Has(key string) bool
- func (store *Store) Keys() []string
- func (store *Store) Len() int
- func (store *Store) Set(key string, value interface{}, ttl time.Duration) error
- func (store *Store) SetMulti(values map[string]interface{}, ttl time.Duration)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct { Database *mongo.Database Collection *mongo.Collection Option Option }
Store redis store
func (*Store) GetSet ¶
func (store *Store) GetSet(key string, ttl time.Duration, getValue func(key string) (interface{}, error)) (interface{}, error)
GetSet looks up a key's value from the cache. if does not exist add to the cache
func (*Store) GetSetMulti ¶
func (store *Store) GetSetMulti(keys []string, ttl time.Duration, getValue func(key string) (interface{}, error)) map[string]interface{}
GetSetMulti mulit get values, if does not exist add to the cache
Click to show internal directories.
Click to hide internal directories.