Documentation
¶
Overview ¶
Package memcache provides a memcache client
Index ¶
- Variables
- type Client
- func (c *Client) Add(item *Item) error
- func (c *Client) CompareAndSwap(item *Item) error
- func (c *Client) Decrement(key string, delta uint64, initialValue uint64, expiration int) (uint64, error)
- func (c *Client) Delete(key string) error
- func (c *Client) Flush(expiration int) error
- func (c *Client) Get(key string) (*Item, error)
- func (c *Client) GetMulti(keys []string) (map[string]*Item, error)
- func (c *Client) Increment(key string, delta uint64, initialValue uint64, expiration int) (uint64, error)
- func (c *Client) Replace(item *Item) error
- func (c *Client) Set(item *Item) error
- type Item
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrCacheMiss means that a Get failed because the item wasn't present. ErrCacheMiss = errors.New("memcache: cache miss") // ErrCASConflict means that a CompareAndSwap call failed due to the // cached value being modified between the Get and the CompareAndSwap. // If the cached value was simply evicted rather than replaced, // ErrNotStored will be returned instead. ErrCASConflict = errors.New("memcache: compare-and-swap conflict") // ErrNotStored means that a conditional write operation (i.e. Add or // CompareAndSwap) failed because the condition was not satisfied. ErrNotStored = errors.New("memcache: item not stored") // ErrServer means that a server error occurred. ErrServerError = errors.New("memcache: server error") // ErrNoStats means that no statistics were available. ErrNoStats = errors.New("memcache: no statistics available") // ErrMalformedKey is returned when an invalid key is used. // Keys must be at maximum 250 bytes long and not // contain whitespace or control characters. ErrMalformedKey = errors.New("malformed: key is too long or contains invalid characters") // ErrNoServers is returned when no servers are configured or available. ErrNoServers = errors.New("memcache: no servers configured or available") // ErrMagicByte is returned when magic byte of the packet is invalid. ErrMagicByte = errors.New("memcache: invalid magic byte") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CompareAndSwap ¶
type Item ¶
type Item struct {
// Key is the Item's key (250 bytes maximum).
Key string
// Value is the Item's value.
Value []byte
// Flags are server-opaque flags whose semantics are entirely
// up to the app.
Flags uint32
// Expiration is the cache expiration time, in seconds: either a relative
// time from now (up to 1 month), or an absolute Unix epoch time.
// Zero means the Item has no expiration time.
Expiration int32
// contains filtered or unexported fields
}
Item is an item to be got or stored in a memcached server.
Click to show internal directories.
Click to hide internal directories.