Documentation ¶
Index ¶
- type Client
- type Config
- type MultiClient
- func (cc *MultiClient) DelFromMemory(key string)
- func (cc *MultiClient) Delete(key string)
- func (cc *MultiClient) Get(key string) (interface{}, bool)
- func (cc *MultiClient) GetIntWithSet(key string, resultObj int64) (int64, bool)
- func (cc *MultiClient) GetInternalClient() *cache.Cache
- func (cc *MultiClient) GetSliceOrBytes(key string) (interface{}, bool)
- func (cc *MultiClient) GetWithSet(key string, resultObj interface{}) (interface{}, bool)
- func (cc *MultiClient) Set(key string, val interface{})
- func (cc *MultiClient) SetInMemory(key string, val interface{})
- func (cc *MultiClient) SetWithExpire(key string, val interface{}, secs int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MultiClient ¶
type MultiClient struct {
// contains filtered or unexported fields
}
func NewMultiClient ¶
func NewMultiClient(prefix, mcServer string, defCacheTime int) *MultiClient
NewMultiClient method will return a pointer to MultiClient object
func NewMultiClientV2 ¶
func NewMultiClientV2(opts *Config) *MultiClient
NewMultiClientV2 method will return a pointer to MultiClient object
func (*MultiClient) DelFromMemory ¶
func (cc *MultiClient) DelFromMemory(key string)
DelFromMemory method will delete the object from memory
func (*MultiClient) Delete ¶
func (cc *MultiClient) Delete(key string)
Delete method will remove the key from both memory cache and memcache
func (*MultiClient) Get ¶
func (cc *MultiClient) Get(key string) (interface{}, bool)
Get method tires to find the key from memory cache then check memcache
func (*MultiClient) GetIntWithSet ¶
func (cc *MultiClient) GetIntWithSet(key string, resultObj int64) (int64, bool)
GetIntWithSet method tries to get the key from program memory cache and if it fails then tries memcache and if the item is found in memcache then it is set in program memory for faster lookup
func (*MultiClient) GetInternalClient ¶
func (cc *MultiClient) GetInternalClient() *cache.Cache
GetInternalClient method will return the pointer to internal memory cache client
func (*MultiClient) GetSliceOrBytes ¶
func (cc *MultiClient) GetSliceOrBytes(key string) (interface{}, bool)
GetSliceOrBytes method tries to get the key from program memory cache and if it fails then tries memcache and if the item is found in memcache then it is set in program memory for faster lookup
func (*MultiClient) GetWithSet ¶
func (cc *MultiClient) GetWithSet(key string, resultObj interface{}) (interface{}, bool)
GetWithSet method tries to get the key from program memory cache and if it fails then tries memcache and if the item is found in memcache then it is set in program memory for faster lookup
func (*MultiClient) Set ¶
func (cc *MultiClient) Set(key string, val interface{})
Set method will set the object in both memory cache and memcache
func (*MultiClient) SetInMemory ¶
func (cc *MultiClient) SetInMemory(key string, val interface{})
SetInMemory method will set the object in memory cache
func (*MultiClient) SetWithExpire ¶
func (cc *MultiClient) SetWithExpire(key string, val interface{}, secs int)
SetWithExpire method will set the object in both memory cache and memcache