etcd

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(config *hit.Config) *Client

func (*Client) Close

func (c *Client) Close()

Close 优雅关闭etcd

func (*Client) GetLocalAllNodes

func (c *Client) GetLocalAllNodes() map[string]backend.Nodor

GetLocalAllNodes 获取当前本地所以节点

func (*Client) Log

func (c *Client) Log(format string, v ...interface{})

Log 记录日志

func (*Client) PickNode

func (c *Client) PickNode(key string) (backend.Nodor, bool)

PickNode 为当前key选取一个合适的远程节点

func (*Client) PullAllNodes

func (c *Client) PullAllNodes() ([]string, error)

PullAllNodes 拉取所有节点

func (*Client) PullNodes

func (c *Client) PullNodes(prefix string) ([]string, error)

PullNodes 拉取指定prefix节点

type Node

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

远程节点

func NewNode

func NewNode(url string) *Node

func (*Node) Del

func (h *Node) Del(in *pb.DelRequest, out *pb.DelResponse) error

func (*Node) Get

func (h *Node) Get(in *pb.GetRequest, out *pb.GetResponse) error

从远程节点获取数据

func (*Node) Set

func (h *Node) Set(in *pb.SetRequest, out *pb.SetResponse) error

func (*Node) Url

func (h *Node) Url() string

获取远程节点地址

Jump to

Keyboard shortcuts

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