redis

package
v2.0.0-beta2 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const PluginName = "redis"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addrs            []string      `yaml:"addrs"`
	DB               int           `yaml:"db"`
	Username         string        `yaml:"username"`
	Password         string        `yaml:"password"`
	MasterName       string        `yaml:"master_name"`
	SentinelPassword string        `yaml:"sentinel_password"`
	RouteByLatency   bool          `yaml:"route_by_latency"`
	RouteRandomly    bool          `yaml:"route_randomly"`
	MaxRetries       int           `yaml:"max_retries"`
	DialTimeout      time.Duration `yaml:"dial_timeout"`
	MinRetryBackoff  time.Duration `yaml:"min_retry_backoff"`
	MaxRetryBackoff  time.Duration `yaml:"max_retry_backoff"`
	PoolSize         int           `yaml:"pool_size"`
	MinIdleConns     int           `yaml:"min_idle_conns"`
	MaxConnAge       time.Duration `yaml:"max_conn_age"`
	ReadTimeout      time.Duration `yaml:"read_timeout"`
	WriteTimeout     time.Duration `yaml:"write_timeout"`
	PoolTimeout      time.Duration `yaml:"pool_timeout"`
	IdleTimeout      time.Duration `yaml:"idle_timeout"`
	IdleCheckFreq    time.Duration `yaml:"idle_check_freq"`
	ReadOnly         bool          `yaml:"read_only"`
}

func (*Config) InitDefaults

func (s *Config) InitDefaults()

InitDefaults initializing fill config with default values

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

func (*Plugin) GetClient

func (s *Plugin) GetClient() redis.UniversalClient

func (*Plugin) Init

func (s *Plugin) Init(cfg config.Configurer, log logger.Logger) error

func (*Plugin) Name

func (s *Plugin) Name() string

func (*Plugin) Serve

func (s *Plugin) Serve() chan error

func (Plugin) Stop

func (s Plugin) Stop() error

type Redis

type Redis interface {
	// GetClient
	GetClient() redis.UniversalClient
}

Redis in the redis KV plugin interface

Jump to

Keyboard shortcuts

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