etcd

package
Version: v0.0.0-...-632f8f1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterClientService

func RegisterClientService(name, ip string, endpoints []string)

func RegisterEtcdService

func RegisterEtcdService(endpoints []string)

Types

type Client

type Client interface {
	HeartBeat()
}

type ClientInfo

type ClientInfo struct {
	Name string
	Ip   string
	Pid  int
}

type ClientService

type ClientService struct {
	KeyApi client.KeysAPI
	Name   string
	Ip     string
}

func (*ClientService) HeartBeat

func (c *ClientService) HeartBeat()

type EtcdService

type EtcdService struct {
	KeyApi client.KeysAPI
	Peers  map[string]*Peers
	Lock   sync.Mutex
}

func (*EtcdService) Add

func (e *EtcdService) Add(peers *Peers)

func (*EtcdService) Remove

func (e *EtcdService) Remove(peers *Peers)

func (*EtcdService) Update

func (e *EtcdService) Update(peers *Peers)

func (*EtcdService) Watch

func (e *EtcdService) Watch()

type Peers

type Peers struct {
	Pid  int
	Ip   string
	Name string
}

func RespNodeToPeers

func RespNodeToPeers(node *client.Node) *Peers

type Service

type Service interface {
	Add(peers *Peers)
	Update(peers *Peers)
	Remove(peers *Peers)
	Watch()
}

Source Files

Jump to

Keyboard shortcuts

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