Versions in this module Expand all Collapse all v0 v0.6.3 May 27, 2021 v0.6.2 Jan 28, 2021 Changes in this version + const FlagGOB + const FlagGzip + const FlagJSON + const FlagProtobuf + const FlagRAW + var ErrCASConflict = errors.New("memcache: compare-and-swap conflict") + var ErrConnClosed = errors.New("memcache: connection closed") + var ErrExists = errors.New("memcache: key exists") + var ErrItem = errors.New("memcache: item object nil") + var ErrItemObject = errors.New("memcache: item object protobuf type assertion failed") + var ErrMalformedKey = errors.New("memcache: malformed key is too long or contains invalid characters") + var ErrNotFound = errors.New("memcache: key not found") + var ErrNotStored = errors.New("memcache: key not stored") + var ErrPoolClosed = errors.New("memcache: connection pool closed") + var ErrPoolExhausted = errors.New("memcache: connection pool exhausted") + var ErrStat = errors.New("memcache unexpected errors") + var ErrValueSize = errors.New("memcache: item value size must not greater than 1mb") + type Config struct + Addr string + DialTimeout xtime.Duration + Name string + Proto string + ReadTimeout xtime.Duration + WriteTimeout xtime.Duration + type Conn interface + Add func(item *Item) error + AddContext func(ctx context.Context, item *Item) error + Close func() error + CompareAndSwap func(item *Item) error + CompareAndSwapContext func(ctx context.Context, item *Item) error + Decrement func(key string, delta uint64) (newValue uint64, err error) + DecrementContext func(ctx context.Context, key string, delta uint64) (newValue uint64, err error) + Delete func(key string) error + DeleteContext func(ctx context.Context, key string) error + Err func() error + Get func(key string) (*Item, error) + GetContext func(ctx context.Context, key string) (*Item, error) + GetMulti func(keys []string) (map[string]*Item, error) + GetMultiContext func(ctx context.Context, keys []string) (map[string]*Item, error) + Increment func(key string, delta uint64) (newValue uint64, err error) + IncrementContext func(ctx context.Context, key string, delta uint64) (newValue uint64, err error) + Replace func(item *Item) error + ReplaceContext func(ctx context.Context, item *Item) error + Scan func(item *Item, v interface{}) (err error) + Set func(item *Item) error + SetContext func(ctx context.Context, item *Item) error + Touch func(key string, seconds int32) (err error) + TouchContext func(ctx context.Context, key string, seconds int32) (err error) + func Dial(network, address string, options ...DialOption) (Conn, error) + func MockWith(err error) Conn + type DialOption struct + func DialConnectTimeout(d time.Duration) DialOption + func DialNetDial(dial func(network, addr string) (net.Conn, error)) DialOption + func DialReadTimeout(d time.Duration) DialOption + func DialWriteTimeout(d time.Duration) DialOption + type Item struct + Expiration int32 + Flags uint32 + Key string + Object interface{} + Value []byte + func JSONItem(key string, v interface{}, flags uint32, expiration int32) *Item + func ProtobufItem(key string, message proto.Message, flags uint32, expiration int32) *Item + func RawItem(key string, data []byte, flags uint32, expiration int32) *Item + type Memcache struct + func New(cfg *Config) *Memcache + func (mc *Memcache) Add(ctx context.Context, item *Item) (err error) + func (mc *Memcache) Close() error + func (mc *Memcache) CompareAndSwap(ctx context.Context, item *Item) (err error) + func (mc *Memcache) Conn(ctx context.Context) Conn + func (mc *Memcache) Decrement(ctx context.Context, key string, delta uint64) (newValue uint64, err error) + func (mc *Memcache) Delete(ctx context.Context, key string) (err error) + func (mc *Memcache) Get(ctx context.Context, key string) *Reply + func (mc *Memcache) GetMulti(ctx context.Context, keys []string) (*Replies, error) + func (mc *Memcache) Increment(ctx context.Context, key string, delta uint64) (newValue uint64, err error) + func (mc *Memcache) Replace(ctx context.Context, item *Item) (err error) + func (mc *Memcache) Set(ctx context.Context, item *Item) (err error) + func (mc *Memcache) Touch(ctx context.Context, key string, timeout int32) (err error) + type Pool struct + func NewPool(cfg *Config) (p *Pool) + func (p *Pool) Close() error + func (p *Pool) Get(ctx context.Context) Conn + type Replies struct + func (rs *Replies) Close() (err error) + func (rs *Replies) Item(key string) *Item + func (rs *Replies) Keys() (keys []string) + func (rs *Replies) Scan(key string, v interface{}) (err error) + type Reply struct + func (r *Reply) Item() *Item + func (r *Reply) Scan(v interface{}) (err error)