kvstore

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(kb *keybase.Keybase, team, namespace string, kv KV) error

Delete deletes a key from the store

func Get

func Get(kb *keybase.Keybase, team, namespace string, kv *KV) error

Get fetches a key from the store

func Keys

func Keys(kb *keybase.Keybase, team, namespace string) ([]string, error)

Keys returns a slice of strings containing all the keys for a namespace

func Namespaces

func Namespaces(kb *keybase.Keybase, team string) ([]string, error)

Namespaces returns a slice of strings containing all the namespaces for a team

func Put

func Put(kb *keybase.Keybase, team, namespace string, kv KV) error

Put writes a key to the store

Types

type KV

type KV struct {
	Key      string
	Value    interface{}
	Revision *int
}

KV holds a key/value pair for use with the kvstore. The Value will be marshaled to and from JSON.

func New

func New(key string, value interface{}, revision int) KV

New returns a KV struct. Passing a negative revision will cause the revision number to be ignored.

Jump to

Keyboard shortcuts

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