Documentation ¶
Overview ¶
Package memcache is a client for memcached.
Index ¶
- type Connection
- func (mc *Connection) Add(key string, flags uint16, timeout uint64, value []byte) (stored bool, err error)
- func (mc *Connection) Append(key string, flags uint16, timeout uint64, value []byte) (stored bool, err error)
- func (mc *Connection) Cas(key string, flags uint16, timeout uint64, value []byte, cas uint64) (stored bool, err error)
- func (mc *Connection) Close()
- func (mc *Connection) Delete(key string) (deleted bool, err error)
- func (mc *Connection) FlushAll() (err error)
- func (mc *Connection) Get(keys ...string) (results []cacheservice.Result, err error)
- func (mc *Connection) Gets(keys ...string) (results []cacheservice.Result, err error)
- func (mc *Connection) Prepend(key string, flags uint16, timeout uint64, value []byte) (stored bool, err error)
- func (mc *Connection) Replace(key string, flags uint16, timeout uint64, value []byte) (stored bool, err error)
- func (mc *Connection) Set(key string, flags uint16, timeout uint64, value []byte) (stored bool, err error)
- func (mc *Connection) Stats(argument string) (result []byte, err error)
- type Error
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) 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.