go_cache

package
v1.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitCTL

func InitCTL(conf *Config)

Types

type CTL

type CTL struct {
	Config *Config
	Cache  *cache.Cache
}
var Ctl *CTL

func (*CTL) Add

func (gcc *CTL) Add(k string, x interface{}, d time.Duration) error

func (*CTL) Delete

func (gcc *CTL) Delete(k string)

func (*CTL) DeleteExpired

func (gcc *CTL) DeleteExpired()

func (*CTL) Get

func (gcc *CTL) Get(k string) (interface{}, bool)

func (*CTL) Set

func (gcc *CTL) Set(k string, x interface{}, d time.Duration)

func (*CTL) SetDefault

func (gcc *CTL) SetDefault(k string, x interface{})

type Config

type Config struct {
	Expiration      int64 `json:"expiration" yaml:"expiration"`           // 默认过期时间
	CleanupInterval int64 `json:"cleanupInterval" yaml:"cleanupInterval"` // 定期清除间隔
}

func (*Config) NewGoCache

func (conf *Config) NewGoCache() *cache.Cache

初始化beego缓存

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL