etcd

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

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

Go to latest
Published: May 25, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateConf

func GenerateConf(w io.Writer, mylrn int, lrns []int) error

GenerateConf generates etcd.conf.yml from template.

func GenerateConfForAdd

func GenerateConfForAdd(w io.Writer, mylrn int, members []*etcdserverpb.Member) error

GenerateConfForAdd generates etcd.conf.yml from template to add a new member.

func GenerateService

func GenerateService(w io.Writer, rt neco.ContainerRuntime) error

GenerateService generate systemd service unit contents.

func InstallTools

func InstallTools(ctx context.Context, rt neco.ContainerRuntime) error

InstallTools install etcdctl under /usr/local/bin.

func Setup

func Setup(ctx context.Context, rt neco.ContainerRuntime, generator func(io.Writer) error) (*clientv3.Client, error)

Setup installs and starts etcd. It returns etcd client connected to etcd server running on localhost.

func UpdateNecoConfig

func UpdateNecoConfig(lrns []int) error

UpdateNecoConfig updates /etc/neco/config.yml.

func UserAdd

func UserAdd(ctx context.Context, ec *clientv3.Client, name, prefix string) error

UserAdd adds a user to etcd.

If prefix is empty, the user will have "root" role.

Otherwise, the user will have a role whose name is the same as the user, and grants read-write access under prefix.

func WaitEtcdForVault

func WaitEtcdForVault(ctx context.Context) (*clientv3.Client, error)

WaitEtcdForVault waits for etcd cluster to stabilize. It returns etcd client connected to etcd server running on localhost.

Types

This section is empty.

Jump to

Keyboard shortcuts

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