valkey

package
v1.24.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoURL  = errors.New("valkey.Config: no URL defined")
	ErrBadURL = errors.New("valkey.Config: URL is invalid")

	// Sentinel validation errors
	ErrSentinelMasterNameRequired = errors.New("valkey.Sentinel: masterName is required")
	ErrSentinelAddrRequired       = errors.New("valkey.Sentinel: addr is required")
	ErrSentinelAddrEmpty          = errors.New("valkey.Sentinel: addr cannot be empty")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	URL     string `json:"url"`
	Cluster bool   `json:"cluster,omitempty"`

	Sentinel *Sentinel `json:"sentinel,omitempty"`
}

Config is what Anubis unmarshals from the "parameters" JSON.

func (Config) Valid

func (c Config) Valid() error

type Factory

type Factory struct{}

func (Factory) Build

func (Factory) Build(ctx context.Context, data json.RawMessage) (store.Interface, error)

func (Factory) Valid

func (Factory) Valid(data json.RawMessage) error

type Sentinel added in v1.24.0

type Sentinel struct {
	MasterName string                  `json:"masterName"`
	Addr       internal.ListOr[string] `json:"addr"`
	ClientName string                  `json:"clientName,omitempty"`
	Username   string                  `json:"username,omitempty"`
	Password   string                  `json:"password,omitempty"`
}

func (Sentinel) Valid added in v1.24.0

func (s Sentinel) Valid() error

type Store

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

Store implements store.Interface on top of Redis/Valkey.

func (*Store) Delete

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

func (*Store) Get

func (s *Store) Get(ctx context.Context, key string) ([]byte, error)

func (*Store) IsPersistent added in v1.23.0

func (s *Store) IsPersistent() bool

IsPersistent tells Anubis this backend is “real” storage, not in-memory.

func (*Store) Set

func (s *Store) Set(ctx context.Context, key string, value []byte, expiry time.Duration) error

Jump to

Keyboard shortcuts

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