memory

package
v0.0.0-...-03ee3a8 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUndefinedKey = errors.New(`undefined key`)
)

Error list...

Functions

This section is empty.

Types

type KVMemory

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

KVMemory accessor to the string `value` by string `key`

func NewKVMemory

func NewKVMemory(lifetime time.Duration) *KVMemory

NewKVMemory object

func (*KVMemory) Get

func (kv *KVMemory) Get(ctx context.Context, key string) (string, error)

Get returns string value of error

func (*KVMemory) Set

func (kv *KVMemory) Set(ctx context.Context, key, value string) error

Set `value` of `key`

func (*KVMemory) TrySet

func (kv *KVMemory) TrySet(ctx context.Context, key, value string) error

TrySet `value` of `key`

Jump to

Keyboard shortcuts

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