pketcd

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EtcdClient

type EtcdClient struct {
	Kv clientv3.KV
	// contains filtered or unexported fields
}

func NewEtcdClient

func NewEtcdClient(config clientv3.Config) (*EtcdClient, error)

func (*EtcdClient) GetClient added in v1.0.1

func (cli *EtcdClient) GetClient() *clientv3.Client

func (*EtcdClient) Locker

func (cli *EtcdClient) Locker(ctx context.Context, lockKey string, leaseTtl int64) (bool, error)

func (*EtcdClient) SetNx

func (cli *EtcdClient) SetNx(ctx context.Context, key, value string, ops ...clientv3.OpOption) (int, error)

func (*EtcdClient) SvcDiscover

func (cli *EtcdClient) SvcDiscover(ctx context.Context, prefixKey string, whenGet func(string, string), whenDel func(string, string)) error

func (*EtcdClient) SvcRegister

func (cli *EtcdClient) SvcRegister(ctx context.Context, prefixKey string, value string, leaseTtl int64) error

func (*EtcdClient) Unlocker

func (cli *EtcdClient) Unlocker(ctx context.Context, lockKey string) error

Jump to

Keyboard shortcuts

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