Documentation ¶
Index ¶
- func BigCache(client *bigcache.BigCache) *storeBigCache
- func Expiration(expiration time.Duration) *optionExpiration
- func Gob() *optionSerializer
- func Json() *optionSerializer
- func Memcache(client *memcache.Client) *storeMemcache
- func Msgpack() *optionSerializer
- func Redis(client *redis.Client) *storeRedis
- func Tags(tags ...string) *optionTags
- type Decoder
- type Encoder
- type Serializer
- type Store
- type Type
- type Wukong
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Expiration ¶ added in v1.2.0
Expiration 配置过期时间
Types ¶
type Serializer ¶
Serializer 序列化接口,用于将结构体编码成二进制数组或者将二进制数据解码成结构体
type Store ¶
type Store interface { // Get 取得缓存值 Get(key string) ([]byte, error) // Set 设置缓存值 Set(key string, data []byte, expiration time.Duration, tags ...string) error // Delete 删除缓存值 Delete(key string) error // Invalidate 设置缓存失效 Invalidate(tags ...string) error // Clear 清除缓存 Clear() error // Type 缓存类型 Type() Type }
Store 描述一个缓存真正的存储
type Wukong ¶ added in v1.2.0
type Wukong interface { // Get 从缓存中取得对象 Get(key string) (value interface{}, err error) // Set 设置缓存值 Set(key string, value interface{}, options ...option) (err error) // Delete 从缓存中删除一个对象 Delete(key string) (err error) // Invalidate 让缓存失效 Invalidate(opts ...option) (err error) // Clear 清空缓存 Clear() (err error) // Serializer 设置序列化器 Serializer(serializer Serializer) // Type 缓存类型 Type() Type }
Wukong 描述一个缓存
Source Files ¶
- const.go
- decoder.go
- encoder.go
- option.go
- option_expiration.go
- option_serializer.go
- option_tags.go
- options.go
- serializer.go
- serializer_gob.go
- serializer_json.go
- serializer_msgpack.go
- serializer_xml.go
- store.go
- store_base.go
- store_big_cache.go
- store_func.go
- store_memcache.go
- store_redis.go
- type.go
- wukong.go
- wukong_default.go
Click to show internal directories.
Click to hide internal directories.