Documentation
¶
Index ¶
- Constants
- Variables
- func BetweenValues[T constraints.Ordered](t testing.TB, d, start, end T, msgAndArgs ...interface{})
- func BetweenValuesEx[T constraints.Ordered](t testing.TB, d, start, end T, msgAndArgs ...interface{})
- func CLIPath() string
- func DefaultTLSConfig() (*tls.Config, error)
- func ErrorRegexp(t testing.TB, err error, rx interface{}, msgAndArgs ...interface{})
- func FindInfoEntry(rdb *redis.Client, key string, section ...string) string
- func LuaJITEnable() bool
- func PausableTCPProxy(ctx context.Context, t testing.TB, to string, pauseCh <-chan bool) uint64
- func Populate(t testing.TB, rdb *redis.Client, prefix string, n, size int)
- func RandPath[T any](f ...func() T) T
- func RandPathNoResult(f ...func())
- func RandString(minInt, maxInt int, typ RandStringType) string
- func RandStringWithSeed(minInt, maxInt int, typ RandStringType, seed int64) string
- func RandomBool() bool
- func RandomInt(maxInt int64) int64
- func RandomIntWithSeed(maxInt, seed int64) int64
- func RandomSignedInt(maxInt int32) int64
- func RandomValue() string
- func RandomValueWithSeed(seed int64) string
- func RetryEventually(t testing.TB, condition func() bool, maxAttempts int, ...)
- func SimpleTCPProxy(ctx context.Context, t testing.TB, to string, slowdown bool) uint64
- func SlaveOf(t testing.TB, slave *redis.Client, master *KvrocksServer)
- func TLSEnable() bool
- func WaitForOffsetSync(t testing.TB, master, slave *redis.Client, waitFor time.Duration)
- func WaitForSync(t testing.TB, slave *redis.Client)
- type ConfigOptions
- type KMetadataResponse
- type KvrocksServer
- func (s *KvrocksServer) Close()
- func (s *KvrocksServer) CloseWithoutCleanup()
- func (s *KvrocksServer) Host() string
- func (s *KvrocksServer) HostPort() string
- func (s *KvrocksServer) LogFileMatches(t testing.TB, pattern string) bool
- func (s *KvrocksServer) NewClient() *redis.Client
- func (s *KvrocksServer) NewClientWithOption(options *redis.Options) *redis.Client
- func (s *KvrocksServer) NewTCPClient() *TCPClient
- func (s *KvrocksServer) NewTCPTLSClient(conf *tls.Config) *TCPClient
- func (s *KvrocksServer) Port() uint64
- func (s *KvrocksServer) Restart()
- func (s *KvrocksServer) Start()
- func (s *KvrocksServer) TLSAddr() string
- func (s *KvrocksServer) TLSPort() uint64
- type KvrocksServerConfigs
- type RandStringType
- type TCPClient
- func (c *TCPClient) Close() error
- func (c *TCPClient) MustFail(t testing.TB)
- func (c *TCPClient) MustMatch(t testing.TB, rx string)
- func (c *TCPClient) MustRead(t testing.TB, s string)
- func (c *TCPClient) MustReadBulkString(t testing.TB, s string)
- func (c *TCPClient) MustReadStrings(t testing.TB, s []string)
- func (c *TCPClient) MustReadStringsWithKey(t testing.TB, key string, s []string)
- func (c *TCPClient) ReadLine() (string, error)
- func (c *TCPClient) TLSState() *tls.ConnectionState
- func (c *TCPClient) Write(s string) error
- func (c *TCPClient) WriteArgs(args ...string) error
Constants ¶
const DefaultDelta = 0.000001
Variables ¶
var SlotTable = [...]string{}/* 16384 elements not displayed */
SlotTable is a table of the shortest possible alphanumeric string that is mapped by redis's crc16 to any given redis cluster slot.
The array indexes are slot numbers, so that given a desired slot, this string is guaranteed to make redis cluster route a request to the shard holding this slot
Functions ¶
func BetweenValues ¶
func BetweenValues[T constraints.Ordered](t testing.TB, d, start, end T, msgAndArgs ...interface{})
BetweenValues asserts start <= d <= end
func BetweenValuesEx ¶
func BetweenValuesEx[T constraints.Ordered](t testing.TB, d, start, end T, msgAndArgs ...interface{})
BetweenValuesEx asserts start < d < end
func DefaultTLSConfig ¶
func ErrorRegexp ¶
func LuaJITEnable ¶
func LuaJITEnable() bool
func PausableTCPProxy ¶
PausableTCPProxy creates a TCP proxy that can be paused/resumed via a channel. Send true to pause, false to resume. Returns the proxy port. When paused, the proxy stops reading from the source, causing the sender's TCP buffer to fill up and eventually blocking writes.
func RandPathNoResult ¶
func RandPathNoResult(f ...func())
func RandString ¶
func RandString(minInt, maxInt int, typ RandStringType) string
func RandStringWithSeed ¶
func RandStringWithSeed(minInt, maxInt int, typ RandStringType, seed int64) string
func RandomBool ¶
func RandomBool() bool
func RandomIntWithSeed ¶
func RandomSignedInt ¶
RandomSignedInt returns an integer in (-maxInt, maxInt)
func RandomValue ¶
func RandomValue() string
func RandomValueWithSeed ¶
func RetryEventually ¶
func SimpleTCPProxy ¶
func WaitForOffsetSync ¶
Types ¶
type ConfigOptions ¶
type KMetadataResponse ¶
type KMetadataResponse struct {
Expire int64
Size int64
Type string
Flags int64
Version int64
Mode string
Format string
Persist int64
Lower int64
Upper int64
Head int64
Tail int64
}
func ExtractKMetadataResponse ¶
func ExtractKMetadataResponse(result interface{}) (*KMetadataResponse, error)
func GetKMetadata ¶
type KvrocksServer ¶
type KvrocksServer struct {
// contains filtered or unexported fields
}
func StartServer ¶
func StartServer(t testing.TB, configs map[string]string) *KvrocksServer
func StartTLSServer ¶
func StartTLSServer(t testing.TB, configs map[string]string) *KvrocksServer
func (*KvrocksServer) Close ¶
func (s *KvrocksServer) Close()
func (*KvrocksServer) CloseWithoutCleanup ¶
func (s *KvrocksServer) CloseWithoutCleanup()
func (*KvrocksServer) Host ¶
func (s *KvrocksServer) Host() string
func (*KvrocksServer) HostPort ¶
func (s *KvrocksServer) HostPort() string
func (*KvrocksServer) LogFileMatches ¶
func (s *KvrocksServer) LogFileMatches(t testing.TB, pattern string) bool
func (*KvrocksServer) NewClient ¶
func (s *KvrocksServer) NewClient() *redis.Client
func (*KvrocksServer) NewClientWithOption ¶
func (s *KvrocksServer) NewClientWithOption(options *redis.Options) *redis.Client
func (*KvrocksServer) NewTCPClient ¶
func (s *KvrocksServer) NewTCPClient() *TCPClient
func (*KvrocksServer) NewTCPTLSClient ¶
func (s *KvrocksServer) NewTCPTLSClient(conf *tls.Config) *TCPClient
func (*KvrocksServer) Port ¶
func (s *KvrocksServer) Port() uint64
func (*KvrocksServer) Restart ¶
func (s *KvrocksServer) Restart()
func (*KvrocksServer) Start ¶
func (s *KvrocksServer) Start()
func (*KvrocksServer) TLSAddr ¶
func (s *KvrocksServer) TLSAddr() string
func (*KvrocksServer) TLSPort ¶
func (s *KvrocksServer) TLSPort() uint64
type KvrocksServerConfigs ¶
func GenerateConfigsMatrix ¶
func GenerateConfigsMatrix(configOptions []ConfigOptions) ([]KvrocksServerConfigs, error)
/ GenerateConfigsMatrix generates all possible combinations of config options
type TCPClient ¶
type TCPClient struct {
// contains filtered or unexported fields
}
func (*TCPClient) MustReadBulkString ¶
func (*TCPClient) MustReadStringsWithKey ¶
func (*TCPClient) TLSState ¶
func (c *TCPClient) TLSState() *tls.ConnectionState