Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultEvery = 60 // 1 minute
)
Functions ¶
Types ¶
type Cache ¶
type Cache interface {
Get(key string) interface{}
Set(key string, val interface{}, timeout time.Duration) error
Delete(key string) error
IsExist(key string) bool
Init(cfg interface{}) error
}
Cache interface
func NewMemCache ¶
func NewMemCache() Cache
func NewMemoryCache ¶
func NewMemoryCache() Cache
func NewRedisCache ¶
func NewRedisCache() Cache
type MemoryCache ¶
func (*MemoryCache) Delete ¶
func (bc *MemoryCache) Delete(name string) error
func (*MemoryCache) Get ¶
func (bc *MemoryCache) Get(name string) interface{}
func (*MemoryCache) Init ¶
func (bc *MemoryCache) Init(cfg interface{}) error
func (*MemoryCache) IsExist ¶
func (bc *MemoryCache) IsExist(name string) bool
type MemoryItem ¶
type MemoryItem struct {
// contains filtered or unexported fields
}
type MemoryOpts ¶
type MemoryOpts struct {
Interval int
}
Click to show internal directories.
Click to hide internal directories.