Documentation ¶
Index ¶
- Constants
- type Container
- type ContainerErr
- type ErrorType
- type MemContainer
- type RedisContainer
- func (rc *RedisContainer) ClearAll() error
- func (rc *RedisContainer) Count() (int64, error)
- func (rc *RedisContainer) Delete(key string) error
- func (rc *RedisContainer) Eof() bool
- func (rc *RedisContainer) Get(key string) (string, error)
- func (rc *RedisContainer) IsExist(key string) bool
- func (rc *RedisContainer) ScanNext() ([]string, error)
- func (rc *RedisContainer) Set(key string, val string, expire int64) error
- func (rc *RedisContainer) StartScan()
Constants ¶
View Source
const ( CTRedis = "Redis" CTMemory = "Memory" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container interface { Get(key string) (string, error) Set(key string, val string, expire int64) error //expire: secend Delete(key string) error IsExist(key string) bool Count() (int64, error) }
func NewContainer ¶
type ContainerErr ¶
type ContainerErr struct {
// contains filtered or unexported fields
}
func (ContainerErr) Error ¶
func (e ContainerErr) Error() string
type MemContainer ¶
func (*MemContainer) Count ¶
func (mr *MemContainer) Count() (int64, error)
func (*MemContainer) Delete ¶
func (mr *MemContainer) Delete(key string) error
func (*MemContainer) IsExist ¶
func (mr *MemContainer) IsExist(key string) bool
type RedisContainer ¶
type RedisContainer struct {
// contains filtered or unexported fields
}
func (*RedisContainer) ClearAll ¶
func (rc *RedisContainer) ClearAll() error
ClearAll clean all cache in redis. delete this redis collection.
func (*RedisContainer) Delete ¶
func (rc *RedisContainer) Delete(key string) error
Delete cache in redis.
func (*RedisContainer) Eof ¶
func (rc *RedisContainer) Eof() bool
func (*RedisContainer) IsExist ¶
func (rc *RedisContainer) IsExist(key string) bool
IsExist check cache's existence in redis.
func (*RedisContainer) ScanNext ¶
func (rc *RedisContainer) ScanNext() ([]string, error)
ScanNext ...
func (*RedisContainer) Set ¶
func (rc *RedisContainer) Set(key string, val string, expire int64) error
//Append 。。。
func (rc *RedisContainer) Append(key, val string) error { if _, err := rc.do("SADD", key, val); err != nil { return err } if _, err := rc.do("HSET", rc.name, key, true); err != nil { return err } return nil }
Set ...
Click to show internal directories.
Click to hide internal directories.