memcache

package
v0.0.0-...-9463477 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const PREFIX string = "mem_cache:"

Default prefix to prevent collision with other key stored in memcache

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func NewMemcacheStore

func NewMemcacheStore(c *memcache.Client, prefix string) *Cache

func (*Cache) ClearAll

func (mem *Cache) ClearAll() error

ClearAll clear all cached in memcache.

func (*Cache) Delete

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

Delete delete value from memcache.

func (*Cache) Get

func (mem *Cache) Get(key string) ([]byte, error)

Get get value from memcache

func (*Cache) IsExist

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

IsExist check value exists in memcache.

func (*Cache) Put

func (mem *Cache) Put(key string, data []byte, expire time.Duration) error

Put put value to memcache.

Jump to

Keyboard shortcuts

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