Documentation ¶
Index ¶
- Constants
- Variables
- func FilenameExists(filename string) bool
- func GetCurrentDir() (string, error)
- type BoolCmd
- type Cache
- type Cmd
- type Disk
- type MemCache
- func (mem *MemCache) Close() error
- func (mem *MemCache) Delete(key string) *StatusCmd
- func (mem *MemCache) FlushAll() *StatusCmd
- func (mem *MemCache) Get(key string) *Cmd
- func (mem *MemCache) Keys(prefix string) *SliceStringCmd
- func (mem *MemCache) Save() *StatusCmd
- func (mem *MemCache) Set(key string, value interface{}, ttl time.Duration) *StatusCmd
- type Options
- type SliceStringCmd
- type StatusCmd
- type WrapValue
Constants ¶
View Source
const (
StatusOK = "OK"
)
Variables ¶
View Source
var ( ErrKeysOverCapacity = errors.New("keys over capacity") ErrFilenameEmpty = errors.New("save filename empty") )
Functions ¶
func FilenameExists ¶
func GetCurrentDir ¶
Types ¶
type MemCache ¶
type MemCache struct {
// contains filtered or unexported fields
}
func NewMemCache ¶
func (*MemCache) Keys ¶
func (mem *MemCache) Keys(prefix string) *SliceStringCmd
type Options ¶
type Options struct { // 缓存容量, 默认 -1 不限制 byte Size int32 // 自动清除, 当ttl key存在不多时,可以关闭,默认关闭 AutoClean bool // 保存文件位置, 默认 不设置,不能 Save Filename string }
func NewDefaultOptions ¶
func NewDefaultOptions() Options
type SliceStringCmd ¶
type SliceStringCmd struct {
// contains filtered or unexported fields
}
func (*SliceStringCmd) Val ¶
func (cmd *SliceStringCmd) Val() []string
Click to show internal directories.
Click to hide internal directories.