valkey

package module
v4.0.0-...-9bf4ddf Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ValkeyType represents the storage type as a string value
	ValkeyType = "valkey"
	// ValkeyTagPattern represents the tag pattern to be used as a key in specified storage
	ValkeyTagPattern = "gocache_tag_%s"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ValkeyStore

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

ValkeyStore is a store for Valkey

func NewValkey

func NewValkey(client valkey.Client, options ...lib_store.Option) *ValkeyStore

NewValkey creates a new store to Valkey instance(s)

func (*ValkeyStore) Clear

func (s *ValkeyStore) Clear(ctx context.Context) error

Clear resets all data in the store

func (*ValkeyStore) Delete

func (s *ValkeyStore) Delete(ctx context.Context, key any) error

Delete removes data from Valkey for given key identifier

func (*ValkeyStore) Get

func (s *ValkeyStore) Get(ctx context.Context, key any) (any, error)

Get returns data stored from a given key

func (*ValkeyStore) GetType

func (s *ValkeyStore) GetType() string

GetType returns the store type

func (*ValkeyStore) GetWithTTL

func (s *ValkeyStore) GetWithTTL(ctx context.Context, key any) (any, time.Duration, error)

GetWithTTL returns data stored from a given key and its corresponding TTL

func (*ValkeyStore) Invalidate

func (s *ValkeyStore) Invalidate(ctx context.Context, options ...lib_store.InvalidateOption) error

Invalidate invalidates some cache data in Valkey for given options

func (*ValkeyStore) Set

func (s *ValkeyStore) Set(ctx context.Context, key any, value any, options ...lib_store.Option) error

Set defines data in Valkey for given key identifier

Jump to

Keyboard shortcuts

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