Versions in this module Expand all Collapse all v1 v1.4.0 Apr 19, 2026 Changes in this version + var ErrCASConflict = errors.New("celeris-memcached: CAS conflict") + var ErrCacheMiss = errors.New("celeris-memcached: cache miss") + var ErrClosed = errors.New("celeris-memcached: client closed") + var ErrInvalidCAS = errors.New("celeris-memcached: CAS token must be non-zero (did you call Gets first?)") + var ErrMalformedKey = errors.New("celeris-memcached: malformed key") + var ErrNoNodes = errors.New("celeris-memcached: cluster has no nodes") + var ErrNotStored = errors.New("celeris-memcached: item not stored") + var ErrPoolExhausted = errors.New("celeris-memcached: pool exhausted") + var ErrProtocol = errors.New("celeris-memcached: protocol error") + func WithWorker(ctx context.Context, workerID int) context.Context + type CASItem struct + CAS uint64 + Flags uint32 + Key string + Value []byte + type Client struct + func NewClient(addr string, opts ...Option) (*Client, error) + func (c *Client) Add(ctx context.Context, key string, value any, ttl time.Duration) error + func (c *Client) Append(ctx context.Context, key, value string) error + func (c *Client) CAS(ctx context.Context, key string, value any, casID uint64, ttl time.Duration) (bool, error) + func (c *Client) Close() error + func (c *Client) Decr(ctx context.Context, key string, delta uint64) (uint64, error) + func (c *Client) Delete(ctx context.Context, key string) error + func (c *Client) Flush(ctx context.Context) error + func (c *Client) FlushAfter(ctx context.Context, delay time.Duration) error + func (c *Client) Get(ctx context.Context, key string) (string, error) + func (c *Client) GetBytes(ctx context.Context, key string) ([]byte, error) + func (c *Client) GetMulti(ctx context.Context, keys ...string) (map[string]string, error) + func (c *Client) GetMultiBytes(ctx context.Context, keys ...string) (map[string][]byte, error) + func (c *Client) Gets(ctx context.Context, key string) (CASItem, error) + func (c *Client) IdleConnWorkers() []int + func (c *Client) Incr(ctx context.Context, key string, delta uint64) (uint64, error) + func (c *Client) Ping(ctx context.Context) error + func (c *Client) PoolStats() async.PoolStats + func (c *Client) Prepend(ctx context.Context, key, value string) error + func (c *Client) Protocol() Protocol + func (c *Client) Replace(ctx context.Context, key string, value any, ttl time.Duration) error + func (c *Client) Set(ctx context.Context, key string, value any, ttl time.Duration) error + func (c *Client) Stats(ctx context.Context) (map[string]string, error) + func (c *Client) Touch(ctx context.Context, key string, ttl time.Duration) error + func (c *Client) Version(ctx context.Context) (string, error) + type ClusterClient struct + func NewClusterClient(cfg ClusterConfig) (*ClusterClient, error) + func (c *ClusterClient) Add(ctx context.Context, key string, value any, ttl time.Duration) error + func (c *ClusterClient) Addrs() []string + func (c *ClusterClient) Append(ctx context.Context, key, value string) error + func (c *ClusterClient) CAS(ctx context.Context, key string, value any, casID uint64, ttl time.Duration) (bool, error) + func (c *ClusterClient) Close() error + func (c *ClusterClient) Decr(ctx context.Context, key string, delta uint64) (uint64, error) + func (c *ClusterClient) Delete(ctx context.Context, key string) error + func (c *ClusterClient) Flush(ctx context.Context) error + func (c *ClusterClient) FlushAfter(ctx context.Context, delay time.Duration) error + func (c *ClusterClient) Get(ctx context.Context, key string) (string, error) + func (c *ClusterClient) GetBytes(ctx context.Context, key string) ([]byte, error) + func (c *ClusterClient) GetMulti(ctx context.Context, keys ...string) (map[string]string, error) + func (c *ClusterClient) GetMultiBytes(ctx context.Context, keys ...string) (map[string][]byte, error) + func (c *ClusterClient) Gets(ctx context.Context, key string) (CASItem, error) + func (c *ClusterClient) Incr(ctx context.Context, key string, delta uint64) (uint64, error) + func (c *ClusterClient) NodeFor(key string) string + func (c *ClusterClient) Ping(ctx context.Context) error + func (c *ClusterClient) Prepend(ctx context.Context, key, value string) error + func (c *ClusterClient) Replace(ctx context.Context, key string, value any, ttl time.Duration) error + func (c *ClusterClient) Set(ctx context.Context, key string, value any, ttl time.Duration) error + func (c *ClusterClient) Stats(ctx context.Context) (map[string]map[string]string, error) + func (c *ClusterClient) Touch(ctx context.Context, key string, ttl time.Duration) error + func (c *ClusterClient) Version(ctx context.Context) (map[string]string, error) + type ClusterConfig struct + Addrs []string + DialTimeout time.Duration + Engine eventloop.ServerProvider + MaxOpen int + Protocol Protocol + Timeout time.Duration + Weights []uint32 + type Config struct + Addr string + DialTimeout time.Duration + Engine eventloop.ServerProvider + HealthCheckInterval time.Duration + MaxIdlePerWorker int + MaxIdleTime time.Duration + MaxLifetime time.Duration + MaxOpen int + Protocol Protocol + Timeout time.Duration + type MemcachedError struct + Kind string + Msg string + Status uint16 + func (e *MemcachedError) Error() string + type Option func(*Config) + func WithDialTimeout(d time.Duration) Option + func WithEngine(sp eventloop.ServerProvider) Option + func WithHealthCheckInterval(d time.Duration) Option + func WithMaxIdlePerWorker(n int) Option + func WithMaxIdleTime(d time.Duration) Option + func WithMaxLifetime(d time.Duration) Option + func WithMaxOpen(n int) Option + func WithProtocol(p Protocol) Option + func WithTimeout(d time.Duration) Option + type Protocol uint8 + const ProtocolBinary + const ProtocolText + func (p Protocol) String() string