Documentation ¶
Index ¶
- type Cache
- type Memcache
- func (mem *Memcache) Delete(key string) error
- func (mem *Memcache) Get(key string) interface{}
- func (mem *Memcache) GetString(key string) string
- func (mem *Memcache) IsExist(key string) bool
- func (mem *Memcache) Set(key string, val interface{}, timeout time.Duration) (err error)
- func (mem *Memcache) SetString(key string, val string, timeout time.Duration) (err error)
- type Memory
- func (mem *Memory) Delete(key string) error
- func (mem *Memory) Get(key string) interface{}
- func (mem *Memory) GetString(key string) string
- func (mem *Memory) IsExist(key string) bool
- func (mem *Memory) Set(key string, val interface{}, timeout time.Duration) (err error)
- func (mem *Memory) SetString(key string, val string, timeout time.Duration) (err error)
- type Redis
- func (r *Redis) Delete(key string) error
- func (r *Redis) Get(key string) interface{}
- func (r *Redis) GetString(key string) string
- func (r *Redis) IsExist(key string) bool
- func (r *Redis) Set(key string, val interface{}, timeout time.Duration) (err error)
- func (r *Redis) SetConn(conn *redis.Pool)
- func (r *Redis) SetString(key string, val string, timeout time.Duration) (err error)
- type RedisOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { Get(key string) interface{} GetString(key string) string Set(key string, val interface{}, timeout time.Duration) error SetString(key string, val string, timeout time.Duration) error IsExist(key string) bool Delete(key string) error }
Cache interface
type Memcache ¶
type Memcache struct {
// contains filtered or unexported fields
}
Memcache struct contains *memcache.Client
type Memory ¶
Memory struct contains *memcache.Client
type Redis ¶
type Redis struct {
// contains filtered or unexported fields
}
Redis redis cache
type RedisOpts ¶
type RedisOpts struct { Host string `yml:"host" json:"host"` Password string `yml:"password" json:"password"` Database int `yml:"database" json:"database"` MaxIdle int `yml:"max_idle" json:"max_idle"` MaxActive int `yml:"max_active" json:"max_active"` IdleTimeout int32 `yml:"idle_timeout" json:"idle_timeout"` //second }
RedisOpts redis 连接属性
Click to show internal directories.
Click to hide internal directories.