etcd

package
v0.0.0-...-9a6ecad Latest Latest
Warning

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

Go to latest
Published: May 1, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package etcd contains core to access ETCD apis both v2 and v3. APIs v2 are not used but it was a good exercise

Package etcd contains all tools to manage etcd client and query an etcd cluster

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GrpcClient

func GrpcClient(tlsCfg SecureCfg, endPoints []string) *clientv3.Client

GrpcClient returns an ETCD TLS ready client

func HTTPClient

func HTTPClient(transport *http.Transport, endPoints string)

HTTPClient instantiate a new etcd client, do nothing for now. Not totally nothing, it puts a key and read it.

func Transport

func Transport(ca string, clientCertificate string, clientCertificateKey string) *http.Transport

Transport instantiate a new https Transport client

Types

type ClientEndpoints

type ClientEndpoints struct {
	Server string
	Ep     []string
	Err    error
}

ClientEndpoints contains all the ETCD cluster members from the client (the cli) point of view

func GetEndPointsFromInitiatedClient

func GetEndPointsFromInitiatedClient(cli *clientv3.Client) []ClientEndpoints

GetEndPointsFromInitiatedClient returns list of endpoints form the client you instantiated.

type ClusterEndpoints

type ClusterEndpoints struct {
	Server string
	Ep     []*etcdserverpb.Member
	Err    error
}

ClusterEndpoints contains all the ETCD cluster members from the cluster point of view

func GetClusterEndpoints

func GetClusterEndpoints(cli *clientv3.Client) []ClusterEndpoints

GetClusterEndpoints returns the list of endpoint configured in the cluster you are querying.

type RaftData

type RaftData struct {
	MemberID  uint64
	RaftIndex uint64
	Err       error
}

RaftData contains the RAFT index data, the member ID and the error returned by member queried

type RaftIndexPerMember

type RaftIndexPerMember map[string]RaftData

RaftIndexPerMember contains the RaftData for every member queried

func GetRaftIndexPerMembers

func GetRaftIndexPerMembers(cli *clientv3.Client) RaftIndexPerMember

GetRaftIndexPerMembers returns a list of RaftIndexPerMember

type SecureCfg

type SecureCfg struct {
	Cert   string
	Key    string
	CaCert string
}

SecureCfg secret object

Jump to

Keyboard shortcuts

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