etcd

package
v0.9.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Copyright 2020 Mirantis, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckEtcdReady

func CheckEtcdReady(certDir string, etcdCertDir string) error

CheckEtcdReady returns true if etcd responds to the metrics endpoint with a status code of 200

Types

type Client

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

Client is our internal helper to access some of the etcd APIs

func NewClient

func NewClient(certDir string, etcdCertDir string) (*Client, error)

NewClient creates new Client

func (*Client) AddMember

func (c *Client) AddMember(ctx context.Context, name, peerAddress string) ([]string, error)

AddMember add new member to etcd cluster

func (*Client) Close

func (c *Client) Close()

Close closes the etcd client

func (*Client) DeleteMember

func (c *Client) DeleteMember(ctx context.Context, peerID uint64) error

DeleteMember deletes member by peer name

func (*Client) GetPeerIDByAddress

func (c *Client) GetPeerIDByAddress(ctx context.Context, peerAddress string) (uint64, error)

GetPeerIDByAddress looks up peer id by peer url

func (*Client) ListMembers

func (c *Client) ListMembers(ctx context.Context) (map[string]string, error)

ListMembers gets a list of current etcd members

Jump to

Keyboard shortcuts

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