cache

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2019 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Get(key string) interface{}
	Set(key string, val interface{}, timeout time.Duration) error
	IsExist(key string) bool
	Delete(key string) error
}

Cache interface

type Memory added in v1.0.1

type Memory struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Memory struct contains *memcache.Client

func NewMemory added in v1.0.1

func NewMemory() *Memory

NewMemory create new memcache

func (*Memory) Delete added in v1.0.1

func (mem *Memory) Delete(key string) error

Delete delete value in memcache.

func (*Memory) Get added in v1.0.1

func (mem *Memory) Get(key string) interface{}

Get return cached value

func (*Memory) IsExist added in v1.0.1

func (mem *Memory) IsExist(key string) bool

IsExist check value exists in memcache.

func (*Memory) Set added in v1.0.1

func (mem *Memory) Set(key string, val interface{}, timeout time.Duration) (err error)

Set cached value with key and expire time.

Jump to

Keyboard shortcuts

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