Documentation ¶
Index ¶
- func InfoStringToMap(in string) map[string]string
- type Server
- func MustNewServer(connectionString string, alias *string) *Server
- func NewFakeServerWithFakeClient(host, port string, responses ...client.FakeResponse) *Server
- func NewServer(connectionString string, alias *string) (*Server, error)
- func NewServerFromParams(alias, host, port string, c client.TestableInterface) *Server
- func (srv *Server) CloseClient() error
- func (srv *Server) GetAlias() string
- func (srv *Server) GetClient() client.TestableInterface
- func (srv *Server) GetHost() string
- func (srv *Server) GetPort() string
- func (srv *Server) ID() string
- func (srv *Server) RedisBGSave(ctx context.Context) error
- func (srv *Server) RedisConfigGet(ctx context.Context, parameter string) (string, error)
- func (srv *Server) RedisConfigSet(ctx context.Context, parameter, value string) error
- func (srv *Server) RedisDebugSleep(ctx context.Context, duration time.Duration) error
- func (srv *Server) RedisInfo(ctx context.Context, section string) (map[string]string, error)
- func (srv *Server) RedisLastSave(ctx context.Context) (int64, error)
- func (srv *Server) RedisRole(ctx context.Context) (client.Role, string, error)
- func (srv *Server) RedisSet(ctx context.Context, key string, value interface{}) error
- func (srv *Server) RedisSlaveOf(ctx context.Context, host, port string) error
- func (srv *Server) SentinelGetMasterAddrByName(ctx context.Context, shard string) (string, int, error)
- func (srv *Server) SentinelInfoCache(ctx context.Context) (client.SentinelInfoCache, error)
- func (srv *Server) SentinelMaster(ctx context.Context, shard string) (*client.SentinelMasterCmdResult, error)
- func (srv *Server) SentinelMasters(ctx context.Context) ([]client.SentinelMasterCmdResult, error)
- func (srv *Server) SentinelMonitor(ctx context.Context, name, host string, port string, quorum int) error
- func (srv *Server) SentinelPSubscribe(ctx context.Context, events ...string) (<-chan *redis.Message, func() error)
- func (srv *Server) SentinelPing(ctx context.Context) error
- func (srv *Server) SentinelSet(ctx context.Context, shard, parameter, value string) error
- func (srv *Server) SentinelSlaves(ctx context.Context, shard string) ([]client.SentinelSlaveCmdResult, error)
- func (srv *Server) SetAlias(alias string)
- type ServerPool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InfoStringToMap ¶
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a host that talks the redis protocol Contains methods to use a subset of redis commands
func MustNewServer ¶
func NewFakeServerWithFakeClient ¶
func NewFakeServerWithFakeClient(host, port string, responses ...client.FakeResponse) *Server
NewFakeServerWithFakeClient returns a fake server with a fake client that will return the provided responses when called. This is only intended for testing.
func NewServer ¶
NewServer returns a new client for this redis server from the given connection string. It can optionally be passed an alias to identify the server.
func NewServerFromParams ¶
func NewServerFromParams(alias, host, port string, c client.TestableInterface) *Server
func (*Server) CloseClient ¶
func (*Server) GetClient ¶
func (srv *Server) GetClient() client.TestableInterface
func (*Server) RedisConfigGet ¶
func (*Server) RedisConfigSet ¶
func (*Server) RedisDebugSleep ¶
func (*Server) RedisSlaveOf ¶
func (*Server) SentinelGetMasterAddrByName ¶
func (*Server) SentinelInfoCache ¶
func (*Server) SentinelMaster ¶
func (*Server) SentinelMasters ¶
func (*Server) SentinelMonitor ¶
func (*Server) SentinelPSubscribe ¶
func (*Server) SentinelSet ¶
func (*Server) SentinelSlaves ¶
type ServerPool ¶
type ServerPool struct {
// contains filtered or unexported fields
}
ServerPool holds a thread safe list of Servers. It is intended for client reuse throughout the code.
func NewServerPool ¶
func NewServerPool(servers ...*Server) *ServerPool
func (*ServerPool) GetServer ¶
func (pool *ServerPool) GetServer(connectionString string, alias *string) (*Server, error)
func (*ServerPool) GetServerAlias ¶ added in v0.25.1
func (pool *ServerPool) GetServerAlias(hostport string) string
Click to show internal directories.
Click to hide internal directories.