etcd

package
v1.2.11 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownAPILevel = errors.New("unknown etcd api level - must be 2 or 3")

ErrUnknownAPILevel is returned if no valid api level is given

Functions

func New

func New(machines []string, opts ...Option) (easykv.ReadWatcher, error)

New returns an *etcd{2,3}.Client with a connection to named machines.

Types

type BasicAuthOptions

type BasicAuthOptions struct {
	Username string
	Password string
}

BasicAuthOptions contains options regarding to basic authentication.

type Option

type Option func(*Options)

Option configures the etcd client.

func WithBasicAuth

func WithBasicAuth(b BasicAuthOptions) Option

WithBasicAuth enables the basic authentication and sets the username and password.

func WithTLSOptions

func WithTLSOptions(tls TLSOptions) Option

WithTLSOptions sets the TLSOptions.

func WithVersion

func WithVersion(v int) Option

WithVersion sets the etcd api level. Valid levels are 2 and 3.

type Options

type Options struct {
	Nodes   []string
	Version int
	TLS     TLSOptions
	Auth    BasicAuthOptions
}

Options contains all values that are needed to connect to etcd.

type TLSOptions

type TLSOptions struct {
	ClientCert   string
	ClientKey    string
	ClientCaKeys string
}

TLSOptions contains all certificates and keys.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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