Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Consul ¶
type Consul struct { Config *Config // 配置对象 // contains filtered or unexported fields }
Consul consul核心对象
func (*Consul) GetGrpcClientConn ¶
func (c *Consul) GetGrpcClientConn(serviceName string) (*grpc.ClientConn, error)
GetGrpcClientConn 获取GRPC的客户端连接 @param serviceName,consul中的grpc服务名称
func (*Consul) RegisterGrpc ¶ added in v0.1.2
func (c *Consul) RegisterGrpc(config ServiceConfig) error
RegisterGrpc 注册Grpc微服务到consul @param host 地址 @param port 端口号 @param name 名称 @param id ID @param tags 标签列表 @param isGrpc 是否为grpc
func (*Consul) RegisterHTTP ¶ added in v0.1.2
RegisterHTTP 注册HTTP服务
type DeregisterHTTPConfig ¶ added in v0.1.2
type DeregisterHTTPConfig struct { ConsulHost string // consul主机地址 ConsulPort uint16 // consul端口号 ServerId string // 服务id }
DeregisterHTTPConfig 注销http服务的配置
Click to show internal directories.
Click to hide internal directories.