etcd

package
v0.0.0-...-1d9db5a Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudAPI

type CloudAPI interface {
	// GetInstances returns all the non-terminated instances that will be part of the etcd cluster.
	GetInstances() ([]cloud.Instance, error)
}

CloudAPI returns the cloud instances in the cluster.

type ClusterAPI

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

ClusterAPI represents an etcd cluster API.

func New

func New(cloudAPI CloudAPI, opts ...Option) (*ClusterAPI, error)

New returns a cluster object for interacting with the etcd cluster API.

func (*ClusterAPI) AddMemberByPeerURL

func (c *ClusterAPI) AddMemberByPeerURL(peerURL string) error

AddMemberByPeerURL adds a new member to the cluster by its peer URL. etcd bootstraps by requiring the peer URL to be first added. Then the new node informs etcd of its name.

func (*ClusterAPI) Members

func (c *ClusterAPI) Members() ([]Member, error)

Members returns the cluster members.

func (*ClusterAPI) RemoveMemberByName

func (c *ClusterAPI) RemoveMemberByName(name string) error

RemoveMemberByName removes a member of the cluster by its name.

type Member

type Member struct {
	Name    string
	PeerURL string
}

Member represents a node in the etcd cluster.

type Option

type Option func(c *ClusterAPI) error

Option for New.

func WithTLS

func WithTLS(peerCA, peerCert, peerKey string) Option

WithTLS enables TLS for talking to the etcd cluster. It requires the locations of the peer certificates.

Jump to

Keyboard shortcuts

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