Documentation ¶
Index ¶
- type IStorage
- type LocalStorage
- type RedisStorage
- func (rd *RedisStorage) Del(key string) error
- func (rd *RedisStorage) Get(key string) (interface{}, error)
- func (rd *RedisStorage) Init(addr string, password string, db int) *RedisStorage
- func (rd *RedisStorage) Release(keys ...string) error
- func (rd *RedisStorage) Set(key string, value interface{}, force bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IStorage ¶
type IStorage interface { Set(key string, value interface{}, force bool) error Get(key string) (interface{}, error) Del(key string) error Release(keys ...string) error }
定义存储的接口
type LocalStorage ¶
type LocalStorage struct {
// contains filtered or unexported fields
}
func (*LocalStorage) Del ¶
func (ls *LocalStorage) Del(key string) error
func (*LocalStorage) Get ¶
func (ls *LocalStorage) Get(key string) (interface{}, error)
func (*LocalStorage) Release ¶
func (ls *LocalStorage) Release(keys ...string) error
type RedisStorage ¶
type RedisStorage struct {
// contains filtered or unexported fields
}
func (*RedisStorage) Del ¶
func (rd *RedisStorage) Del(key string) error
func (*RedisStorage) Get ¶
func (rd *RedisStorage) Get(key string) (interface{}, error)
func (*RedisStorage) Init ¶
func (rd *RedisStorage) Init(addr string, password string, db int) *RedisStorage
初始化自己
Click to show internal directories.
Click to hide internal directories.