memcache

package
v0.0.0-...-2e7882b Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package memecache implements a cache driver for Google App Engine Go mememcache

Index

Constants

This section is empty.

Variables

View Source
var (
	Codec = codec.Gob
)

Codec is the App Engine Memcache codec to use. By default it's Gob, but if you want to use JSON, just set it first before accessing the cache.

Functions

This section is empty.

Types

type Cache

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

Cache is

func New

func New(ctx context.Context) *Cache

New returns a new empty client initialized with the given context

func (*Cache) Context

func (c *Cache) Context() context.Context

Context returns the context associated with the client. If the context is nil, it will return a background context which will trigger an App Engine error but will prevent a panic.

func (*Cache) Del

func (c *Cache) Del(key string) (err error)

Del implements the "cache.Cache".Del() interface

func (*Cache) Exists

func (c *Cache) Exists(key string) bool

Exists implements the "cache.Cache".Exists() interface

func (*Cache) Get

func (c *Cache) Get(key string, dstVal interface{}) (err error)

Get implements the "cache.Cache".Get() interface

func (*Cache) Set

func (c *Cache) Set(key string, value interface{}, expiration time.Duration) (err error)

Set implements the "cache.Cache".Set() interface

func (*Cache) WithContext

func (c *Cache) WithContext(ctx context.Context) *Cache

WithContext sets the internal context for future actions using the given context

Jump to

Keyboard shortcuts

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