kv

package
v0.0.0-...-360a0c1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RestoreFromDump

func RestoreFromDump(kv Store, reader io.Reader) error

func WriteToDump

func WriteToDump(kv Store, writer io.Writer) error

Types

type Credentials

type Credentials struct {
	Token   string
	Project string
}

type Store

type Store interface {
	AtomicInc(key string) (int64, error)
	Delete(key string) error
	Put(key string, value []byte) error
	Fetch(key string) ([]byte, error)
	List(prefix string) ([]string, []byte, error)
}

Store defines an implementation-agnostic key-value storage interface.

func NewInMemoryStore

func NewInMemoryStore() Store

NewInMemoryStore returns a new KV backend using an ephemeral in-memory representation.

func NewRemoteStore

func NewRemoteStore(cred Credentials) Store

NewRemoteStore returns a new storage backend using a managed Valar KV database instance.

Jump to

Keyboard shortcuts

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