etcdops

package
v0.0.0-...-96d2ce7 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EtcdKVS

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

func NewKvStore

func NewKvStore(dockerOps *dockerops.DockerOps) *EtcdKVS

NewKvStore function: start or join ETCD cluster depending on the role of the node

func (*EtcdKVS) AtomicDecr

func (e *EtcdKVS) AtomicDecr(key string) error

AtomicDecr - Decrease a key value by 1

func (*EtcdKVS) AtomicIncr

func (e *EtcdKVS) AtomicIncr(key string) error

AtomicIncr - Increase a key value by 1

func (*EtcdKVS) BlockingWaitAndGet

func (e *EtcdKVS) BlockingWaitAndGet(key string, value string, newKey string) (string, error)

BlockingWaitAndGet - Blocking wait until a key value becomes equal to a specific value then read the value of another key

func (*EtcdKVS) CompareAndPut

func (e *EtcdKVS) CompareAndPut(key string, oldVal string, newVal string) bool

CompareAndPut function: compare the value of the kay with oldVal if equal, replace with newVal and return true; or else, return false.

func (*EtcdKVS) CompareAndPutIfNotEqual

func (e *EtcdKVS) CompareAndPutIfNotEqual(key string, newVal string) (bool, error)

CompareAndPutIfNotEqual - Compare and put a new value of the key if the current value is not equal to the new value

func (*EtcdKVS) CompareAndPutOrFetch

func (e *EtcdKVS) CompareAndPutOrFetch(key string,
	oldVal string,
	newVal string) (*etcdClient.TxnResponse, error)

CompareAndPutOrFetch - Compare and put or get the current value of the key

func (*EtcdKVS) CompareAndPutStateOrBusywait

func (e *EtcdKVS) CompareAndPutStateOrBusywait(key string, oldVal string, newVal string) bool

CompareAndPutStateOrBusywait function: compare the volume state with oldVal if equal, replace with newVal and return true; or else, return false; waits if volume is in a state from where it can reach the ready state

func (*EtcdKVS) CreateLock

func (e *EtcdKVS) CreateLock(name string) (kvstore.KvLock, error)

CreateLock: create a ETCD lock for a given key, only setup the client session and mutex should be create when start to use the lock

func (*EtcdKVS) DeleteClientMetaData

func (e *EtcdKVS) DeleteClientMetaData(name string, nodeID string) error

DeleteClientMetaData - Delete volume client metadata in KV store

func (*EtcdKVS) DeleteMetaData

func (e *EtcdKVS) DeleteMetaData(name string) error

DeleteMetaData - Delete volume metadata in KV store

func (*EtcdKVS) KvMapFromPrefix

func (e *EtcdKVS) KvMapFromPrefix(prefix string) (map[string]string, error)

KvMapFromPrefix - Create key-value pairs according to a given prefix

func (*EtcdKVS) List

func (e *EtcdKVS) List(prefix string) ([]string, error)

List function lists all the different portion of keys with the given prefix

func (*EtcdKVS) ReadMetaData

func (e *EtcdKVS) ReadMetaData(keys []string) ([]kvstore.KvPair, error)

ReadMetaData - Read metadata in KV store

func (*EtcdKVS) UpdateMetaData

func (e *EtcdKVS) UpdateMetaData(entries []kvstore.KvPair) ([]kvstore.KvPair, error)

UpdateMetaData - Read/Write/Delete metadata according to given key-value pairs

func (*EtcdKVS) WriteMetaData

func (e *EtcdKVS) WriteMetaData(entries []kvstore.KvPair) error

WriteMetaData - Update or Create metadata in KV store

type EtcdLock

type EtcdLock struct {
	// Key for this lock
	Key string
	// contains filtered or unexported fields
}

func (*EtcdLock) BlockingLockWithLease

func (e *EtcdLock) BlockingLockWithLease() error

BlockingLockWithLease: blocking wait to get a ETCD mutex on the given name until timeout

func (*EtcdLock) ClearLock

func (e *EtcdLock) ClearLock()

ClearLock: stop the client/session with the lock

func (*EtcdLock) ReleaseLock

func (e *EtcdLock) ReleaseLock()

ReleaseLock: try to release a lock

func (*EtcdLock) TryLock

func (e *EtcdLock) TryLock() error

TryLock: try to get a ETCD mutex lock

type VFileVolConnectivityData

type VFileVolConnectivityData struct {
	Port        int    `json:"port,omitempty"`
	ServiceName string `json:"serviceName,omitempty"`
	Username    string `json:"username,omitempty"`
	Password    string `json:"password,omitempty"`
}

VFileVolConnectivityData - Contains metadata of vFile volumes

Jump to

Keyboard shortcuts

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