key_value

package
v0.9.4-RC02 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEntryNotFound        = errors.New("not exists by key")
	ErrCounterLimitExceeded = errors.New("counter limit exceeded")
)

Functions

This section is empty.

Types

type IKeyValue

type IKeyValue interface {
	Get(ctx context.Context, key string) (KeyValueResult, error)
	Set(ctx context.Context, key string, value interface{}, expiration time.Duration) error
	Delete(ctx context.Context, key string) error
	IncrementCounterWithLimit(ctx context.Context, key string, counterMax int64, ttl time.Duration) error
	Close() error
}

func NewInMemory

func NewInMemory() IKeyValue

func NewRedisStorage

func NewRedisStorage(client *redis.Client) IKeyValue

type KeyValueResult

type KeyValueResult []byte

func (KeyValueResult) Bytes

func (o KeyValueResult) Bytes() []byte

func (KeyValueResult) String

func (o KeyValueResult) String() string

Jump to

Keyboard shortcuts

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