Documentation ¶
Index ¶
- Variables
- func FromBytes(i []byte, o interface{}) error
- func ToBytes(d interface{}) ([]byte, error)
- type Configuration
- type ConfigurationMemcache
- type ConfigurationMemory
- type ConfigurationRedis
- type Handler
- func MockHandler() Handler
- func NewHandlerMemcache(servers string, prefix string, ttl time.Duration) Handler
- func NewHandlerMemcacheFromConfiguration(c ConfigurationMemcache) Handler
- func NewHandlerMemory(cleanupInterval time.Duration, maxSize int64, prefix string, ttl time.Duration) Handler
- func NewHandlerMemoryFromConfiguration(c ConfigurationMemory) Handler
- func NewHandlerRedis(redisConfig *redis.Options, prefix string, ttl time.Duration) Handler
- func NewHandlerRedisFromConfiguration(conf *ConfigurationRedis) Handler
- type Manager
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCacheFull = errors.New("Cache full") ErrCacheMiss = errors.New("Cache miss") ErrInvalidHandler = errors.New("Invalid handler") ErrInputMustBeASliceOfBytes = errors.New("Input must be a slice of bytes") )
Vars
Functions ¶
Types ¶
type Configuration ¶
type ConfigurationMemcache ¶
type ConfigurationMemcache struct { Configuration Servers string `json:"servers"` }
type ConfigurationMemory ¶
type ConfigurationMemory struct { CleanupInterval int64 `json:"cleanup_interval"` Configuration MaxSize int64 `json:"max_size"` }
type ConfigurationRedis ¶
type ConfigurationRedis struct { Configuration Addr string `json:"addr"` }
type Handler ¶
type Handler interface { Decrement(key string, delta uint64) (uint64, error) Del(k string) error Get(k string) (interface{}, error) Increment(key string, delta uint64) (uint64, error) SetOnEvicted(f func(k string, v interface{})) Handler Set(k string, v interface{}, ttl time.Duration) error Test() error }
func MockHandler ¶
func MockHandler() Handler
func NewHandlerMemcache ¶
NewHandlerMemcache creates a memcache handler
func NewHandlerMemcacheFromConfiguration ¶
func NewHandlerMemcacheFromConfiguration(c ConfigurationMemcache) Handler
NewHandlerMemcacheFromConfiguration creates a memcache handler based on a configuration
func NewHandlerMemory ¶
func NewHandlerMemory(cleanupInterval time.Duration, maxSize int64, prefix string, ttl time.Duration) Handler
NewHandlerMemory creates a memory handler
func NewHandlerMemoryFromConfiguration ¶
func NewHandlerMemoryFromConfiguration(c ConfigurationMemory) Handler
NewHandlerMemoryFromConfiguration creates a memory handler based on a configuration
func NewHandlerRedis ¶
NewHandlerRedis creates a redis handler
func NewHandlerRedisFromConfiguration ¶
func NewHandlerRedisFromConfiguration(conf *ConfigurationRedis) Handler
Click to show internal directories.
Click to hide internal directories.