Documentation ¶
Index ¶
- Constants
- type Cache
- type Redis
- func (r *Redis) Delete(key string) error
- func (r *Redis) Get(key string) interface{}
- func (r *Redis) IsExist(key string) bool
- func (r *Redis) ListIndex(key string, index int) (item string, err error)
- func (r *Redis) ListLRange(key string, start, end int) (strArray []string, err error)
- func (r *Redis) ListLen(key string) (length int, err error)
- func (r *Redis) ListMaxLenRPush(key string, val interface{}, maxLen int) (err error)
- func (r *Redis) ListRPush(key string, val interface{}) (err error)
- func (r *Redis) Set(key string, val interface{}, timeout time.Duration) (err error)
- func (r *Redis) SetEX(key string, val interface{}, timeout time.Duration) (err error)
- type RedisOpts
Constants ¶
View Source
const RedisHost = "192.168.10.27:6379"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { Get(key string) interface{} Set(key string, val interface{}, timeout time.Duration) error IsExist(key string) bool Delete(key string) error }
TheCache interface
type Redis ¶
type Redis struct {
// contains filtered or unexported fields
}
Redis redis
func (*Redis) ListLRange ¶
func (*Redis) ListMaxLenRPush ¶
func (*Redis) ListRPush ¶
/////////////////////////////////////////////////////////////////////////////////////////////////
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.