beego: Index | Files

package memcache

import ""

Package memcache for cache provider

depend on

go install

Usage: import(

_ ""


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

more docs


Package Files


func NewMemCache Uses

func NewMemCache() cache.Cache

NewMemCache creates a new memcache adapter.

type Cache Uses

type Cache struct {
    // contains filtered or unexported fields

Cache Memcache adapter.

func (*Cache) ClearAll Uses

func (rc *Cache) ClearAll(context.Context) error

ClearAll clears all cache in memcache.

func (*Cache) Decr Uses

func (rc *Cache) Decr(ctx context.Context, key string) error

Decr decreases counter.

func (*Cache) Delete Uses

func (rc *Cache) Delete(ctx context.Context, key string) error

Delete deletes a value in memcache.

func (*Cache) Get Uses

func (rc *Cache) Get(ctx context.Context, key string) (interface{}, error)

Get get value from memcache.

func (*Cache) GetMulti Uses

func (rc *Cache) GetMulti(ctx context.Context, keys []string) ([]interface{}, error)

GetMulti gets a value from a key in memcache.

func (*Cache) Incr Uses

func (rc *Cache) Incr(ctx context.Context, key string) error

Incr increases counter.

func (*Cache) IsExist Uses

func (rc *Cache) IsExist(ctx context.Context, key string) (bool, error)

IsExist checks if a value exists in memcache.

func (*Cache) Put Uses

func (rc *Cache) Put(ctx context.Context, key string, val interface{}, timeout time.Duration) error

Put puts a value into memcache.

func (*Cache) StartAndGC Uses

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

StartAndGC starts the memcache adapter. config: must be in the format {"conn":"connection info"}. If an error occurs during connecting, an error is returned

Package memcache imports 8 packages (graph) and is imported by 1 packages. Updated 2020-12-01. Refresh now. Tools for package owners.