Versions in this module Expand all Collapse all v0 v0.24.0 May 27, 2024 v0.23.0 May 14, 2024 v0.22.0 Jan 23, 2024 v0.21.0 Jan 10, 2024 Changes in this version + type FakeClient struct + Responses []FakeResponse + func (fc *FakeClient) Close() error + func (fc *FakeClient) RedisBGSave(ctx context.Context) 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) RedisDo(ctx context.Context, args ...interface{}) (interface{}, error) + func (fc *FakeClient) RedisInfo(ctx context.Context, section string) (string, error) + func (fc *FakeClient) RedisLastSave(ctx context.Context) (int64, error) + func (fc *FakeClient) RedisRole(ctx context.Context) (interface{}, error) + func (fc *FakeClient) RedisSet(ctx context.Context, key string, value interface{}) error + func (fc *FakeClient) RedisSlaveOf(ctx context.Context, host, port string) error + func (fc *FakeClient) SentinelDo(ctx context.Context, args ...interface{}) (interface{}, error) + func (fc *FakeClient) SentinelGetMasterAddrByName(ctx context.Context, shard string) ([]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) SentinelPing(ctx context.Context) 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 struct + InjectError func() error + InjectResponse func() interface{} + func NewPredefinedRedisFakeResponse(dictionary string, err error) FakeResponse + type GoRedisClient struct + func MustNewFromConnectionString(connectionString string) *GoRedisClient + func NewFromConnectionString(connectionString string) (*GoRedisClient, error) + func NewFromOptions(opt *redis.Options) *GoRedisClient + func (c *GoRedisClient) Close() error + func (c *GoRedisClient) CloseRedis() error + func (c *GoRedisClient) CloseSentinel() error + func (c *GoRedisClient) RedisBGSave(ctx context.Context) 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) RedisDo(ctx context.Context, args ...interface{}) (interface{}, error) + func (c *GoRedisClient) RedisInfo(ctx context.Context, section string) (string, error) + func (c *GoRedisClient) RedisLastSave(ctx context.Context) (int64, error) + func (c *GoRedisClient) RedisRole(ctx context.Context) (interface{}, error) + func (c *GoRedisClient) RedisSet(ctx context.Context, key string, value interface{}) error + func (c *GoRedisClient) RedisSlaveOf(ctx context.Context, host, port string) error + func (c *GoRedisClient) SentinelDo(ctx context.Context, args ...interface{}) (interface{}, error) + func (c *GoRedisClient) SentinelGetMasterAddrByName(ctx context.Context, shard string) ([]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) SentinelPing(ctx context.Context) 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 struct + CacheAge time.Duration + Info map[string]string + type Role string + const Master + const Slave + const Unknown + type SentinelInfoCache map[string]map[string]RedisServerInfoCache + func (sic SentinelInfoCache) GetValue(shard, runID, key string, maxCacheAge time.Duration) (string, error) + type SentinelMasterCmdResult struct + ConfigEpoch int + DownAfterMilliseconds int + FailoverTimeout int + Flags string + IP string + InfoRefresh int + LastOkPingReply int + LastPingReply int + LastPingSent int + LinkPendingCommands int + LinkRefcount int + Name string + NumOtherSentinels int + NumSlaves int + ParallelSyncs int + Port int + Quorum int + RoleReported string + RoleReportedTime int + RunID string + type SentinelSlaveCmdResult struct + DownAfterMilliseconds int + Flags string + IP string + InfoRefresh int + LastOkPingReply int + LastPingReply int + LastPingSent int + LinkPendingCommands int + LinkRefcount int + MasterHost string + MasterLinkDownTime int + MasterLinkStatus string + MasterPort int + Name string + Port int + RoleReported string + RoleReportedTime int + RunID string + SlavePriority int + SlaveReplOffset int + type TestableInterface interface + Close func() error + RedisBGSave func(context.Context) error + RedisConfigGet func(context.Context, string) ([]interface{}, error) + RedisConfigSet func(context.Context, string, string) error + RedisDebugSleep func(context.Context, time.Duration) error + RedisDo func(context.Context, ...interface{}) (interface{}, error) + RedisInfo func(ctx context.Context, section string) (string, error) + RedisLastSave func(context.Context) (int64, error) + RedisRole func(context.Context) (interface{}, error) + RedisSet func(context.Context, string, interface{}) error + RedisSlaveOf func(context.Context, string, string) error + SentinelDo func(context.Context, ...interface{}) (interface{}, error) + SentinelGetMasterAddrByName func(ctx context.Context, shard string) ([]string, error) + SentinelInfoCache func(context.Context) (interface{}, error) + SentinelMaster func(context.Context, string) (*SentinelMasterCmdResult, error) + SentinelMasters func(context.Context) ([]interface{}, error) + SentinelMonitor func(context.Context, string, string, string, int) error + SentinelPSubscribe func(context.Context, ...string) (<-chan *redis.Message, func() error) + SentinelPing func(ctx context.Context) error + SentinelSet func(context.Context, string, string, string) error + SentinelSlaves func(context.Context, string) ([]interface{}, error) + func NewFakeClient(responses ...FakeResponse) TestableInterface