rediscluster

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRevisionKey

func GetRevisionKey(prefix string) string

GetRevisionKey is used to get revision key

func New

func New(cfg *Config, logger logger.Logger, registerer prometheus.Registerer) (pluginregistry.StoragePlugin, error)

New is used to init service

Types

type Config

type Config struct {
	Enable    bool
	Addresses []string
	Password  string
	Prefix    string
}

Config defines the config structure

func NewConfig

func NewConfig() *Config

NewConfig is used to init config with default values

func (*Config) IsEnabled

func (c *Config) IsEnabled() bool

IsEnabled is used to return whether the current component is enabled This attribute is required in pluggable components

func (*Config) RegisterFlagsWithPrefix

func (c *Config) RegisterFlagsWithPrefix(prefix string, f *pflag.FlagSet)

RegisterFlagsWithPrefix is used to register flags

func (*Config) Validate

func (c *Config) Validate() error

Validate is used to validate config and returns error on failure

type Plugin

type Plugin struct {
	logger.Logger
	// contains filtered or unexported fields
}

Plugin defines a storage plugin with Redis as the backend

func (*Plugin) Delete

func (s *Plugin) Delete(ctx context.Context, key string) error

Delete is used to delete specified key

func (*Plugin) GetAnnouncement

func (s *Plugin) GetAnnouncement() chan struct{}

GetAnnouncement is used to get announcement

func (*Plugin) List

func (s *Plugin) List(ctx context.Context) (map[string]string, error)

List is used to list all key-val pairs in storage

func (*Plugin) Name

func (s *Plugin) Name() string

Name is used to return the plugin name

func (*Plugin) Set

func (s *Plugin) Set(ctx context.Context, key string, val string) error

Set is used to set key-val pair

func (*Plugin) Start

func (s *Plugin) Start(ctx context.Context, cancelFunc context.CancelFunc) error

Start is used to start the plugin

Jump to

Keyboard shortcuts

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