valkey

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package valkey provides atomic bounded-use consumption through one Valkey EVAL operation. Client libraries adapt their result type to Evaler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsumptionStore

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

ConsumptionStore atomically consumes bounded capabilities in Valkey.

func NewConsumptionStore

func NewConsumptionStore(options Options) (*ConsumptionStore, error)

NewConsumptionStore validates a client and fixed key prefix.

func (*ConsumptionStore) Consume

Consume executes one constant script against one declared, digest-derived key.

type Evaler

type Evaler interface {
	Eval(context.Context, string, []string, ...string) ([]string, error)
}

Evaler executes one script with every accessed key declared in keys and normalizes the RESP array reply to strings. Implementations must preserve context cancellation and must not retry writes after unknown outcomes.

type Options

type Options struct {
	Client    Evaler
	KeyPrefix string
}

Options configures Valkey key ownership.

Jump to

Keyboard shortcuts

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