Documentation ¶
Index ¶
- Constants
- Variables
- func BuildCtxFilter(ctx context.Context, data map[string]string) context.Context
- func GetNodeInfo(attr resolver.Address) *register.Options
- func NewDiscovery(opt ...ClientOptions) (resolver.Builder, error)
- func SetNodeInfo(addr resolver.Address, hInfo *register.Options) resolver.Address
- type ClientOptions
- type Discovery
- func (d *Discovery) AddNode(key, val []byte) error
- func (d *Discovery) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error)
- func (s *Discovery) Close()
- func (d *Discovery) DelNode(key []byte) error
- func (d *Discovery) GetAddress() []resolver.Address
- func (s *Discovery) ResolveNow(rn resolver.ResolveNowOptions)
- func (d *Discovery) Scheme() string
- type NodeArray
- type Options
Constants ¶
View Source
const CustomizeLB = "customize"
Variables ¶
View Source
var ErrLoadBalancingPolicy = errors.New("LoadBalancingPolicy is empty or not supported")
View Source
var ErrNoMatchFoundConn = errors.New("no match found conn")
View Source
var ErrNotGetRightConn = errors.New("did not get the right conn")
Functions ¶
func BuildCtxFilter ¶
func NewDiscovery ¶
func NewDiscovery(opt ...ClientOptions) (resolver.Builder, error)
Types ¶
type ClientOptions ¶
type ClientOptions func(*Options)
func SetEtcdConf ¶
func SetEtcdConf(conf clientv3.Config) ClientOptions
func SetLoadBalancingPolicy ¶
func SetLoadBalancingPolicy(name string) ClientOptions
func SetName ¶
func SetName(name string) ClientOptions
func SetVersion ¶
func SetVersion(version string) ClientOptions
type Discovery ¶
func (*Discovery) Build ¶
func (d *Discovery) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error)
Build 当调用`grpc.Dial()`时执行
func (*Discovery) GetAddress ¶
func (*Discovery) ResolveNow ¶
func (s *Discovery) ResolveNow(rn resolver.ResolveNowOptions)
Click to show internal directories.
Click to hide internal directories.