memcache

package
Version: v3.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

Engine is the default Redis storage engine

func NewMemcacheStore

func NewMemcacheStore(prefix string, client cl, cleanupTimeout time.Duration) *Engine

NewMemcacheStore creates a new standard Memcached-backed store

func (*Engine) Exists

func (e *Engine) Exists(key string) bool

Exists checks to see if a key exists in the store

func (*Engine) Expire

func (e *Engine) Expire(key string) error

Expire marks the key as expired, as well as locks and expire keys, and removes it from the storage engine

func (*Engine) Get

func (e *Engine) Get(key string) (data []byte, err error)

Get retrieves data from the store based on key, if it exists, else it returns an error

func (*Engine) IsExpired

func (e *Engine) IsExpired(key string) bool

IsExpired checks to see if the key has expired

func (*Engine) IsLocked

func (e *Engine) IsLocked(key string) bool

IsLocked checks to see if the key has been locked

func (*Engine) Lock

func (e *Engine) Lock(key string) error

Lock sets a lock against the given key

func (*Engine) Put

func (e *Engine) Put(key string, data []byte, expires time.Time) error

Put stores data against a key, else it returns an error

func (*Engine) Unlock

func (e *Engine) Unlock(key string) error

Unlock removes the lock from a given key, if it doesn't exist it returns an error

Source Files

Jump to

Keyboard shortcuts

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