Documentation ¶
Overview ¶
@author: mongo
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitResolver ¶
InitResolver returns
Types ¶
type Resource ¶
type Resource struct {
// contains filtered or unexported fields
}
ConsulResource defines resource
func New ¶
func New(cfg *discovery.ServerConfig) (*Resource, error)
@todo 讲依赖声明加到初始化的地方 New returns the point of ConsulResource
func (*Resource) ClaimServices ¶
ClaimServices 声明依赖的服务
func (*Resource) DeregisterService ¶
DeregisterService sign off from consul by defined serviceID
func (Resource) Dial ¶
func (cr Resource) Dial(service string) (*grpc.ClientConn, error)
@todo 设置成单例子?看 gRPC client 代码实现是否处理过了。 DialService sign off from consul by defined serviceID
func (*Resource) WithServiceConfig ¶
func (cr *Resource) WithServiceConfig(cfg *discovery.ServiceConfig)
Click to show internal directories.
Click to hide internal directories.