memcache

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2014 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

package memcahe for cache provider

depend on github.com/bradfitz/gomemcache/memcache

go install github.com/bradfitz/gomemcache/memcache

Usage: import(

_ "github.com/astaxie/beego/cache/memcache"
"github.com/astaxie/beego/cache"

)

bm, err := cache.NewCache("memcache", `{"conn":"127.0.0.1:11211"}`)

more docs http://beego.me/docs/module/cache.md

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemcacheCache added in v1.3.0

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

Memcache adapter.

func NewMemCache

func NewMemCache() *MemcacheCache

create new memcache adapter.

func (*MemcacheCache) ClearAll added in v1.3.0

func (rc *MemcacheCache) ClearAll() error

clear all cached in memcache.

func (*MemcacheCache) Decr added in v1.3.0

func (rc *MemcacheCache) Decr(key string) error

decrease counter.

func (*MemcacheCache) Delete added in v1.3.0

func (rc *MemcacheCache) Delete(key string) error

delete value in memcache.

func (*MemcacheCache) Get added in v1.3.0

func (rc *MemcacheCache) Get(key string) interface{}

get value from memcache.

func (*MemcacheCache) Incr added in v1.3.0

func (rc *MemcacheCache) Incr(key string) error

increase counter.

func (*MemcacheCache) IsExist added in v1.3.0

func (rc *MemcacheCache) IsExist(key string) bool

check value exists in memcache.

func (*MemcacheCache) Put added in v1.3.0

func (rc *MemcacheCache) Put(key string, val interface{}, timeout int64) error

put value to memcache. only support string.

func (*MemcacheCache) StartAndGC added in v1.3.0

func (rc *MemcacheCache) StartAndGC(config string) error

start memcache adapter. config string is like {"conn":"connection info"}. if connecting error, return.

Jump to

Keyboard shortcuts

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