etcd

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DialKeepAlive = 3 * time.Second
	DialTimeout   = 3 * time.Second
)
View Source
const (
	EventDel = "DELETE"
	EventPut = "PUT"
)
View Source
const (
	TTLDuration = 30 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	CACert        string
	CertFile      string
	DialKeepAlive time.Duration
	DialOptions   []grpc.DialOption
	DialTimeout   time.Duration
	KeyFile       string
	Password      string
	Username      string
}

func DefaultConfig

func DefaultConfig() *Config

type Etcd

type Etcd interface {
	Register(key, val string, ttl time.Duration) error
	Deregister(key string) error

	Watch(prefix string, ch chan map[string]string) error
	Dewatch(prefix string) error

	GetEntries(prefix string) ([]string, error)
	LeaseID() int64
}

func New

func New(ctx context.Context, endpoints []string, config *Config) Etcd

Jump to

Keyboard shortcuts

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