Documentation
¶
Index ¶
- Constants
- func DefaultUse(driverName string)
- func Del(key string) (err error)
- func Get(key string, value interface{}) (err error)
- func Has(key string) (ok bool)
- func Keys(pattern string) (available []string)
- func Set(key string, value interface{}, ttl time.Duration) (err error)
- type Cache
- type Config
- type Manager
- func (m *Manager) DefName() string
- func (m *Manager) Default() Cache
- func (m *Manager) DefaultUse(driverName string)
- func (m *Manager) Del(key string) (err error)
- func (m *Manager) Driver(driverName string) Cache
- func (m *Manager) Get(key string, value interface{}) (err error)
- func (m *Manager) Has(key string) (ok bool)
- func (m *Manager) Keys(pattern string) (available []string)
- func (m *Manager) Register(name string, driver Cache) *Manager
- func (m *Manager) Set(key string, value interface{}, ttl time.Duration) (err error)
- func (m *Manager) Use(driverName string) Cache
Constants ¶
View Source
const ( FreeCache = "freeCache" BigCache = "bigCache" Redis = "redis" MemCache = "memCache" )
Built in driver name
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache interface {
// Type returns the type of the cache
Type() string
// Get retrieve value at key from cache
Get(key string, value interface{}) (err error)
// Has checks if key is available in cache
Has(key string) (ok bool)
// Set stores a key with a given life time. 0 for permanent
Set(key string, value interface{}, ttl time.Duration) (err error)
// Del removes a key by name
Del(key string) (err error)
// Keys list all available cache keys
Keys(pattern string) (available []string)
// Clear removes all keys
Clear()
}
type Config ¶
type Config struct {
Engine string `config:"platform.cache.engine" default:"bigCache"`
}
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager definition with default driver name and drivers map
func (*Manager) DefaultUse ¶
DefaultUse sets default driver name
Click to show internal directories.
Click to hide internal directories.