storage

package
v1.28.0-alpha.77 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: MIT Imports: 0 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event interface {
	AddEvent(key string, value []byte)
	UpdateEvent(key string, oldData, curData []byte)
	DeleteEvent(key string, value []byte)
}

Event for callback register

type Locker

type Locker interface {
	Lock() error
	Unlock() error
}

Locker for storage, basic use for pool Delete & IP lease/release

type Storage

type Storage interface {
	GetLocker(path string) (Locker, error)           // get locker with new connection
	Register(path string, data []byte) error         // register self node
	RegisterAndWatch(path string, data []byte) error // register and watch self node
	Add(key string, value []byte) error              // add new node data
	Delete(key string) ([]byte, error)               // delete node
	Update(key string, data []byte) error            // update node data
	Get(key string) ([]byte, error)                  // get node data
	List(key string) ([]string, error)               // list all children nodes
	Exist(key string) (bool, error)                  // check node exist
	Stop()                                           // close connection
}

Storage interface for key/value storage

Directories

Path Synopsis
Package etcd xxx
Package etcd xxx
Package zookeeper xxx
Package zookeeper xxx

Jump to

Keyboard shortcuts

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