aememcache

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package aememcache provides App Engine memcache cache that implements cache.Cacher interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache is an implementation of cache.Cacher by App Engine memcache.

func NewCache

func NewCache(expiration time.Duration) *Cache

NewCache returns a new Cache with given expiration. If set to 0, each item has no expiration time.

func (*Cache) DeleteMulti

func (c *Cache) DeleteMulti(ctx context.Context, keys []*datastorepb.Key) error

DeleteMulti deletes items for the given keys. It returns an error if the target exists and could not be deleted.

func (*Cache) GetMulti

func (c *Cache) GetMulti(ctx context.Context, keys []*datastorepb.Key) [][]byte

GetMulti returns the values of the given keys as a slice of []byte. If the item is not found, the corresponding index of the return value will be nil.

func (*Cache) SetMulti

func (c *Cache) SetMulti(ctx context.Context, keys []*datastorepb.Key, values [][]byte)

SetMulti sets the given keys and values to items.

Jump to

Keyboard shortcuts

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