Versions in this module Expand all Collapse all v1 v1.0.1 Apr 8, 2021 Changes in this version + const ActiveServer + const DownServer + const WarmUpServer + const WriteOnlyServer + func NewStatusCodeError(status ResponseStatus) error + type BaseShardManager struct + func (m *BaseShardManager) GetAllShards() map[int]net2.ManagedConn + func (m *BaseShardManager) GetShard(key string) (shardId int, conn net2.ManagedConn, err error) + func (m *BaseShardManager) GetShardsForItems(items []*Item) map[int]*ShardMapping + func (m *BaseShardManager) GetShardsForKeys(keys []string) map[int]*ShardMapping + func (m *BaseShardManager) GetShardsForSentinelsFromItems(items []*Item) map[int]*ShardMapping + func (m *BaseShardManager) GetShardsForSentinelsFromKeys(keys []string) map[int]*ShardMapping + func (m *BaseShardManager) Init(shardFunc func(key string, numShard int) (shard int), logError func(err error), ...) + func (m *BaseShardManager) InitWithPool(shardFunc func(key string, numShard int) (shard int), logError func(err error), ...) + func (m *BaseShardManager) UpdateShardStates(shardStates []ShardState) + type Client interface + Add func(item *Item) MutateResponse + AddMulti func(item []*Item) []MutateResponse + Append func(key string, value []byte) MutateResponse + CasMulti func(items []*Item) []MutateResponse + CasSentinels func(items []*Item) []MutateResponse + Decrement func(key string, delta uint64, initValue uint64, expiration uint32) CountResponse + Delete func(key string) MutateResponse + DeleteMulti func(keys []string) []MutateResponse + Flush func(expiration uint32) Response + Get func(key string) GetResponse + GetMulti func(keys []string) map[string]GetResponse + GetSentinels func(keys []string) map[string]GetResponse + Increment func(key string, delta uint64, initValue uint64, expiration uint32) CountResponse + Prepend func(key string, value []byte) MutateResponse + Replace func(item *Item) MutateResponse + Set func(item *Item) MutateResponse + SetMulti func(items []*Item) []MutateResponse + SetSentinels func(items []*Item) []MutateResponse + Stat func(statsKey string) StatResponse + Verbosity func(verbosity uint32) Response + Version func() VersionResponse + func NewMockClient() Client + func NewMockClientErrorAllSets() Client + func NewMockClientFailEverything() Client + func NewMockClientMissAllGets() Client + func NewShardedClient(manager ShardManager, builder ClientShardBuilder) Client + type ClientShard interface + IsValidState func() bool + ShardId func() int + func NewLargeRawBinaryClient(shard int, channel io.ReadWriter) ClientShard + func NewRawAsciiClient(shard int, channel io.ReadWriter) ClientShard + func NewRawBinaryClient(shard int, channel io.ReadWriter) ClientShard + type ClientShardBuilder func(shard int, channel io.ReadWriter) ClientShard + type CountResponse interface + Count func() uint64 + Key func() string + func NewCountErrorResponse(key string, err error) CountResponse + func NewCountResponse(key string, status ResponseStatus, count uint64) CountResponse + type GetResponse interface + DataVersionId func() uint64 + Flags func() uint32 + Key func() string + Value func() []byte + func NewGetErrorResponse(key string, err error) GetResponse + func NewGetResponse(key string, status ResponseStatus, flags uint32, value []byte, version uint64) GetResponse + type Item struct + DataVersionId uint64 + Expiration uint32 + Flags uint32 + Key string + Value []byte + type MemcachedState int + type MockClient struct + func (c *MockClient) Add(item *Item) MutateResponse + func (c *MockClient) AddMulti(items []*Item) []MutateResponse + func (c *MockClient) Append(key string, value []byte) MutateResponse + func (c *MockClient) CasMulti(items []*Item) []MutateResponse + func (c *MockClient) CasSentinels(items []*Item) []MutateResponse + func (c *MockClient) Decrement(key string, delta uint64, initValue uint64, expiration uint32) CountResponse + func (c *MockClient) Delete(key string) MutateResponse + func (c *MockClient) DeleteMulti(keys []string) []MutateResponse + func (c *MockClient) Flush(expiration uint32) Response + func (c *MockClient) Get(key string) GetResponse + func (c *MockClient) GetMulti(keys []string) map[string]GetResponse + func (c *MockClient) GetSentinels(keys []string) map[string]GetResponse + func (c *MockClient) Increment(key string, delta uint64, initValue uint64, expiration uint32) CountResponse + func (c *MockClient) Prepend(key string, value []byte) MutateResponse + func (c *MockClient) Replace(item *Item) MutateResponse + func (c *MockClient) Set(item *Item) MutateResponse + func (c *MockClient) SetMulti(items []*Item) []MutateResponse + func (c *MockClient) SetSentinels(items []*Item) []MutateResponse + func (c *MockClient) Stat(statsKey string) StatResponse + func (c *MockClient) Verbosity(verbosity uint32) Response + func (c *MockClient) Version() VersionResponse + type MutateResponse interface + DataVersionId func() uint64 + Key func() string + func NewMutateErrorResponse(key string, err error) MutateResponse + func NewMutateResponse(key string, status ResponseStatus, version uint64) MutateResponse + type Operation int + const Decrement + const Increment + type RawAsciiClient struct + func (c *RawAsciiClient) Add(item *Item) MutateResponse + func (c *RawAsciiClient) AddMulti(items []*Item) []MutateResponse + func (c *RawAsciiClient) Append(key string, value []byte) MutateResponse + func (c *RawAsciiClient) CasMulti(items []*Item) []MutateResponse + func (c *RawAsciiClient) CasSentinels(items []*Item) []MutateResponse + func (c *RawAsciiClient) Decrement(key string, delta uint64, initValue uint64, expiration uint32) CountResponse + func (c *RawAsciiClient) Delete(key string) MutateResponse + func (c *RawAsciiClient) DeleteMulti(keys []string) []MutateResponse + func (c *RawAsciiClient) Flush(expiration uint32) Response + func (c *RawAsciiClient) Get(key string) GetResponse + func (c *RawAsciiClient) GetMulti(keys []string) map[string]GetResponse + func (c *RawAsciiClient) GetSentinels(keys []string) map[string]GetResponse + func (c *RawAsciiClient) Increment(key string, delta uint64, initValue uint64, expiration uint32) CountResponse + func (c *RawAsciiClient) IsValidState() bool + func (c *RawAsciiClient) Prepend(key string, value []byte) MutateResponse + func (c *RawAsciiClient) Replace(item *Item) MutateResponse + func (c *RawAsciiClient) Set(item *Item) MutateResponse + func (c *RawAsciiClient) SetMulti(items []*Item) []MutateResponse + func (c *RawAsciiClient) SetSentinels(items []*Item) []MutateResponse + func (c *RawAsciiClient) ShardId() int + func (c *RawAsciiClient) Stat(statsKey string) StatResponse + func (c *RawAsciiClient) Verbosity(verbosity uint32) Response + func (c *RawAsciiClient) Version() VersionResponse + type RawBinaryClient struct + func (c *RawBinaryClient) Add(item *Item) MutateResponse + func (c *RawBinaryClient) AddMulti(items []*Item) []MutateResponse + func (c *RawBinaryClient) Append(key string, value []byte) MutateResponse + func (c *RawBinaryClient) CasMulti(items []*Item) []MutateResponse + func (c *RawBinaryClient) CasSentinels(items []*Item) []MutateResponse + func (c *RawBinaryClient) Decrement(key string, delta uint64, initValue uint64, expiration uint32) CountResponse + func (c *RawBinaryClient) Delete(key string) MutateResponse + func (c *RawBinaryClient) DeleteMulti(keys []string) []MutateResponse + func (c *RawBinaryClient) Flush(expiration uint32) Response + func (c *RawBinaryClient) Get(key string) GetResponse + func (c *RawBinaryClient) GetMulti(keys []string) map[string]GetResponse + func (c *RawBinaryClient) GetSentinels(keys []string) map[string]GetResponse + func (c *RawBinaryClient) Increment(key string, delta uint64, initValue uint64, expiration uint32) CountResponse + func (c *RawBinaryClient) IsValidState() bool + func (c *RawBinaryClient) Prepend(key string, value []byte) MutateResponse + func (c *RawBinaryClient) Replace(item *Item) MutateResponse + func (c *RawBinaryClient) Set(item *Item) MutateResponse + func (c *RawBinaryClient) SetMulti(items []*Item) []MutateResponse + func (c *RawBinaryClient) SetSentinels(items []*Item) []MutateResponse + func (c *RawBinaryClient) ShardId() int + func (c *RawBinaryClient) Stat(statsKey string) StatResponse + func (c *RawBinaryClient) Verbosity(verbosity uint32) Response + func (c *RawBinaryClient) Version() VersionResponse + type Response interface + Error func() error + Status func() ResponseStatus + func NewErrorResponse(err error) Response + func NewResponse(status ResponseStatus) Response + type ResponseStatus uint16 + const StatusAuthenticationContinue + const StatusAuthenticationError + const StatusBusy + const StatusIncrDecrOnNonNumericValue + const StatusInternalError + const StatusInvalidArguments + const StatusItemNotStored + const StatusKeyExists + const StatusKeyNotFound + const StatusNoError + const StatusNotSupported + const StatusOutOfMemory + const StatusTempFailure + const StatusUnknownCommand + const StatusValueTooLarge + const StatusVbucketBelongsToAnotherServer + type ShardManager interface + GetAllShards func() map[int]net2.ManagedConn + GetShard func(key string) (shardId int, conn net2.ManagedConn, err error) + GetShardsForItems func(items []*Item) map[int]*ShardMapping + GetShardsForKeys func(keys []string) map[int]*ShardMapping + GetShardsForSentinelsFromItems func(items []*Item) map[int]*ShardMapping + GetShardsForSentinelsFromKeys func(keys []string) map[int]*ShardMapping + func NewStaticShardManager(serverAddrs []string, shardFunc func(key string, numShard int) (shard int), ...) ShardManager + type ShardMapping struct + ConnErr error + Connection net2.ManagedConn + Items []*Item + Keys []string + WarmingUp bool + type ShardState struct + Address string + State MemcachedState + type ShardedClient struct + func (c *ShardedClient) Add(item *Item) MutateResponse + func (c *ShardedClient) AddMulti(items []*Item) []MutateResponse + func (c *ShardedClient) Append(key string, value []byte) MutateResponse + func (c *ShardedClient) CasMulti(items []*Item) []MutateResponse + func (c *ShardedClient) CasSentinels(items []*Item) []MutateResponse + func (c *ShardedClient) Decrement(key string, delta uint64, initValue uint64, expiration uint32) CountResponse + func (c *ShardedClient) Delete(key string) MutateResponse + func (c *ShardedClient) DeleteMulti(keys []string) []MutateResponse + func (c *ShardedClient) Flush(expiration uint32) Response + func (c *ShardedClient) Get(key string) GetResponse + func (c *ShardedClient) GetMulti(keys []string) map[string]GetResponse + func (c *ShardedClient) GetSentinels(keys []string) map[string]GetResponse + func (c *ShardedClient) Increment(key string, delta uint64, initValue uint64, expiration uint32) CountResponse + func (c *ShardedClient) Prepend(key string, value []byte) MutateResponse + func (c *ShardedClient) Replace(item *Item) MutateResponse + func (c *ShardedClient) Set(item *Item) MutateResponse + func (c *ShardedClient) SetMulti(items []*Item) []MutateResponse + func (c *ShardedClient) SetSentinels(items []*Item) []MutateResponse + func (c *ShardedClient) Stat(statsKey string) StatResponse + func (c *ShardedClient) Verbosity(verbosity uint32) Response + func (c *ShardedClient) Version() VersionResponse + type StatResponse interface + Entries func() map[int](map[string]string) + func NewStatErrorResponse(err error, entries map[int](map[string]string)) StatResponse + func NewStatResponse(status ResponseStatus, entries map[int](map[string]string)) StatResponse + type StaticShardManager struct + type VersionResponse interface + Versions func() map[int]string + func NewVersionErrorResponse(err error, versions map[int]string) VersionResponse + func NewVersionResponse(status ResponseStatus, versions map[int]string) VersionResponse