ValkeyAdapter

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// ValkeyWrongTypeOrNotFoundError is returned by custom Valkey module commands
	// when the key is missing or has an incompatible type.
	ValkeyWrongTypeOrNotFoundError = "WRONGTYPE_OR_NOTFOUND"
	// PriorityListGetOrCreateCommand fetches or initializes a module-backed priority list.
	PriorityListGetOrCreateCommand = "PRIORITYLIST.GETORCREATE"
	// PriorityListGetCommand fetches a module-backed priority list.
	PriorityListGetCommand = "PRIORITYLIST.GET"
	// HashSetGetOrCreateCommand fetches or initializes a module-backed hash set value.
	HashSetGetOrCreateCommand = "HASHSET.GETORCREATE"
	// HashSetLookupCommand fetches a module-backed hash set value.
	HashSetLookupCommand = "HASHSET.LOOKUP"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type OperationArgs

type OperationArgs struct {
	MapKey   string
	HubName  string
	Value    string
	IntValue int64
	MapValue map[string]string
}

type ValkeyAdapter

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

func NewValkeyAdapter

func NewValkeyAdapter(client valkey.Client, logger *zap.Logger, opts ...ValkeyAdapterOption) *ValkeyAdapter

func (*ValkeyAdapter) AddElementToSet

func (r *ValkeyAdapter) AddElementToSet(variableKey string, hubName string, value string) valkey.Completed

func (*ValkeyAdapter) AuditStreamExpiry

func (r *ValkeyAdapter) AuditStreamExpiry() time.Duration

func (*ValkeyAdapter) BulkSetMap

func (r *ValkeyAdapter) BulkSetMap(variableKey string, hubName string, values map[string]string) valkey.Completed

func (*ValkeyAdapter) DeleteKeysWithPrefixUsingScan

func (r *ValkeyAdapter) DeleteKeysWithPrefixUsingScan(ctx context.Context, keep map[string]struct{}, hubName string) error

func (*ValkeyAdapter) DeleteString

func (r *ValkeyAdapter) DeleteString(variableKey string, hubName string) valkey.Completed

func (*ValkeyAdapter) Exists added in v0.3.1

func (r *ValkeyAdapter) Exists(ctx context.Context, variableKey string, hubName string) (bool, error)

func (*ValkeyAdapter) GetMap

func (r *ValkeyAdapter) GetMap(ctx context.Context, variableKey string, hubName string) (map[string]string, error)

func (*ValkeyAdapter) GetMapAsString

func (r *ValkeyAdapter) GetMapAsString(ctx context.Context, variableKey string, hubName string) (string, error)

func (*ValkeyAdapter) GetMetaHashSet added in v0.3.1

func (r *ValkeyAdapter) GetMetaHashSet(ctx context.Context, variableKey string, hubName string) (string, bool, error)

func (*ValkeyAdapter) GetMetaPriorityList added in v0.3.1

func (r *ValkeyAdapter) GetMetaPriorityList(ctx context.Context, variableKey string, hubName string) ([]string, bool, error)

func (*ValkeyAdapter) GetOrCreateMetaHashSet

func (r *ValkeyAdapter) GetOrCreateMetaHashSet(ctx context.Context, variableKey string, hubName string, variableStringKey string, variableSetKey string) (string, bool, error)

func (*ValkeyAdapter) GetOrCreateMetaPriorityList

func (r *ValkeyAdapter) GetOrCreateMetaPriorityList(ctx context.Context, variableKey string, hubName string, variableRefs []string) ([]string, bool, error)

func (*ValkeyAdapter) GetSetAsStringSlice

func (r *ValkeyAdapter) GetSetAsStringSlice(ctx context.Context, variableKey string, hubName string) ([]string, error)

func (*ValkeyAdapter) GetString

func (r *ValkeyAdapter) GetString(ctx context.Context, variableKey string, hubName string) (string, bool, error)

GetString retrieves the string, int and boolean variable. It returns the value, a boolean indicating whether the key was found, and any error encountered.

func (*ValkeyAdapter) IntDecrBy

func (r *ValkeyAdapter) IntDecrBy(variableKey string, hubName string, value int64) valkey.Completed

func (*ValkeyAdapter) IntIncrBy

func (r *ValkeyAdapter) IntIncrBy(variableKey string, hubName string, value int64) valkey.Completed

func (*ValkeyAdapter) RemoveElementFromSet

func (r *ValkeyAdapter) RemoveElementFromSet(variableKey string, hubName string, value string) valkey.Completed

func (*ValkeyAdapter) RemoveMapEntry

func (r *ValkeyAdapter) RemoveMapEntry(variableKey string, hubName string, field string) valkey.Completed

func (*ValkeyAdapter) SetMapEntry

func (r *ValkeyAdapter) SetMapEntry(variableKey string, hubName string, field string, value string) valkey.Completed

func (*ValkeyAdapter) SetString

func (r *ValkeyAdapter) SetString(variableKey string, hubName string, value string) valkey.Completed

type ValkeyAdapterOption

type ValkeyAdapterOption func(*ValkeyAdapter)

func WithValkeyAuditStreamExpiry

func WithValkeyAuditStreamExpiry(expiry time.Duration) ValkeyAdapterOption

Jump to

Keyboard shortcuts

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