Documentation ¶
Index ¶
- Variables
- type BaseTCPClient
- type Client
- func (c *Client) Add(key string, value []byte, ttl int) (MutationResult, error)
- func (c *Client) Delete(key string) (MutationResult, error)
- func (c *Client) Get(key string) ([]byte, error)
- func (c *Client) GetMany(keys []string) (map[string][]byte, error)
- func (c *Client) Info(key string) (EntryInfo, error)
- func (c *Client) Replace(key string, value []byte, ttl int) (MutationResult, error)
- func (c *Client) Set(key string, value []byte, ttl int) (MutationResult, error)
- func (c *Client) Shutdown()
- func (c *Client) Touch(key string, ttl int) (MutationResult, error)
- type ConnectionTarget
- type DirectRouter
- type EntryInfo
- type InnerMetaClient
- func (c *InnerMetaClient) Add(key string, value []byte, ttl int) (MutationResult, error)
- func (c *InnerMetaClient) Delete(key string) (MutationResult, error)
- func (c *InnerMetaClient) Get(key string) ([]byte, error)
- func (c *InnerMetaClient) GetMany(keys []string) (map[string][]byte, error)
- func (c *InnerMetaClient) Info(key string) (EntryInfo, error)
- func (c *InnerMetaClient) Replace(key string, value []byte, ttl int) (MutationResult, error)
- func (c *InnerMetaClient) Set(key string, value []byte, ttl int) (MutationResult, error)
- func (c *InnerMetaClient) Shutdown()
- func (c *InnerMetaClient) Touch(key string, ttl int) (MutationResult, error)
- type MemcacheClient
- type MutationResult
- type Request
- type Response
- type Router
- type ShardedRouter
Constants ¶
This section is empty.
Variables ¶
var ErrConnectionOverloaded = errors.New("connection overloaded")
var ErrRequestTimeout = errors.New("request timeout")
Functions ¶
This section is empty.
Types ¶
type BaseTCPClient ¶
type BaseTCPClient struct { ConnectionTarget // contains filtered or unexported fields }
func NewBaseTCPClient ¶
func NewBaseTCPClient(c ConnectionTarget) (*BaseTCPClient, error)
func (*BaseTCPClient) Dispatch ¶
func (tc *BaseTCPClient) Dispatch(r []byte) <-chan Response
func (*BaseTCPClient) Shutdown ¶
func (tc *BaseTCPClient) Shutdown()
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A Client is an instance of the metapipe client You should be using only this
func DefaultClient ¶ added in v0.1.0
Creates a default Client, server strings in the format host:ip
func ShardedClient ¶ added in v0.0.2
func ShardedClient(targets ...ConnectionTarget) (Client, error)
Creates a Client that connects to many memcached servers
func SingleTargetClient ¶
func SingleTargetClient(target ConnectionTarget) (Client, error)
Creates a Client that connects to a single memcached server
func (*Client) Delete ¶
func (c *Client) Delete(key string) (MutationResult, error)
Deletes an entry
func (*Client) GetMany ¶
Gets many entries This method ignores errors, and turn them into the equivalent of cache misses
type ConnectionTarget ¶
ConnectionTarget is the information used to locate and connect to a memcached server
type DirectRouter ¶
type DirectRouter struct {
// contains filtered or unexported fields
}
func (*DirectRouter) Route ¶
func (r *DirectRouter) Route(key string) MemcacheClient
func (*DirectRouter) Shutdown ¶
func (r *DirectRouter) Shutdown()
type EntryInfo ¶
type EntryInfo struct { TimeToLive int LastAccess int CasId int Fetched bool SlabClassId int Size int }
EntryInfo contains information about a cache entry
type InnerMetaClient ¶
type InnerMetaClient struct {
// contains filtered or unexported fields
}
InnerMetaClient implements the memcached meta protocol
func NewInnerMetaClient ¶
func NewInnerMetaClient(target ConnectionTarget) (*InnerMetaClient, error)
func (*InnerMetaClient) Add ¶
func (c *InnerMetaClient) Add(key string, value []byte, ttl int) (MutationResult, error)
func (*InnerMetaClient) Delete ¶
func (c *InnerMetaClient) Delete(key string) (MutationResult, error)
func (*InnerMetaClient) GetMany ¶
func (c *InnerMetaClient) GetMany(keys []string) (map[string][]byte, error)
func (*InnerMetaClient) Replace ¶
func (c *InnerMetaClient) Replace(key string, value []byte, ttl int) (MutationResult, error)
func (*InnerMetaClient) Set ¶
func (c *InnerMetaClient) Set(key string, value []byte, ttl int) (MutationResult, error)
func (*InnerMetaClient) Shutdown ¶
func (c *InnerMetaClient) Shutdown()
func (*InnerMetaClient) Touch ¶
func (c *InnerMetaClient) Touch(key string, ttl int) (MutationResult, error)
type MemcacheClient ¶
type MemcacheClient interface { Add(key string, value []byte, ttl int) (MutationResult, error) Delete(key string) (MutationResult, error) Get(key string) ([]byte, error) GetMany(keys []string) (map[string][]byte, error) Info(key string) (EntryInfo, error) Replace(key string, value []byte, ttl int) (MutationResult, error) Set(key string, value []byte, ttl int) (MutationResult, error) Touch(key string, ttl int) (MutationResult, error) Shutdown() }
A MemcacheClient is a client implementation that supports memcached operations
type MutationResult ¶
type MutationResult int
MutationResult contains information about the outcome of a mutation operation (anything but get or info)
const ( Success MutationResult = iota Error Exists NotFound NotStored )
type Router ¶
type Router interface { Route(key string) MemcacheClient Shutdown() }
type ShardedRouter ¶ added in v0.0.2
type ShardedRouter struct {
// contains filtered or unexported fields
}
func (*ShardedRouter) Route ¶ added in v0.0.2
func (r *ShardedRouter) Route(key string) MemcacheClient
func (*ShardedRouter) Shutdown ¶ added in v0.0.2
func (r *ShardedRouter) Shutdown()