kv

package
v0.0.0-...-5ee457c Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyNotFound     = fmt.Errorf("kv: not found")
	ErrBackingNotFound = fmt.Errorf("kv: backing not found")
)

Functions

func Register

func Register(constructor KVConstructor, matcher Matcher)

Types

type KV

type KV interface {
	Get(ctx context.Context, key string) (val []byte, err error)
	Put(ctx context.Context, key string, val []byte) (err error)
	Del(ctx context.Context, key string) (deleted bool, err error)
}

type KVConstructor

type KVConstructor func(uri string) (KV, error)

type KVManager

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

func NewKVManager

func NewKVManager() *KVManager

func (*KVManager) Configure

func (m *KVManager) Configure(name string, uri string) error

func (*KVManager) GetKVMapper

func (m *KVManager) GetKVMapper(vm *goja.Runtime, eventLoop *eventloop.EventLoop) *KVMapper

type KVMapper

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

func (*KVMapper) Delete

func (m *KVMapper) Delete(key string) bool

func (*KVMapper) Get

func (m *KVMapper) Get(key string) goja.Value

func (*KVMapper) Has

func (m *KVMapper) Has(key string) bool

func (*KVMapper) Keys

func (m *KVMapper) Keys() []string

func (*KVMapper) NativeObject

func (m *KVMapper) NativeObject() goja.Value

func (*KVMapper) Reset

func (m *KVMapper) Reset()

func (*KVMapper) Set

func (m *KVMapper) Set(key string, val goja.Value) bool

func (*KVMapper) WithIOContext

func (m *KVMapper) WithIOContext(t *common.IOContext)

type Matcher

type Matcher func(uri string) bool

type NativeKVProxy

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

func (*NativeKVProxy) Delete

func (kv *NativeKVProxy) Delete(key string) bool

func (*NativeKVProxy) Get

func (kv *NativeKVProxy) Get(key string) goja.Value

func (*NativeKVProxy) Has

func (kv *NativeKVProxy) Has(key string) bool

func (*NativeKVProxy) Keys

func (kv *NativeKVProxy) Keys() []string

func (*NativeKVProxy) NativeObject

func (kv *NativeKVProxy) NativeObject() goja.Value

func (*NativeKVProxy) Set

func (kv *NativeKVProxy) Set(key string, val goja.Value) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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