Documentation ¶
Index ¶
- func AbsInt(n int) int
- func AdaptType(s string) interface{}
- func CompareLex(s1 string, s2 string) int
- func CompareNestedStringArrays(got [][]string, want [][]string) bool
- func Decode(raw []byte) ([]string, error)
- func EncodeCommand(cmd []string) []byte
- func FilterExpiredKeys(now time.Time, state map[string]KeyData) map[string]KeyData
- func GetFreePort() (int, error)
- func GetIPAddress() (string, error)
- func GetSubCommand(command Command, cmd []string) (interface{}, error)
- func IsMaxMemoryExceeded(maxMemory uint64) bool
- func IsWriteCommand(command Command, subCommand SubCommand) bool
- func ParseBooleanArrayResponse(b []byte) ([]bool, error)
- func ParseBooleanResponse(b []byte) (bool, error)
- func ParseFloatResponse(b []byte) (float64, error)
- func ParseIntegerArrayResponse(b []byte) ([]int, error)
- func ParseIntegerResponse(b []byte) (int, error)
- func ParseMemory(memory string) (uint64, error)
- func ParseNestedStringArrayResponse(b []byte) ([][]string, error)
- func ParseNilResponse(b []byte) (bool, error)
- func ParseStringArrayResponse(b []byte) ([]string, error)
- func ParseStringResponse(b []byte) (string, error)
- func ReadMessage(r io.Reader) ([]byte, error)
- func RetryBackoff(b retry.Backoff, maxRetries uint64, ...) retry.Backoff
- type ApplyRequest
- type ApplyResponse
- type Command
- type ContextConnID
- type ContextServerID
- type HandlerFunc
- type HandlerFuncParams
- type KeyData
- type KeyExtractionFunc
- type KeyExtractionFuncResult
- type SnapshotObject
- type SubCommand
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareLex ¶
CompareLex returns -1 when s2 is lexicographically greater than s1, 0 if they're equal and 1 if s2 is lexicographically less than s1.
func EncodeCommand ¶
func FilterExpiredKeys ¶
FilterExpiredKeys filters out keys that are already expired, so they are not persisted.
func GetFreePort ¶ added in v0.5.0
func GetIPAddress ¶
func GetSubCommand ¶
func IsMaxMemoryExceeded ¶
IsMaxMemoryExceeded checks whether we have exceeded the current maximum memory limit.
func IsWriteCommand ¶
func IsWriteCommand(command Command, subCommand SubCommand) bool
func ParseBooleanResponse ¶
func ParseFloatResponse ¶
func ParseIntegerResponse ¶
func ParseMemory ¶
ParseMemory returns an integer representing the bytes in the memory string
func ParseNilResponse ¶
func ParseStringResponse ¶
func RetryBackoff ¶
Types ¶
type ApplyRequest ¶
type ApplyResponse ¶
type Command ¶ added in v0.5.0
type Command struct { Command string Module string Categories []string Description string SubCommands []SubCommand Sync bool // Specifies if command should be synced across replication cluster KeyExtractionFunc HandlerFunc }
type ContextConnID ¶
type ContextConnID string
type ContextServerID ¶
type ContextServerID string
type HandlerFunc ¶ added in v0.5.0
type HandlerFunc func(params HandlerFuncParams) ([]byte, error)
type HandlerFuncParams ¶ added in v0.5.0
type HandlerFuncParams struct { Context context.Context Command []string Connection *net.Conn KeyLock func(ctx context.Context, key string) (bool, error) KeyUnlock func(ctx context.Context, key string) KeyRLock func(ctx context.Context, key string) (bool, error) KeyRUnlock func(ctx context.Context, key string) KeyExists func(ctx context.Context, key string) bool CreateKeyAndLock func(ctx context.Context, key string) (bool, error) GetValue func(ctx context.Context, key string) interface{} SetValue func(ctx context.Context, key string, value interface{}) error GetExpiry func(ctx context.Context, key string) time.Time SetExpiry func(ctx context.Context, key string, expire time.Time, touch bool) RemoveExpiry func(ctx context.Context, key string) DeleteKey func(ctx context.Context, key string) error GetClock func() clock.Clock GetAllCommands func() []Command GetACL func() interface{} GetPubSub func() interface{} TakeSnapshot func() error RewriteAOF func() error GetLatestSnapshotTime func() int64 LoadModule func(path string, args ...string) error UnloadModule func(module string) ListModules func() []string }
type KeyExtractionFunc ¶ added in v0.5.0
type KeyExtractionFunc func(cmd []string) (KeyExtractionFuncResult, error)
type KeyExtractionFuncResult ¶ added in v0.5.0
type SnapshotObject ¶
type SubCommand ¶ added in v0.5.0
type SubCommand struct { Command string Module string Categories []string Description string Sync bool // Specifies if sub-command should be synced across replication cluster KeyExtractionFunc HandlerFunc }
Click to show internal directories.
Click to hide internal directories.