valkey

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrValkeyPoolNil            = errors.New("valkey: client connection is nil")
	ErrInvalidHost              = errors.New("valkey: host is required")
	ErrInvalidPort              = errors.New("valkey: port must be between 1 and 65535")
	ErrInvalidDB                = errors.New("valkey: database number must be non-negative")
	ErrInvalidPoolSize          = errors.New("valkey: pool size must be positive")
	ErrConfigNil                = errors.New("valkey: configuration must not be nil")
	ErrCAParseFailure           = errors.New("failed to parse CA certificate")
	ErrHealthCheckNoActiveConns = errors.New("valkey health check failed: no active connections in pool")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Host            string
	Port            int
	Password        string
	DB              int
	DialTimeout     time.Duration
	MaxIdleConns    int
	MinIdleConns    int
	PingTimeout     time.Duration
	PoolSize        int
	ReadTimeout     time.Duration
	WriteTimeout    time.Duration
	MaxRetries      int
	MinRetryBackoff time.Duration
	MaxRetryBackoff time.Duration
	TLSEnabled      bool
	TLSSkipVerify   bool
	TLSCertFile     string
	TLSKeyFile      string
	TLSCAFile       string
}

func (*Config) Validate

func (cfg *Config) Validate() error

func (*Config) WithDefaults

func (cfg *Config) WithDefaults() *Config

type Valkey

type Valkey struct {
	*redis.Client
}

func New

func New(cfg *Config) (*Valkey, error)

func (*Valkey) HealthCheck

func (v *Valkey) HealthCheck(ctx context.Context) error

func (*Valkey) Name

func (v *Valkey) Name() string

func (*Valkey) PoolStats

func (v *Valkey) PoolStats() *redis.PoolStats

func (*Valkey) Start

func (v *Valkey) Start(ctx context.Context) error

func (*Valkey) Stop

func (v *Valkey) Stop() error

Jump to

Keyboard shortcuts

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