cluster

package
v0.0.169 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const Type = "redis-cluster"

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

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

func New

func New(config *Config, log logrus.FieldLogger) (*Cluster, error)

func (*Cluster) Delete

func (c *Cluster) Delete(ctx context.Context, key string) error

func (*Cluster) Get

func (c *Cluster) Get(ctx context.Context, key string) (*string, error)

func (*Cluster) GetAndDelete

func (c *Cluster) GetAndDelete(ctx context.Context, key string) (deletedValue *string, exists bool, err error)

func (*Cluster) GetOrSet

func (c *Cluster) GetOrSet(ctx context.Context, key, value string, ttl time.Duration) (storedValue *string, retrieved bool, err error)

func (*Cluster) Set

func (c *Cluster) Set(ctx context.Context, key, value string, ttl time.Duration) error

func (*Cluster) Start

func (c *Cluster) Start(ctx context.Context) error

func (*Cluster) Stop

func (c *Cluster) Stop(ctx context.Context) error

func (*Cluster) Type

func (c *Cluster) Type() string

type Config

type Config struct {
	Address string `yaml:"address" default:"redis://localhost:6379/0"`
	Prefix  string `yaml:"prefix" default:"xatu"`
}

func (*Config) Validate

func (c *Config) Validate() error

type Metrics

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

func NewMetrics

func NewMetrics(namespace string) *Metrics

func (*Metrics) AddDelete

func (m *Metrics) AddDelete(count int, cacheType, status string)

func (*Metrics) AddGet

func (m *Metrics) AddGet(count int, cacheType, status string)

func (*Metrics) AddSet

func (m *Metrics) AddSet(count int, cacheType, status string)

Jump to

Keyboard shortcuts

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