Documentation ¶
Index ¶
- type FakeClient
- func (fc *FakeClient) Close() error
- func (fc *FakeClient) RedisConfigGet(ctx context.Context, parameter string) ([]interface{}, error)
- func (fc *FakeClient) RedisConfigSet(ctx context.Context, parameter, value string) error
- func (fc *FakeClient) RedisDebugSleep(ctx context.Context, duration time.Duration) error
- func (fc *FakeClient) RedisRole(ctx context.Context) (interface{}, error)
- func (fc *FakeClient) RedisSlaveOf(ctx context.Context, host, port string) error
- func (fc *FakeClient) SentinelInfoCache(ctx context.Context) (interface{}, error)
- func (fc *FakeClient) SentinelMaster(ctx context.Context, shard string) (*SentinelMasterCmdResult, error)
- func (fc *FakeClient) SentinelMasters(ctx context.Context) ([]interface{}, error)
- func (fc *FakeClient) SentinelMonitor(ctx context.Context, name, host string, port string, quorum int) error
- func (fc *FakeClient) SentinelPSubscribe(ctx context.Context, events ...string) (<-chan *redis.Message, func() error)
- func (fc *FakeClient) SentinelSet(ctx context.Context, shard, parameter, value string) error
- func (fc *FakeClient) SentinelSlaves(ctx context.Context, shard string) ([]interface{}, error)
- type FakeResponse
- type GoRedisClient
- func (c *GoRedisClient) Close() error
- func (c *GoRedisClient) CloseRedis() error
- func (c *GoRedisClient) CloseSentinel() error
- func (c *GoRedisClient) RedisConfigGet(ctx context.Context, parameter string) ([]interface{}, error)
- func (c *GoRedisClient) RedisConfigSet(ctx context.Context, parameter, value string) error
- func (c *GoRedisClient) RedisDebugSleep(ctx context.Context, duration time.Duration) error
- func (c *GoRedisClient) RedisRole(ctx context.Context) (interface{}, error)
- func (c *GoRedisClient) RedisSlaveOf(ctx context.Context, host, port string) error
- func (c *GoRedisClient) SentinelInfoCache(ctx context.Context) (interface{}, error)
- func (c *GoRedisClient) SentinelMaster(ctx context.Context, shard string) (*SentinelMasterCmdResult, error)
- func (c *GoRedisClient) SentinelMasters(ctx context.Context) ([]interface{}, error)
- func (c *GoRedisClient) SentinelMonitor(ctx context.Context, name, host string, port string, quorum int) error
- func (c *GoRedisClient) SentinelPSubscribe(ctx context.Context, events ...string) (<-chan *redis.Message, func() error)
- func (c *GoRedisClient) SentinelSet(ctx context.Context, shard, parameter, value string) error
- func (c *GoRedisClient) SentinelSlaves(ctx context.Context, shard string) ([]interface{}, error)
- type RedisServerInfoCache
- type Role
- type SentinelInfoCache
- type SentinelMasterCmdResult
- type SentinelSlaveCmdResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeClient ¶
type FakeClient struct {
Responses []FakeResponse
}
func (*FakeClient) Close ¶ added in v0.14.0
func (fc *FakeClient) Close() error
func (*FakeClient) RedisConfigGet ¶
func (fc *FakeClient) RedisConfigGet(ctx context.Context, parameter string) ([]interface{}, error)
func (*FakeClient) RedisConfigSet ¶ added in v0.16.1
func (fc *FakeClient) RedisConfigSet(ctx context.Context, parameter, value string) error
func (*FakeClient) RedisDebugSleep ¶ added in v0.16.1
WARNING: this command blocks for the duration
func (*FakeClient) RedisRole ¶
func (fc *FakeClient) RedisRole(ctx context.Context) (interface{}, error)
func (*FakeClient) RedisSlaveOf ¶
func (fc *FakeClient) RedisSlaveOf(ctx context.Context, host, port string) error
func (*FakeClient) SentinelInfoCache ¶ added in v0.13.0
func (fc *FakeClient) SentinelInfoCache(ctx context.Context) (interface{}, error)
func (*FakeClient) SentinelMaster ¶
func (fc *FakeClient) SentinelMaster(ctx context.Context, shard string) (*SentinelMasterCmdResult, error)
func (*FakeClient) SentinelMasters ¶
func (fc *FakeClient) SentinelMasters(ctx context.Context) ([]interface{}, error)
func (*FakeClient) SentinelMonitor ¶
func (*FakeClient) SentinelPSubscribe ¶
func (fc *FakeClient) SentinelPSubscribe(ctx context.Context, events ...string) (<-chan *redis.Message, func() error)
func (*FakeClient) SentinelSet ¶
func (fc *FakeClient) SentinelSet(ctx context.Context, shard, parameter, value string) error
func (*FakeClient) SentinelSlaves ¶
func (fc *FakeClient) SentinelSlaves(ctx context.Context, shard string) ([]interface{}, error)
type FakeResponse ¶
type FakeResponse struct { InjectResponse func() interface{} InjectError func() error }
type GoRedisClient ¶
type GoRedisClient struct {
// contains filtered or unexported fields
}
func NewFromConnectionString ¶
func NewFromConnectionString(connectionString string) (*GoRedisClient, error)
func NewFromOptions ¶
func NewFromOptions(opt *redis.Options) *GoRedisClient
func (*GoRedisClient) Close ¶ added in v0.14.0
func (c *GoRedisClient) Close() error
func (*GoRedisClient) CloseRedis ¶ added in v0.14.0
func (c *GoRedisClient) CloseRedis() error
func (*GoRedisClient) CloseSentinel ¶ added in v0.14.0
func (c *GoRedisClient) CloseSentinel() error
func (*GoRedisClient) RedisConfigGet ¶
func (c *GoRedisClient) RedisConfigGet(ctx context.Context, parameter string) ([]interface{}, error)
func (*GoRedisClient) RedisConfigSet ¶ added in v0.16.1
func (c *GoRedisClient) RedisConfigSet(ctx context.Context, parameter, value string) error
func (*GoRedisClient) RedisDebugSleep ¶ added in v0.16.1
WARNING: this command blocks for the duration
func (*GoRedisClient) RedisRole ¶
func (c *GoRedisClient) RedisRole(ctx context.Context) (interface{}, error)
func (*GoRedisClient) RedisSlaveOf ¶
func (c *GoRedisClient) RedisSlaveOf(ctx context.Context, host, port string) error
func (*GoRedisClient) SentinelInfoCache ¶ added in v0.13.0
func (c *GoRedisClient) SentinelInfoCache(ctx context.Context) (interface{}, error)
func (*GoRedisClient) SentinelMaster ¶
func (c *GoRedisClient) SentinelMaster(ctx context.Context, shard string) (*SentinelMasterCmdResult, error)
func (*GoRedisClient) SentinelMasters ¶
func (c *GoRedisClient) SentinelMasters(ctx context.Context) ([]interface{}, error)
func (*GoRedisClient) SentinelMonitor ¶
func (*GoRedisClient) SentinelPSubscribe ¶
func (c *GoRedisClient) SentinelPSubscribe(ctx context.Context, events ...string) (<-chan *redis.Message, func() error)
func (*GoRedisClient) SentinelSet ¶
func (c *GoRedisClient) SentinelSet(ctx context.Context, shard, parameter, value string) error
func (*GoRedisClient) SentinelSlaves ¶
func (c *GoRedisClient) SentinelSlaves(ctx context.Context, shard string) ([]interface{}, error)
type RedisServerInfoCache ¶ added in v0.13.0
type Role ¶
type Role string
Role represents the role of a redis server within a shard
const ( // Master is the master role in a shard. Under normal circumstances, only // a server in the shard can be master at a given time Master Role = "master" // Slave are servers within the shard that replicate data from the master // for data high availabilty purposes Slave Role = "slave" // Unknown represents a state in which the role of the server is still unknown Unknown Role = "unknown" )
type SentinelInfoCache ¶ added in v0.13.0
type SentinelInfoCache map[string]map[string]RedisServerInfoCache
type SentinelMasterCmdResult ¶
type SentinelMasterCmdResult struct { Name string `redis:"name"` IP string `redis:"ip"` Port int `redis:"port"` RunID string `redis:"runid"` Flags string `redis:"flags"` LinkPendingCommands int `redis:"link-pending-commands"` LinkRefcount int `redis:"link-refcount"` LastPingSent int `redis:"last-ping-sent"` LastOkPingReply int `redis:"last-ok-ping-reply"` LastPingReply int `redis:"last-ping-reply"` DownAfterMilliseconds int `redis:"down-after-milliseconds"` InfoRefresh int `redis:"info-refresh"` RoleReported string `redis:"role-reported"` RoleReportedTime int `redis:"role-reported-time"` ConfigEpoch int `redis:"config-epoch"` NumSlaves int `redis:"num-slaves"` NumOtherSentinels int `redis:"num-other-sentinels"` Quorum int `redis:"quorum"` FailoverTimeout int `redis:"failover-timeout"` ParallelSyncs int `redis:"parallel-syncs"` }
SentinelMasterCmdResult represents the output of the "sentinel master" command
type SentinelSlaveCmdResult ¶
type SentinelSlaveCmdResult struct { Name string `redis:"name"` IP string `redis:"ip"` Port int `redis:"port"` RunID string `redis:"runid"` Flags string `redis:"flags"` LinkPendingCommands int `redis:"link-pending-commands"` LinkRefcount int `redis:"link-refcount"` LastPingSent int `redis:"last-ping-sent"` LastOkPingReply int `redis:"last-ok-ping-reply"` LastPingReply int `redis:"last-ping-reply"` DownAfterMilliseconds int `redis:"down-after-milliseconds"` InfoRefresh int `redis:"info-refresh"` RoleReported string `redis:"role-reported"` RoleReportedTime int `redis:"role-reported-time"` MasterLinkDownTime int `redis:"master-link-down-time"` MasterLinkStatus string `redis:"master-link-status"` MasterHost string `redis:"master-host"` MasterPort int `redis:"master-port"` SlavePriority int `redis:"slave-priority"` SlaveReplOffset int `redis:"slave-repl-offset"` }
SentinelSlaveCmdResult represents the output of the "sentinel slave" command
Click to show internal directories.
Click to hide internal directories.