kvclient

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DecodeOption

type DecodeOption interface {
	Apply(c *mapstructure.DecoderConfig)
}

func WithUnknownKeys

func WithUnknownKeys(allow bool) DecodeOption

type KVClient

type KVClient interface {
	GetKey(collection string, key string) (map[string]interface{}, error)
	DecodeKey(collection string, key string, output interface{}, opts ...DecodeOption) error
	PutKey(collection string, key string, value map[string]interface{}) error
	DeleteKey(collection string, key string) error
}

func NewKVClient

func NewKVClient(conn *grpc.ClientConn) KVClient

func NewWithClient

func NewWithClient(client v1.KeyValueClient) KVClient

type NitricKVClient

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

func (NitricKVClient) DecodeKey

func (d NitricKVClient) DecodeKey(collection string, key string, output interface{}, opts ...DecodeOption) error

DecodeKey - retrieves a value and decodes its contents into the given Go interface{}

internally this method calls GetKey then decodes the map[string]interface{} into the supplied interface{}

this method helps parse the types of value represented by structs.

func (NitricKVClient) DeleteKey

func (d NitricKVClient) DeleteKey(collection string, key string) error

DeleteKey - deletes an existing key from the kv store

func (NitricKVClient) GetKey

func (d NitricKVClient) GetKey(collection string, key string) (map[string]interface{}, error)

GetKey - retrieve an existing value from the kv store

func (NitricKVClient) PutKey

func (d NitricKVClient) PutKey(collection string, key string, value map[string]interface{}) error

PutKey - updates the value of an existing key in the kv store

Jump to

Keyboard shortcuts

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