Documentation ¶
Index ¶
- Variables
- func Decr(key string) (int64, error)
- func DelKey(key string) error
- func ExistsKey(key string) (bool, error)
- func GenerateToken(id int, email string) (string, error)
- func GetKey(key string) (string, error)
- func Incr(key string) (int64, error)
- func LPop(key string) (string, error)
- func LPushAndTrimKey(key, value interface{}, size int64) error
- func LRange(key string, start, stop int64) ([]string, error)
- func MgetKey(keys ...interface{}) map[interface{}]string
- func MsetKey(key_value ...interface{}) error
- func RPushAndTrimKey(key, value interface{}, size int64) error
- func SetKey(key, value interface{}, expires int) error
- func TTLKey(key string) (int64, error)
- type Claims
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var Cfg *ini.File
View Source
var RedisPool *redis.Pool
Functions ¶
func LPushAndTrimKey ¶
LPushAndTrimKey
func MgetKey ¶
func MgetKey(keys ...interface{}) map[interface{}]string
mget 批量读取 mget key1, key2, 返回map结构
func MsetKey ¶
func MsetKey(key_value ...interface{}) error
mset 批量写入 rds.Do("MSET", "ket1", "value1", "key2","value2")
func RPushAndTrimKey ¶
RPushAndTrimKey
Types ¶
type Claims ¶
type Claims struct { UserID int `json:"user_id"` UserEmail string `json:"user_email"` jwt.StandardClaims }
func ParseToken ¶
type ServerConfig ¶
type ServerConfig struct { RunMode string HTTPPort int ReadTimeout time.Duration WriteTimeout time.Duration Type string User string Password string Host string DbName string TablePrefix string RedisHost string RedisPass string RedisIndex string JwtSecret string JwtTokenExpire int64 }
服务端配置数据结构
Click to show internal directories.
Click to hide internal directories.