Documentation
¶
Index ¶
- Constants
- func ClosePool() error
- func Connection() redis.Conn
- func Delete(key string) error
- func GenKey(tpl string, keys ...interface{}) string
- func Get(key string) interface{}
- func GetAndMapTo(key string, v interface{}) (err error)
- func Has(key string) bool
- func InitCache() (err error)
- func Set(key string, data interface{}, ttl int) error
Constants ¶
View Source
const ( UserInfo = "user:%d" OrderInfo = "order:%d" )
View Source
const FiveMinutes = 300
5 分钟
View Source
const Forever = 0
Forever
View Source
const HalfDay = 43200
12 小时(半天)
View Source
const HalfHour = 1800
半小时
View Source
const OneDay = 86400
24 小时(1 天)
View Source
const OneHour = 3600
One hour
View Source
const OneMinutes = 60
One minutes
View Source
const OneWeek = 604800
7 天(一周)
View Source
const TenMinutes = 600
10 分钟
View Source
const ThreeDay = 259200
3 天
View Source
const ThreeHour = 10800
3 小时
View Source
const ThreeMinutes = 180
ThreeMinutes 3 分钟
View Source
const TwoDay = 172800
2 天
View Source
const TwoHour = 7200
2 小时
View Source
const TwoMinutes = 120
Two minutes 2 分钟
Variables ¶
This section is empty.
Functions ¶
func Connection ¶
Connection return redis connection. Usage:
conn := redis.Connection() defer conn.Close() ... do something ...
func InitCache ¶
func InitCache() (err error)
init cache redis conn pool ref package: github.com/astaxie/beego/cache/redis redigo doc https://godoc.org/github.com/gomodule/redigo/redis#pkg-examples
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.