etcd

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2020 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromYaml

func FromYaml(c []byte) (types.Resource, error)

FromYaml allows to restore cluster state from YAML.

Types

type Cluster

type Cluster struct {
	// User-configurable fields.
	Image         string            `json:"image" yaml:"image"`
	SSH           *ssh.Config       `json:"ssh" yaml:"ssh"`
	CACertificate types.Certificate `json:"caCertificate" yaml:"caCertificate"`
	Members       map[string]Member `json:"members" yaml:"members"`

	// Serializable fields.
	State container.ContainersState `json:"state" yaml:"state"`
}

Cluster represents etcd cluster configuration and state from the user.

func (*Cluster) New

func (c *Cluster) New() (types.Resource, error)

New validates etcd cluster configuration and fills members with default and computed values.

func (*Cluster) Validate

func (c *Cluster) Validate() error

Validate validates Cluster configuration.

type Member

type Member struct {
	Name              string            `json:"name" yaml:"name"`
	Image             string            `json:"image" yaml:"image"`
	Host              host.Host         `json:"host" yaml:"host"`
	CACertificate     types.Certificate `json:"caCertificate" yaml:"caCertificate"`
	PeerCertificate   types.Certificate `json:"peerCertificate" yaml:"peerCertificate"`
	PeerKey           types.PrivateKey  `json:"peerKey" yaml:"peerKey"`
	PeerAddress       string            `json:"peerAddress" yaml:"peerAddress"`
	InitialCluster    string            `json:"initialCluster" yaml:"initialCluster"`
	PeerCertAllowedCN string            `json:"peerCertAllowedCN" yaml:"peerCertAllowedCN"`
	ServerCertificate types.Certificate `json:"serverCertificate" yaml:"serverCertificate"`
	ServerKey         types.PrivateKey  `json:"serverKey" yaml:"serverKey"`
	ServerAddress     string            `json:"serverAddress" yaml:"serverAddress"`
}

Member represents single etcd member

func (*Member) New

func (m *Member) New() (container.ResourceInstance, error)

New valides Member configuration and returns it's usable version

func (*Member) Validate

func (m *Member) Validate() error

Validate validates etcd member configuration TODO add validation of certificates if specified

Jump to

Keyboard shortcuts

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