storage

package
v0.0.0-...-65cb45b Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyExists   = errors.New("object already exists")
	ErrDoesNotExist    = errors.New("object does not exist")
	ErrNodeInvalidName = errors.New("invalid node name")
)

errors

Functions

func CloseDatabase

func CloseDatabase(db *Etcd)

CloseDatabase close the database

func Delete

func Delete(db *Etcd, key string) (*clientv3.DeleteResponse, error)

Delete

func DeleteWithPrefix

func DeleteWithPrefix(db *Etcd, key string) (bool, error)

Delete key with prefix

func Get

func Get(db *Etcd, key string) (*clientv3.GetResponse, error)

Query key

func GetDevCountForNodeID

func GetDevCountForNodeID(db *Etcd, nodeid string) (int, error)

func GetWithPrefix

func GetWithPrefix(db *Etcd, prefix string) (*clientv3.GetResponse, error)

Query keys with Prefix

func Put

func Put(db *Etcd, key, val string) error

Write key-value

Types

type Etcd

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

func OpenDatabase

func OpenDatabase(c *cli.Context) (*Etcd, error)

OpenDatabase opens the database

Jump to

Keyboard shortcuts

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