Versions in this module Expand all Collapse all v0 v0.1.2 Aug 16, 2026 Changes in this version + type MetaArithmeticOptions struct + CompareCAS *uint64 + Decrement bool + Delta uint64 + Initial *uint64 + InitialTTL *Expiration + MetadataOnly bool + Opaque string + ReturnCAS bool + ReturnKey bool + ReturnTTL bool + SetCAS *uint64 + Touch *Expiration + type MetaDeleteOptions struct + CompareCAS *uint64 + DropValue bool + Invalidate bool + Opaque string + ReturnKey bool + SetCAS *uint64 + StaleFor *Expiration + type MetaGetOptions struct + MetadataOnly bool + NoLRUBump bool + Opaque string + RefreshBefore *Expiration + ReturnCAS bool + ReturnClientFlags bool + ReturnHitBefore bool + ReturnKey bool + ReturnLastAccess bool + ReturnSize bool + ReturnTTL bool + SetCAS *uint64 + Touch *Expiration + UnlessCAS *uint64 + VivifyTTL *Expiration + type MetaSetOptions struct + ClientFlags uint32 + CompareCAS *uint64 + Invalidate bool + Mode StoreMode + Opaque string + ReturnCAS bool + ReturnKey bool + ReturnSize bool + SetCAS *uint64 + TTL Expiration + VivifyTTL *Expiration v0.1.1 Aug 16, 2026 v0.1.0 Aug 16, 2026 Changes in this version + const Forever + var ErrCacheMiss = errors.New("memcache: cache miss") + var ErrClosed = errors.New("memcache: client is closed") + var ErrConflict = errors.New("memcache: too many conflicting concurrent writes") + var ErrNotStored = errors.New("memcache: value not stored") + func RefreshAhead(d time.Duration) interface + type AmbiguousWriteError struct + Cause error + Key string + Operation string + func (e *AmbiguousWriteError) Error() string + func (e *AmbiguousWriteError) Unwrap() error + type AppendOption interface + type ArithmeticOperation struct + Key string + Options ArithmeticOptions + type ArithmeticOptions struct + CompareCAS *uint64 + Decrement bool + Delta uint64 + Initial *uint64 + InitialTTL *Expiration + MetadataOnly bool + Opaque string + ReturnCAS bool + ReturnKey bool + ReturnTTL bool + SetCAS *uint64 + Touch *Expiration + type ArithmeticResult struct + HasValue bool + Key string + Metadata Metadata + Opaque string + ReturnedKey []byte + Status MutationStatus + Value uint64 + type Client struct + func New(server string, options ...Option) (*Client, error) + func NewServers(servers []string, options ...Option) (*Client, error) + func (c *Client) Add(ctx context.Context, key string, value []byte, ttl time.Duration, ...) (bool, error) + func (c *Client) Append(ctx context.Context, key string, fragment []byte, ttl time.Duration, ...) error + func (c *Client) Close() error + func (c *Client) Decr(ctx context.Context, key string, delta uint64, ttl time.Duration, ...) (uint64, error) + func (c *Client) Delete(ctx context.Context, key string) error + func (c *Client) DeleteMany(ctx context.Context, keys []string) error + func (c *Client) Fetch(ctx context.Context, key string, ttl time.Duration, ...) ([]byte, error) + func (c *Client) Get(ctx context.Context, key string, options ...GetOption) ([]byte, bool, error) + func (c *Client) GetMany(ctx context.Context, keys []string, options ...GetOption) (map[string][]byte, error) + func (c *Client) Incr(ctx context.Context, key string, delta uint64, ttl time.Duration, ...) (uint64, error) + func (c *Client) Inspect(ctx context.Context, key string) (ItemInfo, bool, error) + func (c *Client) Invalidate(ctx context.Context, key string, grace time.Duration) error + func (c *Client) Meta() *MetaClient + func (c *Client) Prepend(ctx context.Context, key string, fragment []byte, ttl time.Duration, ...) error + func (c *Client) Replace(ctx context.Context, key string, value []byte, ttl time.Duration, ...) (bool, error) + func (c *Client) Set(ctx context.Context, key string, value []byte, ttl time.Duration, ...) error + func (c *Client) SetMany(ctx context.Context, mapping map[string][]byte, ttl time.Duration, ...) error + func (c *Client) Take(ctx context.Context, key string) ([]byte, error) + func (c *Client) Touch(ctx context.Context, key string, ttl time.Duration) error + func (c *Client) Update(ctx context.Context, key string, ttl time.Duration, ...) ([]byte, error) + type CounterOption interface + type DeleteOperation struct + Key string + Options DeleteOptions + type DeleteOptions struct + CompareCAS *uint64 + DropValue bool + Invalidate bool + Opaque string + ReturnKey bool + SetCAS *uint64 + StaleFor *Expiration + type DialContextFunc func(context.Context, string, string) (net.Conn, error) + type Expiration int64 + const NoExpiration + func ExpiresAt(t time.Time) Expiration + func ExpiresIn(d time.Duration) Expiration + type FetchOption interface + type GetOperation struct + Key string + Options GetOptions + type GetOption interface + func Touch(ttl time.Duration) GetOption + type GetOptions struct + MetadataOnly bool + NoLRUBump bool + Opaque string + RefreshBefore *Expiration + ReturnCAS bool + ReturnClientFlags bool + ReturnHitBefore bool + ReturnKey bool + ReturnLastAccess bool + ReturnSize bool + ReturnTTL bool + SetCAS *uint64 + Touch *Expiration + UnlessCAS *uint64 + VivifyTTL *Expiration + type GetResult struct + Key string + Lease LeaseState + Metadata Metadata + Opaque string + ReturnedKey []byte + Status GetStatus + Value []byte + ValueState ValueState + func (r GetResult) Hit() bool + type GetStatus uint8 + const GetHit + const GetMiss + const GetPending + const GetUnchanged + const GetUnknown + type ItemInfo struct + HitBefore bool + LastAccess time.Duration + Size int + TTL time.Duration + type LeaseState uint8 + const LeaseBusy + const LeaseGranted + const LeaseNone + type MetaClient struct + func (m *MetaClient) Arithmetic(ctx context.Context, key string, options ArithmeticOptions) (ArithmeticResult, error) + func (m *MetaClient) Batch(ctx context.Context, operations []Operation) ([]OperationResult, error) + func (m *MetaClient) Debug(ctx context.Context, key string) (map[string]string, error) + func (m *MetaClient) Delete(ctx context.Context, key string, options DeleteOptions) (MutationResult, error) + func (m *MetaClient) Execute(ctx context.Context, command MetaCommand) (RawResponse, error) + func (m *MetaClient) Get(ctx context.Context, key string, options GetOptions) (GetResult, error) + func (m *MetaClient) Noop(ctx context.Context) error + func (m *MetaClient) Set(ctx context.Context, key string, value []byte, options SetOptions) (MutationResult, error) + type MetaCommand struct + Command string + Flags []string + HasValue bool + Key string + Value []byte + type Metadata struct + CAS *uint64 + ClientFlags *uint32 + HitBefore *bool + LastAccess *uint64 + Size *uint64 + TTL *int64 + type MutationResult struct + CAS *uint64 + Key string + Opaque string + ReturnedKey []byte + Size *uint64 + Status MutationStatus + func (r MutationResult) Applied() bool + type MutationStatus uint8 + const MutationAlreadyExists + const MutationApplied + const MutationCASMismatch + const MutationNotFound + const MutationUnknown + type Operation interface + type OperationResult struct + Ambiguous bool + Arithmetic *ArithmeticResult + Err error + Get *GetResult + Mutation *MutationResult + type Option interface + func WithDialTimeout(timeout time.Duration) Option + func WithDialer(dial DialContextFunc) Option + func WithIdleTimeout(timeout time.Duration) Option + func WithMaxIdleConns(max int) Option + func WithMaxItemSize(max int) Option + func WithNetwork(network string) Option + func WithRouter(router Router) Option + func WithServers(servers ...string) Option + func WithTimeout(timeout time.Duration) Option + type PolicyOption interface + func Degrade(on bool) PolicyOption + func OnError(hook func(error)) PolicyOption + type ProtocolError struct + Message string + func (e *ProtocolError) Error() string + type RawResponse struct + Busy bool + Code ResponseCode + Debug map[string]string + Flags []string + Key []byte + Metadata Metadata + Opaque string + Stale bool + Value []byte + Won bool + type RendezvousRouter struct + func (RendezvousRouter) Pick(key string, servers []string) int + type ResponseCode string + const ResponseDebug + const ResponseExists + const ResponseHeader + const ResponseMiss + const ResponseNoop + const ResponseNotFound + const ResponseNotStored + const ResponseValue + type Router interface + Pick func(key string, servers []string) int + type ServerError struct + Kind string + Message string + func (e *ServerError) Error() string + type SetOperation struct + Key string + Options SetOptions + Value []byte + type SetOption interface + type SetOptions struct + ClientFlags uint32 + CompareCAS *uint64 + Invalidate bool + Mode StoreMode + Opaque string + ReturnCAS bool + ReturnKey bool + ReturnSize bool + SetCAS *uint64 + TTL Expiration + VivifyTTL *Expiration + type StoreMode uint8 + const ModeAdd + const ModeAppend + const ModePrepend + const ModeReplace + const ModeSet + type UpdateOption interface + type ValueState uint8 + const ValueFresh + const ValueMissing + const ValueStale + const ValueUnknown