Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ETCDRegistry ¶
type ETCDRegistry struct {
// contains filtered or unexported fields
}
ETCDRegistry for grpc server
func (*ETCDRegistry) GetServices ¶
func (r *ETCDRegistry) GetServices() ([]*runtime.ServiceDesc, error)
func (*ETCDRegistry) Register ¶
func (r *ETCDRegistry) Register(srvInfo *runtime.ServiceDesc) error
ETCDRegistry a service
func (*ETCDRegistry) Unregister ¶
func (r *ETCDRegistry) Unregister() error
Unregister stop register
type ETCDResolver ¶
type ETCDResolver struct { EtcdAddrs []string DialTimeout int // contains filtered or unexported fields }
ETCDResolver for grpc client
用于实现基于ETCD的负载均衡
func NewResolver ¶
func NewResolver(etcdAddrs []string, logger *zap.Logger) *ETCDResolver
NewResolver create a new resolver.Builder base on etcd
func (*ETCDResolver) Build ¶
func (r *ETCDResolver) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error)
Build creates a new resolver.Resolver for the given target
func (*ETCDResolver) ResolveNow ¶
func (r *ETCDResolver) ResolveNow(o resolver.ResolveNowOptions)
ResolveNow resolver.Resolver interface
func (*ETCDResolver) Scheme ¶
func (r *ETCDResolver) Scheme() string
Scheme returns the scheme supported by this resolver.
Click to show internal directories.
Click to hide internal directories.