cache

package
v0.0.0-...-c6fdbb4 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2019 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Key

func Key(args ...interface{}) string

Types

type MemCache

type MemCache struct {
	// contains filtered or unexported fields
}

func NewMemCache

func NewMemCache(autoCleanEvery time.Duration) (mc *MemCache)

func (*MemCache) Clean

func (mc *MemCache) Clean() (n int)

func (*MemCache) Close

func (mc *MemCache) Close() error

func (*MemCache) Delete

func (mc *MemCache) Delete(key string) (err error)

func (*MemCache) Get

func (mc *MemCache) Get(key string) (val interface{}, found bool)

func (*MemCache) Reset

func (mc *MemCache) Reset()

func (*MemCache) Set

func (mc *MemCache) Set(key string, val interface{}, ttl time.Duration) (err error)

func (*MemCache) Update

func (mc *MemCache) Update(key string, fn func(old interface{}) (val interface{}, keepOldTTL bool, ttl time.Duration)) (err error)

if ttl is -1, the key gets deleted if keepOldTTL is true, the original expiry ts will be kept

Jump to

Keyboard shortcuts

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