Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache interface {
//
// Del
// @Description: 删除缓存
// @param keys ...string
// @return error
//
Del(keys ...string) error
//
// GetE
// @Description: 获取缓存
// @param key string
// @return error
//
GetE(key string) ([]byte, error)
Get(key string) []byte
GetWithCreateE(key string, h Handle) ([]byte, error)
//
// GetWithCreate 获取缓存,如果没有就使用Handle创建并放回
// @Description:
// @param key string
// @param v interface{}
// @param h Handle
// @return error
//
GetWithCreate(key string, h Handle) []byte
//
// Set
// @Description: 设置缓存
// @param key string
// @param h Handle
// @return error
//
Set(key string, h Handle) error
//
// IsNilError
// @Description: 判断空数据 error
// @param err error
// @return bool
//
IsNilError(err error) bool
//
// IsExist
// @Description: 判断存在
// @param key string
// @return bool
//
IsExist(key string) bool
//
// WithContext
// @Description:
// @param ctx context.Context
// @return Cache
//
WithContext(ctx context.Context) Cache
GetContext() context.Context
}
Click to show internal directories.
Click to hide internal directories.