xjregister

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServiceReg

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

创建租约注册服务

func NewServiceReg

func NewServiceReg(addr []string, timeNum int64) *ServiceReg

func NewServiceRegister

func NewServiceRegister(etcd xjtypes.Etcd) *ServiceReg

func (*ServiceReg) ListenLeaseRespChan

func (this *ServiceReg) ListenLeaseRespChan()

监听 续租情况

func (*ServiceReg) PutRpc added in v0.3.7

func (this *ServiceReg) PutRpc(key, val string) error

通过租约 注册rpc服务

func (*ServiceReg) PutService

func (this *ServiceReg) PutService(key, val string) error

通过租约 注册服务

func (*ServiceReg) RegisterService

func (this *ServiceReg) RegisterService(app xjtypes.App) error

func (*ServiceReg) RevokeLease

func (this *ServiceReg) RevokeLease() error

撤销租约

type Val

type Val struct {
	StartTime  string
	UpdateTime string
	Status     int    //状态:1正常 2下线
	Weight     int    //权重:默认为1
	Metatata   string //元数据
	Health     int    //健康状态:1健康 2不健康 3更不健康 ,数值越大越不健康
}

Jump to

Keyboard shortcuts

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