Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLocalIP ¶
func NewResolver ¶
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
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 LeaseDruation time.Duration Client *clientv3.Client // contains filtered or unexported fields }
func NewService ¶
func NewService(info ServiceInfo, client *clientv3.Client) *Service
NewService 创建一个注册服务
type ServiceInfo ¶
服务信息
Click to show internal directories.
Click to hide internal directories.