Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitConsul ¶
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 ¶
func (h *HealthImpl) Check( ctx context.Context, req *grpc_health_v1.HealthCheckRequest, ) (*grpc_health_v1.HealthCheckResponse, error)
Check 实现健康检查接口,这里直接返回健康状态
func (*HealthImpl) Watch ¶
func (h *HealthImpl) Watch(req *grpc_health_v1.HealthCheckRequest, w grpc_health_v1.Health_WatchServer) error
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
}
Click to show internal directories.
Click to hide internal directories.