cache

package
v0.0.0-...-7815854 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Get(ctx context.Context, key string) (string, error)
	Set(ctx context.Context, key, value string) error
	Delete(ctx context.Context, key string) error
	GetKeys(ctx context.Context, pattern string) ([]string, error)
	SetWithExpiry(ctx context.Context, key, value string, expiresAt time.Time) error
	SetWithTTL(ctx context.Context, key, value string, ttl time.Duration) error
	SetNXWithTTL(ctx context.Context, key, value string, ttl time.Duration) (bool, error)
	LoadScript(ctx context.Context, script string) (string, error)
	SetManyWithExpiry(ctx context.Context, items map[string]string, expiresAt time.Time) error
	ZIncrBy(ctx context.Context, key string, increment float64, member string) error
	ZAdd(ctx context.Context, key string, members map[string]float64) error
	ZRevRangeWithScores(ctx context.Context, key string, start, stop int64) ([]*ZRangeItem, error)
	ZCard(ctx context.Context, key string) (int64, error)
	ZRevRank(ctx context.Context, key string, member string) (int64, error)
	ZScore(ctx context.Context, key string, member string) (float64, error)
	Close()
}

func NewClient

func NewClient(ctx context.Context, client valkey.Client) (Cache, error)

type ZRangeItem

type ZRangeItem struct {
	Member string
	Score  float64
}

Jump to

Keyboard shortcuts

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