Documentation
¶
Index ¶
- func NewRedis(_ context.Context, sourceConfig *base.SourceConfig, ...) (base.Driver, error)
- func TestRedis(sourceConfig *base.SourceConfig) error
- type Redis
- func (r *Redis) Close() error
- func (r *Redis) GetAllAvailableIntervals() ([]*base.TimeInterval, error)
- func (r *Redis) GetCollectionMetaKey() string
- func (r *Redis) GetCollectionTable() string
- func (r *Redis) GetObjectsFor(interval *base.TimeInterval, objectsLoader base.ObjectsLoader) error
- func (r *Redis) GetRefreshWindow() (time.Duration, error)
- func (r *Redis) ReplaceTables() bool
- func (r *Redis) Type() string
- type RedisConfig
- type RedisParameters
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRedis ¶
func NewRedis(_ context.Context, sourceConfig *base.SourceConfig, collection *base.Collection) (base.Driver, error)
NewRedis returns configured Redis driver instance
func TestRedis ¶
func TestRedis(sourceConfig *base.SourceConfig) error
TestRedis tests connection to Redis without creating Driver instance
Types ¶
type Redis ¶
type Redis struct { base.IntervalDriver // contains filtered or unexported fields }
Redis is a Redis driver. It is used in syncing data from Redis.
func (*Redis) GetAllAvailableIntervals ¶
func (r *Redis) GetAllAvailableIntervals() ([]*base.TimeInterval, error)
GetAllAvailableIntervals returns ALL constant
func (*Redis) GetCollectionMetaKey ¶
GetCollectionMetaKey returns collection meta key (key is used in meta storage)
func (*Redis) GetCollectionTable ¶
GetCollectionTable returns collection table
func (*Redis) GetObjectsFor ¶
func (r *Redis) GetObjectsFor(interval *base.TimeInterval, objectsLoader base.ObjectsLoader) error
GetObjectsFor iterates over keys by mask and parses hash,string,list,set,zset types returns all parsed object or err if occurred
func (*Redis) ReplaceTables ¶
type RedisConfig ¶
type RedisConfig struct { Host string `mapstructure:"host" json:"host,omitempty" yaml:"host,omitempty"` Port json.Number `mapstructure:"port" json:"port,omitempty" yaml:"port,omitempty"` Password string `mapstructure:"password" json:"password,omitempty" yaml:"password,omitempty"` SentinelMasterName string `mapstructure:"sentinel_master_name" json:"sentinel_master_name,omitempty" yaml:"sentinel_master_name,omitempty"` TLSSkipVerify bool `mapstructure:"tls_skip_verify" json:"tls_skip_verify,omitempty" yaml:"tls_skip_verify,omitempty"` }
RedisConfig is a Redis configuration dto for serialization
func (*RedisConfig) Validate ¶
func (rc *RedisConfig) Validate() error
Validate returns err if configuration is invalid
type RedisParameters ¶
type RedisParameters struct {
RedisKey string `mapstructure:"redis_key" json:"redis_key,omitempty" yaml:"redis_key,omitempty"`
}
RedisParameters is a Redis key configuration dto for serialization
func (*RedisParameters) Validate ¶
func (rp *RedisParameters) Validate() error
Validate returns err if configuration is invalid