Documentation ¶
Index ¶
- Variables
- func GetFiberStorage(storage Cache) fiber.Storage
- type BaseCache
- type Bbolt
- func (p *Bbolt) Close() error
- func (p *Bbolt) Decr(key string) (int64, error)
- func (p *Bbolt) DecrBy(key string, value int64) (int64, error)
- func (p *Bbolt) Del(key ...string) error
- func (p *Bbolt) Exists(keys ...string) (bool, error)
- func (p *Bbolt) Expire(key string, timeout time.Duration) (bool, error)
- func (p *Bbolt) Get(key string) (string, error)
- func (p *Bbolt) HDecr(key string, field string) (int64, error)
- func (p *Bbolt) HDecrBy(key string, field string, increment int64) (int64, error)
- func (p *Bbolt) HDel(key string, fields ...string) (int64, error)
- func (p *Bbolt) HExists(key string, field string) (bool, error)
- func (p *Bbolt) HGet(key, field string) (string, error)
- func (p *Bbolt) HGetAll(key string) (map[string]string, error)
- func (p *Bbolt) HIncr(key string, subKey string) (int64, error)
- func (p *Bbolt) HIncrBy(key string, field string, increment int64) (int64, error)
- func (p *Bbolt) HKeys(key string) ([]string, error)
- func (p *Bbolt) HSet(key string, field string, value interface{}) (bool, error)
- func (p *Bbolt) Incr(key string) (int64, error)
- func (p *Bbolt) IncrBy(key string, value int64) (int64, error)
- func (p *Bbolt) Reset() error
- func (p *Bbolt) SAdd(key string, members ...string) (int64, error)
- func (p *Bbolt) SMembers(key string) ([]string, error)
- func (p *Bbolt) SPop(key string) (string, error)
- func (p *Bbolt) SRandMember(key string, count ...int64) ([]string, error)
- func (p *Bbolt) SRem(key string, members ...string) (int64, error)
- func (p *Bbolt) Set(key string, value any) error
- func (p *Bbolt) SetEx(key string, value any, timeout time.Duration) error
- func (p *Bbolt) SetNx(key string, value interface{}) (bool, error)
- func (p *Bbolt) SetNxWithTimeout(key string, value interface{}, timeout time.Duration) (bool, error)
- func (p *Bbolt) SisMember(key, field string) (bool, error)
- func (p *Bbolt) Ttl(key string) (time.Duration, error)
- type Cache
- type Config
- type FiberStorage
- type Item
- type Mem
- func (p *Mem) Close() error
- func (p *Mem) Decr(key string) (int64, error)
- func (p *Mem) DecrBy(key string, value int64) (int64, error)
- func (p *Mem) Del(key ...string) error
- func (p *Mem) Exists(keys ...string) (bool, error)
- func (p *Mem) Expire(key string, timeout time.Duration) (bool, error)
- func (p *Mem) Get(key string) (string, error)
- func (p *Mem) HDecr(key string, field string) (int64, error)
- func (p *Mem) HDecrBy(key string, field string, increment int64) (int64, error)
- func (p *Mem) HDel(key string, fields ...string) (int64, error)
- func (p *Mem) HExists(key string, field string) (bool, error)
- func (p *Mem) HGet(key, field string) (string, error)
- func (p *Mem) HGetAll(key string) (map[string]string, error)
- func (p *Mem) HIncr(key string, subKey string) (int64, error)
- func (p *Mem) HIncrBy(key string, field string, increment int64) (int64, error)
- func (p *Mem) HKeys(key string) ([]string, error)
- func (p *Mem) HSet(key string, field string, value interface{}) (bool, error)
- func (p *Mem) Incr(key string) (int64, error)
- func (p *Mem) IncrBy(key string, value int64) (int64, error)
- func (p *Mem) Reset() error
- func (p *Mem) SAdd(key string, members ...string) (int64, error)
- func (p *Mem) SMembers(key string) ([]string, error)
- func (p *Mem) SPop(key string) (string, error)
- func (p *Mem) SRandMember(key string, count ...int64) ([]string, error)
- func (p *Mem) SRem(key string, members ...string) (int64, error)
- func (p *Mem) Set(key string, val any) error
- func (p *Mem) SetEx(key string, value any, timeout time.Duration) error
- func (p *Mem) SetNx(key string, value interface{}) (bool, error)
- func (p *Mem) SetNxWithTimeout(key string, value interface{}, timeout time.Duration) (bool, error)
- func (p *Mem) SisMember(key, field string) (bool, error)
- func (p *Mem) Ttl(key string) (time.Duration, error)
- type Redis
- func (p *Redis) Close() error
- func (p *Redis) Decr(key string) (int64, error)
- func (p *Redis) DecrBy(key string, value int64) (int64, error)
- func (p *Redis) Del(keys ...string) (err error)
- func (p *Redis) Exists(keys ...string) (bool, error)
- func (p *Redis) Expire(key string, timeout time.Duration) (bool, error)
- func (p *Redis) Get(key string) (string, error)
- func (p *Redis) HDecr(key string, field string) (int64, error)
- func (p *Redis) HDecrBy(key string, field string, increment int64) (int64, error)
- func (p *Redis) HDel(key string, fields ...string) (int64, error)
- func (p *Redis) HExists(key, field string) (bool, error)
- func (p *Redis) HGet(key, field string) (string, error)
- func (p *Redis) HGetAll(key string) (map[string]string, error)
- func (p *Redis) HIncr(key string, subKey string) (int64, error)
- func (p *Redis) HIncrBy(key string, field string, increment int64) (int64, error)
- func (p *Redis) HIncrByFloat(key string, field string, increment float64) (float64, error)
- func (p *Redis) HKeys(key string) ([]string, error)
- func (p *Redis) HSet(key string, field string, value interface{}) (bool, error)
- func (p *Redis) HVals(key string) ([]string, error)
- func (p *Redis) Incr(key string) (int64, error)
- func (p *Redis) IncrBy(key string, value int64) (int64, error)
- func (p *Redis) IncrByFloat(key string, increment float64) (float64, error)
- func (p *Redis) SAdd(key string, members ...string) (int64, error)
- func (p *Redis) SMembers(key string) ([]string, error)
- func (p *Redis) SPop(key string) (string, error)
- func (p *Redis) SRandMember(key string, count ...int64) ([]string, error)
- func (p *Redis) SRem(key string, members ...string) (int64, error)
- func (p *Redis) Set(key string, value interface{}) (err error)
- func (p *Redis) SetEx(key string, value interface{}, timeout time.Duration) error
- func (p *Redis) SetNx(key string, value interface{}) (bool, error)
- func (p *Redis) SetNxWithTimeout(key string, value interface{}, timeout time.Duration) (bool, error)
- func (p *Redis) SisMember(key, field string) (bool, error)
- func (p *Redis) Ttl(key string) (time.Duration, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var NotFound = errors.New("key not found")
Functions ¶
func GetFiberStorage ¶
func GetFiberStorage(storage Cache) fiber.Storage
Types ¶
type BaseCache ¶
type BaseCache interface { Get(key string) (string, error) Set(key string, value any) error SetEx(key string, value any, timeout time.Duration) error SetNx(key string, value interface{}) (bool, error) SetNxWithTimeout(key string, value interface{}, timeout time.Duration) (bool, error) Ttl(key string) (time.Duration, error) Expire(key string, timeout time.Duration) (bool, error) Incr(key string) (int64, error) Decr(key string) (int64, error) IncrBy(key string, value int64) (int64, error) DecrBy(key string, value int64) (int64, error) Exists(keys ...string) (bool, error) HSet(key string, field string, value interface{}) (bool, error) HGet(key, field string) (string, error) HDel(key string, fields ...string) (int64, error) HKeys(key string) ([]string, error) HGetAll(key string) (map[string]string, error) HExists(key string, field string) (bool, error) HIncr(key string, subKey string) (int64, error) HIncrBy(key string, field string, increment int64) (int64, error) HDecr(key string, field string) (int64, error) HDecrBy(key string, field string, increment int64) (int64, error) SAdd(key string, members ...string) (int64, error) SMembers(key string) ([]string, error) SRem(key string, members ...string) (int64, error) SRandMember(key string, count ...int64) ([]string, error) SPop(key string) (string, error) SisMember(key, field string) (bool, error) // 成员是否存在 Del(key ...string) error Close() error }
type Bbolt ¶
type Bbolt struct {
// contains filtered or unexported fields
}
func (*Bbolt) SRandMember ¶
func (*Bbolt) SetNxWithTimeout ¶
type Cache ¶
type Cache interface { BaseCache GetBool(key string) (bool, error) GetInt(key string) (int, error) GetUint(key string) (uint, error) GetInt32(key string) (int32, error) GetUint32(key string) (uint32, error) GetInt64(key string) (int64, error) GetUint64(key string) (uint64, error) GetFloat32(key string) (float32, error) GetFloat64(key string) (float64, error) GetSlice(key string) ([]string, error) GetBoolSlice(key string) ([]bool, error) GetIntSlice(key string) ([]int, error) GetUintSlice(key string) ([]uint, error) GetInt32Slice(key string) ([]int32, error) GetUint32Slice(key string) ([]uint32, error) GetInt64Slice(key string) ([]int64, error) GetUint64Slice(key string) ([]uint64, error) GetFloat32Slice(key string) ([]float32, error) GetFloat64Slice(key string) ([]float64, error) GetJson(key string, j interface{}) error HGetJson(key, field string, j interface{}) error Limit(key string, limit int64, timeout time.Duration) (bool, error) }
type Config ¶
type Config struct { // Cache type, support mem, redis, bbolt, default mem Type string `yaml:"type"` // Cache address // mem: empty // redis: redis address, default 127.0.0.1:6379 // bbolt: bbolt file path, default ./ice.cache Address string `yaml:"address"` // Cache password // mem: empty // redis: redis password // bbolt: empty Password string `yaml:"password"` }
type FiberStorage ¶
type FiberStorage struct {
// contains filtered or unexported fields
}
func (*FiberStorage) Close ¶
func (p *FiberStorage) Close() error
func (*FiberStorage) Delete ¶
func (p *FiberStorage) Delete(key string) error
func (*FiberStorage) Reset ¶
func (p *FiberStorage) Reset() error
type Item ¶
type Redis ¶
type Redis struct {
// contains filtered or unexported fields
}
func (*Redis) HIncrByFloat ¶
func (*Redis) IncrByFloat ¶
func (*Redis) SRandMember ¶
func (*Redis) SetNxWithTimeout ¶
Click to show internal directories.
Click to hide internal directories.