Documentation
¶
Index ¶
- type PrettyProgressWriter
- type ProgressWriter
- type RedisService
- func (s RedisService) GetCurrentNodeIp() string
- func (s RedisService) GetKeysCount(ctx context.Context) (int64, error)
- func (s RedisService) GetMemoryUsage(ctx context.Context, key string) (int64, error)
- func (s RedisService) GetTotalShards(ctx context.Context) (int64, error)
- func (s RedisService) ScanAllShards(ctx context.Context, options ScanOptions, resultChan chan ShardScanUpdate) chan ShardInit
- func (s RedisService) ScanKeys(ctx context.Context, options ScanOptions, resultChan chan ShardScanUpdate)
- func (rs *RedisService) SetClient(client redis.Client)
- func (rs *RedisService) SetClusterClient(client redis.ClusterClient)
- type ScanOptions
- type ShardInit
- type ShardScanUpdate
- type Tracker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PrettyProgressWriter ¶
type PrettyProgressWriter struct {
// contains filtered or unexported fields
}
PrettyProgressWriter progress writer using go-pretty/progress library
func NewPrettyProgressWriter ¶
func NewPrettyProgressWriter(output io.Writer) *PrettyProgressWriter
NewPrettyProgressWriter creates PrettyProgressWriter
func (*PrettyProgressWriter) AddTracker ¶
func (p *PrettyProgressWriter) AddTracker(id string, total int64)
func (*PrettyProgressWriter) Increment ¶
func (p *PrettyProgressWriter) Increment(id string, incrementBy int64)
Increment increments progress
func (*PrettyProgressWriter) SetNumTrackersExpected ¶
func (p *PrettyProgressWriter) SetNumTrackersExpected(numTrackers int)
func (*PrettyProgressWriter) Start ¶
func (p *PrettyProgressWriter) Start()
Start initiates progress writing progress, if total is unknown should be zero
func (*PrettyProgressWriter) Stop ¶
func (p *PrettyProgressWriter) Stop()
Stop labels progress as finished and stops updating progress
type ProgressWriter ¶
type ProgressWriter interface {
// AddTracker adds a tracker to the progress writer
// id is used to identify the tracker
AddTracker(id string, total int64)
// SetNumTrackersExpected sets the number of trackers expected
SetNumTrackersExpected(numTrackers int)
// Start initiates progress writing progress, if total is unknown should be zero
Start()
// Increment increments progress
Increment(id string, incrementBy int64)
// Stop labels progress as finished and stops updating progress
Stop()
}
ProgressWriter abstraction of progress writer
type RedisService ¶
type RedisService struct {
// contains filtered or unexported fields
}
RedisService implementation for iteration over redis
func NewRedisService ¶
func NewRedisService(logger zerolog.Logger) RedisService
func (RedisService) GetCurrentNodeIp ¶
func (s RedisService) GetCurrentNodeIp() string
func (RedisService) GetKeysCount ¶
func (s RedisService) GetKeysCount(ctx context.Context) (int64, error)
GetKeysCount returns number of keys in the current database
func (RedisService) GetMemoryUsage ¶
GetMemoryUsage returns memory usage of given key
func (RedisService) GetTotalShards ¶
func (s RedisService) GetTotalShards(ctx context.Context) (int64, error)
func (RedisService) ScanAllShards ¶
func (s RedisService) ScanAllShards(ctx context.Context, options ScanOptions, resultChan chan ShardScanUpdate) chan ShardInit
func (RedisService) ScanKeys ¶
func (s RedisService) ScanKeys(ctx context.Context, options ScanOptions, resultChan chan ShardScanUpdate)
ScanKeys scans keys asynchroniously and sends them to the returned channel
func (*RedisService) SetClient ¶
func (rs *RedisService) SetClient(client redis.Client)
func (*RedisService) SetClusterClient ¶
func (rs *RedisService) SetClusterClient(client redis.ClusterClient)
type ScanOptions ¶
ScanOptions options for scanning keyspace
type ShardScanUpdate ¶
Click to show internal directories.
Click to hide internal directories.