client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: Apache-2.0 Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcquireLockOptions

type AcquireLockOptions struct {
	Key           string
	Ttl           int64
	Timeout       time.Duration
	RetryInterval time.Duration
}

type ChunksReader

type ChunksReader struct {
	Client   *EtcdClient
	Key      string
	Index    int64
	Buffer   *bytes.Buffer
	Snapshot keymodels.ChunkedKeySnapshot
}

func (*ChunksReader) Close

func (r *ChunksReader) Close() error

func (*ChunksReader) Read

func (r *ChunksReader) Read(p []byte) (n int, err error)

type EtcdClient

type EtcdClient struct {
	Client         *clientv3.Client
	Retries        uint64
	RequestTimeout time.Duration
}

func Connect

func Connect(opts EtcdClientOptions) (*EtcdClient, error)

func (*EtcdClient) AcquireLock

func (cli *EtcdClient) AcquireLock(opts AcquireLockOptions) (*keymodels.Lock, bool, error)

func (*EtcdClient) ApplyDiffToPrefix

func (cli *EtcdClient) ApplyDiffToPrefix(prefix string, diff keymodels.KeysDiff) error

func (*EtcdClient) Close

func (cli *EtcdClient) Close()

func (*EtcdClient) DeleteChunkedKey

func (cli *EtcdClient) DeleteChunkedKey(key string) error

func (*EtcdClient) DeleteChunkedKeyWithRetries

func (cli *EtcdClient) DeleteChunkedKeyWithRetries(key string, retries uint64) error

func (*EtcdClient) DeleteKey

func (cli *EtcdClient) DeleteKey(key string) error

func (*EtcdClient) DeleteKeyRange

func (cli *EtcdClient) DeleteKeyRange(key string, rangeEnd string) error

func (*EtcdClient) DeletePrefix

func (cli *EtcdClient) DeletePrefix(prefix string) error

func (*EtcdClient) DiffBetweenPrefixes

func (cli *EtcdClient) DiffBetweenPrefixes(srcPrefix string, dstPrefix string) (keymodels.KeysDiff, error)

func (*EtcdClient) DiffPrefixWithMap

func (cli *EtcdClient) DiffPrefixWithMap(prefix string, inputKeys map[string]keymodels.KeyInfo, inputKeysPrefix string, inputIsSource bool) (keymodels.KeysDiff, error)

func (*EtcdClient) GetChunkedKey

func (cli *EtcdClient) GetChunkedKey(key string) (*keymodels.ChunkedKeyPayload, error)

func (*EtcdClient) GetKey

func (cli *EtcdClient) GetKey(key string) (keymodels.KeyInfo, bool, error)

func (*EtcdClient) GetKeyAtRevision

func (cli *EtcdClient) GetKeyAtRevision(key string, revision int64) (keymodels.KeyInfo, bool, error)

func (*EtcdClient) GetKeyRange

func (cli *EtcdClient) GetKeyRange(key string, rangeEnd string) (map[string]keymodels.KeyInfo, int64, error)

func (*EtcdClient) PutChunkedKey

func (cli *EtcdClient) PutChunkedKey(key *keymodels.ChunkedKeyPayload) error

func (*EtcdClient) PutKey

func (cli *EtcdClient) PutKey(key string, val string) error

func (*EtcdClient) ReadLock

func (cli *EtcdClient) ReadLock(key string) (*keymodels.Lock, error)

func (*EtcdClient) ReleaseLock

func (cli *EtcdClient) ReleaseLock(key string) error

func (*EtcdClient) WatchPrefixChanges

func (cli *EtcdClient) WatchPrefixChanges(prefix string, revision int64) <-chan PrefixChangesResult

type EtcdClientOptions

type EtcdClientOptions struct {
	ClientCertPath    string
	ClientKeyPath     string
	CaCertPath        string
	Username          string
	Password          string
	EtcdEndpoints     []string
	ConnectionTimeout time.Duration
	RequestTimeout    time.Duration
	Retries           uint64
}

type PrefixChangesResult

type PrefixChangesResult struct {
	Changes keymodels.KeysDiff
	Error   error
}

Jump to

Keyboard shortcuts

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