Documentation
¶
Index ¶
- func CheckGocache() bool
- func CreateDefaultCache(config *Config)
- func CreateDefaultCacheFrom(config *Config) error
- func DumpItems(cfg *Config) error
- func NewCache(cfg *Config) *cache.Cache
- func NewCacheForm(cfg *Config) (*cache.Cache, error)
- func NewStarter() *starter
- func X() *cache.Cache
- func XF(f func(c *cache.Cache) error) error
- type CommonGocache
- func (*CommonGocache) Add(k string, v interface{}) error
- func (*CommonGocache) AddWithExp(k string, v interface{}, exp time.Duration) error
- func (*CommonGocache) Decrement(k string, v int64) error
- func (*CommonGocache) Delete(k string) bool
- func (*CommonGocache) Get(k string) (interface{}, bool)
- func (*CommonGocache) GetWithExp(k string) (interface{}, time.Time, bool)
- func (*CommonGocache) Increment(k string, v int64) error
- func (*CommonGocache) Replace(k string, v interface{}) error
- func (*CommonGocache) ReplaceWithExp(k string, v interface{}, exp time.Duration) error
- func (*CommonGocache) Set(k string, v interface{}) error
- func (*CommonGocache) SetWithExp(k string, v interface{}, exp time.Duration) error
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewStarter ¶
func NewStarter() *starter
Types ¶
type CommonGocache ¶ added in v1.1.5
type CommonGocache struct{}
func NewCommonGocache ¶ added in v1.1.5
func NewCommonGocache() *CommonGocache
func (*CommonGocache) Add ¶ added in v1.1.5
func (*CommonGocache) Add(k string, v interface{}) error
添加一个不存在或已超时的键值
func (*CommonGocache) AddWithExp ¶ added in v1.1.5
func (*CommonGocache) AddWithExp(k string, v interface{}, exp time.Duration) error
添加一个不存在或已超时的键值,带超时,单位s
func (*CommonGocache) Decrement ¶ added in v1.1.5
func (*CommonGocache) Decrement(k string, v int64) error
自减int64
func (*CommonGocache) Get ¶ added in v1.1.5
func (*CommonGocache) Get(k string) (interface{}, bool)
获取一个键值
func (*CommonGocache) GetWithExp ¶ added in v1.1.5
func (*CommonGocache) GetWithExp(k string) (interface{}, time.Time, bool)
获取一个带过期时间的键值
func (*CommonGocache) Increment ¶ added in v1.1.5
func (*CommonGocache) Increment(k string, v int64) error
自增int64
func (*CommonGocache) Replace ¶ added in v1.1.5
func (*CommonGocache) Replace(k string, v interface{}) error
更新一个已存在且未过期的键值,不满足条件则报错
func (*CommonGocache) ReplaceWithExp ¶ added in v1.1.5
func (*CommonGocache) ReplaceWithExp(k string, v interface{}, exp time.Duration) error
更新一个已存在且未过期的键值,不满足条件则报错,带超时,单位s
func (*CommonGocache) Set ¶ added in v1.1.5
func (*CommonGocache) Set(k string, v interface{}) error
更新或添加一个键值,无论是否已存在
func (*CommonGocache) SetWithExp ¶ added in v1.1.5
func (*CommonGocache) SetWithExp(k string, v interface{}, exp time.Duration) error
更新或添加一个键值,无论是否已存在,带超时,单位s
Click to show internal directories.
Click to hide internal directories.