memcache

package
v2.0.0-alpha2+incompat... Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2015 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package memcache is a client for memcached.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

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

Connection is the connection to a memcache.

func Connect

func Connect(address string, timeout time.Duration) (conn *Connection, err error)

Connect connects a memcache process.

func (*Connection) Add

func (mc *Connection) Add(key string, flags uint16, timeout uint64, value []byte) (stored bool, err error)

Add store the value only if it does not already exist.

func (*Connection) Append

func (mc *Connection) Append(key string, flags uint16, timeout uint64, value []byte) (stored bool, err error)

Append appends the value after the last bytes in an existing item.

func (*Connection) Cas

func (mc *Connection) Cas(key string, flags uint16, timeout uint64, value []byte, cas uint64) (stored bool, err error)

Cas stores the value only if no one else has updated the data since you read it last.

func (*Connection) Close

func (mc *Connection) Close()

Close closes the memcache connection.

func (*Connection) Delete

func (mc *Connection) Delete(key string) (deleted bool, err error)

Delete delete the value for the specified cache key.

func (*Connection) FlushAll

func (mc *Connection) FlushAll() (err error)

FlushAll purges the entire cache.

func (*Connection) Get

func (mc *Connection) Get(keys ...string) (results []cacheservice.Result, err error)

Get returns cached data for given keys.

func (*Connection) Gets

func (mc *Connection) Gets(keys ...string) (results []cacheservice.Result, err error)

Gets returns cached data for given keys, it is an alternative Get api for using with CAS. Gets returns a CAS identifier with the item. If the item's CAS value has changed since you Gets'ed it, it will not be stored.

func (*Connection) Prepend

func (mc *Connection) Prepend(key string, flags uint16, timeout uint64, value []byte) (stored bool, err error)

Prepend prepends the value before existing value.

func (*Connection) Replace

func (mc *Connection) Replace(key string, flags uint16, timeout uint64, value []byte) (stored bool, err error)

Replace replaces the value, only if the value already exists, for the specified cache key.

func (*Connection) Set

func (mc *Connection) Set(key string, flags uint16, timeout uint64, value []byte) (stored bool, err error)

Set set the value with specified cache key.

func (*Connection) Stats

func (mc *Connection) Stats(argument string) (result []byte, err error)

Stats returns a list of basic stats.

type Error

type Error struct {
	Message string
}

Error is the error from CacheService.

func NewError

func NewError(format string, args ...interface{}) Error

NewError creates a new Error.

func (Error) Error

func (merr Error) Error() string

Jump to

Keyboard shortcuts

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