client

package
v0.0.0-...-395cfcb Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetServiceInfo

func GetServiceInfo(ev *clientv3.Event) *server.ServiceInfo

GetServiceInfo get service info message

Types

type Master

type Master struct {
	Path   string
	Nodes  map[string]*Node
	Client *clientv3.Client
	sync.Mutex
}

Master master node message

func NewMaster

func NewMaster(endpoints []string, watchPath string) (*Master, error)

NewMaster init the struct

func (*Master) AddNode

func (m *Master) AddNode(key string, info *server.ServiceInfo)

AddNode add node message into the map

func (*Master) WatchNodes

func (m *Master) WatchNodes()

WatchNodes watch node message

type Node

type Node struct {
	State bool
	Key   string
	Info  *server.ServiceInfo
}

Node node message

Jump to

Keyboard shortcuts

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