keyvalue

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyStream

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

TODO: maybe move keystream to separate file

func (*KeyStream) Recv

func (k *KeyStream) Recv() (string, error)

type KeyValue

type KeyValue interface {
	// Gets a store instance that refers to the store at the specified path.
	Store(string) Store
}

KeyValue - Idiomatic interface for the nitric Key Value Store Service

func New

func New() (KeyValue, error)

New - Construct a new Key Value Store Client with default options

type ScanKeysOption

type ScanKeysOption = func(*ScanKeysRequest)

func WithPrefix added in v1.0.3

func WithPrefix(prefix string) ScanKeysOption

Apply a prefix to the scan keys request

type ScanKeysRequest added in v1.0.3

type ScanKeysRequest = v1.KvStoreScanKeysRequest

type Store

type Store interface {
	// Name - The name of the store
	Name() string
	// Get a value from the store
	Get(context.Context, string) (map[string]interface{}, error)
	// Set a value in the store
	Set(context.Context, string, map[string]interface{}) error
	// Delete a value from the store
	Delete(context.Context, string) error
	// Return an async iterable of keys in the store
	Keys(context.Context, ...ScanKeysOption) (*KeyStream, error)
}

Jump to

Keyboard shortcuts

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