client

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

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	// Data the payload to save
	Data []byte
	// Version is required when this is an update
	Version uint64
	// contains filtered or unexported fields
}

Entry in the k/v store

type KvStore

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

KvStore wraps the swagger client for central handling of error cases etc

func New

func New(uri string) (*KvStore, error)

New client for the kv store api

func (*KvStore) Delete

func (k *KvStore) Delete(key string) error

Delete an entry from the store

func (*KvStore) FindKeys

func (k *KvStore) FindKeys(prefix string) ([]string, error)

FindKeys for a given prefix

func (*KvStore) Get

func (k *KvStore) Get(key string, version uint64) (*Entry, error)

Get a value from the store, when the version not 0 it will use that to get a not modified response.

func (*KvStore) Put

func (k *KvStore) Put(key string, data *Entry) error

Put an entry in the k/v store

Jump to

Keyboard shortcuts

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