Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Log *lg.Logger
Functions ¶
func NewResolver ¶
func NewResolver(endpoints []string, service string, notify chan ServiceInfo) resolver.Builder
NewResolver return resolver builder endpoints example: http://127.0.0.1:2379 http://127.0.0.1:12379 http://127.0.0.1:22379" service is service name notify is service changed notify
Types ¶
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
resolver is the implementaion of grpc.resolve.Builder Resolver 实现grpc的grpc.resolve.Builder接口的Build与Scheme方法
func (*Resolver) Build ¶
func (r *Resolver) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error)
Build to resolver.Resolver 实现grpc.resolve.Builder接口的方法
func (*Resolver) ResolveNow ¶
func (r *Resolver) ResolveNow(rn resolver.ResolveNowOptions)
ResolveNow
type Service ¶
type Service struct { ServiceInfo *ServiceInfo // contains filtered or unexported fields }
func NewService ¶
func NewService(info *ServiceInfo, endpoints []string) (service *Service, err error)
NewService 创建一个注册服务
Click to show internal directories.
Click to hide internal directories.