Documentation ¶
Overview ¶
Package eurekache provides fallback cache system with multiple cache source
Index ¶
- func CopyValue(dst, src interface{}) bool
- type Cache
- type Eurekache
- func (e *Eurekache) AddCacheSource(cache Cache)
- func (e *Eurekache) ClearAll() error
- func (e *Eurekache) Get(key string, data interface{}) (ok bool)
- func (e *Eurekache) GetGobBytes(key string) (b []byte, ok bool)
- func (e *Eurekache) GetInterface(key string) (v interface{}, ok bool)
- func (e *Eurekache) Set(key string, data interface{})
- func (e *Eurekache) SetCacheSources(caches []Cache)
- func (e *Eurekache) SetExpire(key string, data interface{}, ttl int64)
- func (e *Eurekache) SetReadTimeout(d time.Duration)
- func (e *Eurekache) SetTimeout(d time.Duration)
- func (e *Eurekache) SetWriteTimeout(d time.Duration)
- type Item
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache interface { Get(string, interface{}) bool GetInterface(string) (interface{}, bool) GetGobBytes(string) ([]byte, bool) Set(string, interface{}) error SetExpire(string, interface{}, int64) error Clear() error }
Cache is interface for storing data
type Eurekache ¶
type Eurekache struct {
// contains filtered or unexported fields
}
Eurekache will contains multiple cache source
func (*Eurekache) AddCacheSource ¶ added in v0.3.1
AddCacheSource adds cache source
func (*Eurekache) Get ¶
Get searches cache by given key and returns flag of cache is existed or not. when cache hit, data is assigned.
func (*Eurekache) GetGobBytes ¶
GetGobBytes searches cache by given key and returns gob-encoded value.
func (*Eurekache) GetInterface ¶
GetInterface searches cache by given key and returns interface value.
func (*Eurekache) SetCacheSources ¶
SetCacheSources sets cache sources
func (*Eurekache) SetReadTimeout ¶ added in v0.3.2
SetReadTimeout sets read timeout
func (*Eurekache) SetTimeout ¶ added in v0.3.2
SetTimeout sets r/w timeout
func (*Eurekache) SetWriteTimeout ¶ added in v0.3.2
SetWriteTimeout sets write timeout
Click to show internal directories.
Click to hide internal directories.