etcdclient

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAuth

func WithAuth(user string, pass string) func(client *Client)

func WithEndPoints

func WithEndPoints(endPoints ...string) func(client *Client)

func WithTimeout

func WithTimeout(timeout time.Duration) func(client *Client)

Types

type Client

type Client struct {
	clientv3.KV
	clientv3.Watcher
	*clientv3.Client
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *Client

func (*Client) NewMutex

func (this *Client) NewMutex(key string, ttl int) (*Mutex, error)

type Mutex

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

func CreateMutex

func CreateMutex(key string, ttl int, machines []string) (*Mutex, error)

func (*Mutex) Lock

func (this *Mutex) Lock() (err error)

func (*Mutex) RefreshLockTTL

func (this *Mutex) RefreshLockTTL(ttl time.Duration) (err error)

func (*Mutex) Unlock

func (this *Mutex) Unlock() (err error)

type Option

type Option func(client *Client)

Jump to

Keyboard shortcuts

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