memcached

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package memcached implements memcached adapters of the cachebox.Storage interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoMemcache

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

GoMemcache implements the cachebox.Storage interface by wrapping the gomemcache client.

func NewGoMemcache

func NewGoMemcache(client GoMemcacheClient) *GoMemcache

NewGoMemcache returns a new GoMemcache instance.

func (*GoMemcache) Delete

func (g *GoMemcache) Delete(ctx context.Context, keys ...string) error

Delete performs a single or many delete calls.

func (*GoMemcache) MGet

func (g *GoMemcache) MGet(ctx context.Context, keys ...string) ([][]byte, error)

MGet performs a get or multi get call.

func (*GoMemcache) Set

func (g *GoMemcache) Set(ctx context.Context, items ...cachebox.Item) error

Set performs a single or many set calls.

type GoMemcacheClient

type GoMemcacheClient interface {
	Get(key string) (*memcache.Item, error)
	GetMulti(keys []string) (map[string]*memcache.Item, error)
	Set(item *memcache.Item) error
	Delete(key string) error
}

GoMemcacheClient is the interface that enables instrumentation by callers, wrapping a *memcache.Client on their side.

Jump to

Keyboard shortcuts

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