redis

package
v0.0.0-...-8aeb8a1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

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) Close

func (r *Redis) Close() error

Close closes redis pool

func (*Redis) GetAllAvailableIntervals

func (r *Redis) GetAllAvailableIntervals() ([]*base.TimeInterval, error)

GetAllAvailableIntervals returns ALL constant

func (*Redis) GetCollectionMetaKey

func (r *Redis) GetCollectionMetaKey() string

GetCollectionMetaKey returns collection meta key (key is used in meta storage)

func (*Redis) GetCollectionTable

func (r *Redis) GetCollectionTable() string

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) GetRefreshWindow

func (r *Redis) GetRefreshWindow() (time.Duration, error)

func (*Redis) ReplaceTables

func (r *Redis) ReplaceTables() bool

func (*Redis) Type

func (r *Redis) Type() string

Type returns Redis type

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL