etcd

package
v0.0.0-...-5bcacdd Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clientv3Facade

type Clientv3Facade interface {
	clientv3.Cluster
	clientv3.KV
	clientv3.Watcher
	clientv3.Lease
}

Clientv3Facade is a subset of all Etcd client operations that are required to implement an Etcd version of kv.Client

func NewClient

func NewClient(cfg Config) (Clientv3Facade, error)

NewClient makes a new Client.

type Config

type Config struct {
	Endpoints   types.Strings    `yaml:"endpoints" json:"endpoints"`
	DialTimeout types.Duration   `yaml:"dial_timeout" json:"dial_timeout"`
	MaxRetries  int              `yaml:"max_retries" json:"max_retries"`
	EnableTLS   bool             `yaml:"tls_enabled" json:"enable_tls"`
	TLS         commonTls.Config `yaml:",inline"`
	Username    string           `yaml:"username" json:"username"`
	Password    types.Secret     `yaml:"password" json:"password"`
}

Config for a new etcd.Client.

func (*Config) GetTLS

func (cfg *Config) GetTLS() (*tls.Config, error)

GetTLS sets the TLS config field with certs

func (*Config) ParseFlags

func (cfg *Config) ParseFlags(f *flag.FlagSet)

func (*Config) ParseFlagsWithPrefix

func (cfg *Config) ParseFlagsWithPrefix(prefix string, f *flag.FlagSet)

ParseFlagsWithPrefix adds the flags required to config this to the given FlagSet.

Jump to

Keyboard shortcuts

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