memorykv

package
v6.0.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

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

func NewInMemoryDriver

func NewInMemoryDriver(log *slog.Logger, tracer *sdktrace.TracerProvider) *Driver

func (*Driver) Clear

func (d *Driver) Clear(_ context.Context) error

func (*Driver) Delete

func (d *Driver) Delete(ctx context.Context, keys ...string) error

func (*Driver) Get

func (d *Driver) Get(ctx context.Context, key string) ([]byte, error)

func (*Driver) Has

func (d *Driver) Has(ctx context.Context, keys ...string) (map[string]bool, error)

func (*Driver) MExpire

func (d *Driver) MExpire(ctx context.Context, items ...kv.Item) error

MExpire sets the expiration time to the key If key already has the expiration time, it will be overwritten

func (*Driver) MGet

func (d *Driver) MGet(ctx context.Context, keys ...string) (map[string][]byte, error)

func (*Driver) Set

func (d *Driver) Set(ctx context.Context, items ...kv.Item) error

func (*Driver) Stop

func (d *Driver) Stop(_ context.Context)

func (*Driver) TTL

func (d *Driver) TTL(ctx context.Context, keys ...string) (map[string]string, error)

type Item

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

func (*Item) Key

func (i *Item) Key() string

func (*Item) Timeout

func (i *Item) Timeout() string

func (*Item) Value

func (i *Item) Value() []byte

Jump to

Keyboard shortcuts

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