etcd

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogLevel

func SetLogLevel(level log.Level)

SetLogLevel sets the log level for the logger SetLogLevel is safe to be called concurrently

Types

type Node

type Node struct {
	ID      string            `json:"id"`
	Name    string            `json:"name"`
	Host    string            `json:"host"`
	Address string            `json:"address"`
	Port    int               `json:"port"`
	Kinds   []string          `json:"kinds"`
	Meta    map[string]string `json:"-"`
	Alive   bool              `json:"alive"`
}

func NewNode

func NewNode(name, host string, port int, kinds []string) *Node

func NewNodeFromBytes

func NewNodeFromBytes(data []byte) (*Node, error)

func (*Node) Deserialize

func (n *Node) Deserialize(data []byte) error

func (*Node) Equal

func (n *Node) Equal(other *Node) bool

func (*Node) GetAddress

func (n *Node) GetAddress() (host string, port int)

func (*Node) GetMeta

func (n *Node) GetMeta(name string) (string, bool)

func (*Node) IsAlive

func (n *Node) IsAlive() bool

func (*Node) MemberStatus

func (n *Node) MemberStatus() *cluster.Member

func (*Node) Serialize

func (n *Node) Serialize() ([]byte, error)

func (*Node) SetAlive

func (n *Node) SetAlive(alive bool)

func (*Node) SetMeta

func (n *Node) SetMeta(name string, val string)

type Provider

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

func New

func New() (*Provider, error)

func NewWithConfig

func NewWithConfig(baseKey string, cfg clientv3.Config) (*Provider, error)

func (*Provider) GetHealthStatus

func (p *Provider) GetHealthStatus() error

GetHealthStatus returns an error if the cluster health status has problems

func (*Provider) Shutdown

func (p *Provider) Shutdown(graceful bool) error

func (*Provider) StartClient

func (p *Provider) StartClient(c *cluster.Cluster) error

func (*Provider) StartMember

func (p *Provider) StartMember(c *cluster.Cluster) error

func (*Provider) UpdateClusterState

func (p *Provider) UpdateClusterState(state cluster.ClusterState) error

Jump to

Keyboard shortcuts

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