etcd

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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

Jump to

Keyboard shortcuts

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