registry

package
v0.0.0-...-854a178 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HttpReg

func HttpReg(svrName string, ipAddr string, port int) string

HttpReg 服务注册时候提供一个健康检查地址,支持http,grpc

func HttpUnReg

func HttpUnReg(svrID string)

HttpUnReg 服务卸载

func InitConsul

func InitConsul(consulIp string, consulPort int) (err error)

func RandomStr

func RandomStr(len int) string

Types

type ConsulRegistry

type ConsulRegistry struct {
}

func (ConsulRegistry) ServerDiscover

func (cr ConsulRegistry) ServerDiscover(serverName string) (ServerMataInfo, error)

func (ConsulRegistry) ServerRegistry

func (cr ConsulRegistry) ServerRegistry(ServerMataInfo) error

type HealthImpl

type HealthImpl struct{}

HealthImpl 健康检查实现

func (*HealthImpl) Check

Check 实现健康检查接口,这里直接返回健康状态

func (*HealthImpl) Watch

Watch 让HealthImpl实现RegisterHealthServer内部的interface接口

type Registry

type Registry interface {
	ServerRegistry(ServerMataInfo) error
	ServerDiscover(serverName string) (ServerMataInfo, error)
}

type ServerMataInfo

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

Jump to

Keyboard shortcuts

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