kv

package
v0.0.0-...-6bdf688 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NameIndexAPIPrefix = "nameidx"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EtcdKV

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

func New

func New(client client.KeysAPI, prefix string) *EtcdKV

func (*EtcdKV) AddToIndex

func (k *EtcdKV) AddToIndex(prefix, name, id string) error

func (*EtcdKV) CreateWithIndex

func (k *EtcdKV) CreateWithIndex(prefix, id, name string, val string) (*client.Node, error)

func (*EtcdKV) Delete

func (k *EtcdKV) Delete(prefix, id string, recursive bool) error

func (*EtcdKV) DeleteFromIndex

func (k *EtcdKV) DeleteFromIndex(prefix, name string) error

func (*EtcdKV) Get

func (k *EtcdKV) Get(prefix, ref string) (*client.Node, error)

func (*EtcdKV) List

func (k *EtcdKV) List(prefix string) ([]*client.Node, error)

func (*EtcdKV) Set

func (k *EtcdKV) Set(prefix, id, val string) (*client.Node, error)

type KV

type KV interface {
	List(prefix string) ([]*client.Node, error)
	CreateWithIndex(prefix, id, name string, val string) (*client.Node, error)

	DeleteFromIndex(prefix, name string) error
	AddToIndex(prefix, name, id string) error

	Set(prefix, id, val string) (*client.Node, error)
	Get(prefix, ref string) (*client.Node, error)
	Delete(prefix, id string, recursive bool) error
}

type NameIndex

type NameIndex struct {
	Prefix string `json:"prefix"`
	Name   string `json:"name"`
	ID     string `json:"id"`
}

Jump to

Keyboard shortcuts

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