etcd

package
Version: v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PodManifestsHaveTLS

func PodManifestsHaveTLS(ManifestDir string) (bool, error)

PodManifestsHaveTLS reads the etcd staticpod manifest from disk and returns false if the TLS flags are missing from the command list. If all the flags are present it returns true.

Types

type Client

type Client interface {
	GetStatus() (*clientv3.StatusResponse, error)
	WaitForStatus(delay time.Duration, retries int, retryInterval time.Duration) (*clientv3.StatusResponse, error)
	HasTLS() bool
}

Client is an interface to get etcd cluster related information

type GenericClient

type GenericClient struct {
	Endpoints []string
	TLSConfig *tls.Config
}

GenericClient is a common etcd client for supported etcd servers

func NewClient

func NewClient(endpoints []string, caFile string, certFile string, keyFile string) (*GenericClient, error)

NewClient creates a new EtcdCluster client

func NewStaticPodClient

func NewStaticPodClient(endpoints []string, manifestDir string, certificatesDir string) (*GenericClient, error)

NewStaticPodClient creates a GenericClient from the given endpoints, manifestDir, and certificatesDir

func (GenericClient) GetStatus

func (c GenericClient) GetStatus() (*clientv3.StatusResponse, error)

GetStatus gets server status

func (GenericClient) HasTLS

func (c GenericClient) HasTLS() bool

HasTLS returns true if etcd is configured for TLS

func (GenericClient) WaitForStatus

func (c GenericClient) WaitForStatus(delay time.Duration, retries int, retryInterval time.Duration) (*clientv3.StatusResponse, error)

WaitForStatus returns a StatusResponse after an initial delay and retry attempts

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto