Documentation ¶
Index ¶
- Constants
- Variables
- func GetNodeInfo(attr resolver.Address) *register.Options
- func NewUsageLB(opt ...ClientOptions) (resolver.Builder, error)
- func SetNodeInfo(addr resolver.Address, hInfo *register.Options) resolver.Address
- type ClientOptions
- type NodeArray
- type Opt
- type Options
- type ULBPicker
- type ULbPickerBuild
- type UsageLBConf
- func (d *UsageLBConf) AddNode(key, val []byte) error
- func (d *UsageLBConf) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error)
- func (s *UsageLBConf) Close()
- func (d *UsageLBConf) DelNode(key []byte) error
- func (d *UsageLBConf) GetAddress() []resolver.Address
- func (s *UsageLBConf) ResolveNow(rn resolver.ResolveNowOptions)
- func (d *UsageLBConf) Scheme() string
Constants ¶
View Source
const UsageLB = "usageLB"
Variables ¶
View Source
var ErrLoadBalancingPolicy = errors.New("LoadBalancingPolicy is empty or not apply")
Functions ¶
func NewUsageLB ¶
func NewUsageLB(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
type ULBPicker ¶
type ULBPicker struct {
// contains filtered or unexported fields
}
type ULbPickerBuild ¶
type ULbPickerBuild struct {
// contains filtered or unexported fields
}
func (*ULbPickerBuild) Build ¶
func (r *ULbPickerBuild) Build(info base.PickerBuildInfo) balancer.Picker
type UsageLBConf ¶
func (*UsageLBConf) AddNode ¶
func (d *UsageLBConf) AddNode(key, val []byte) error
func (*UsageLBConf) Build ¶
func (d *UsageLBConf) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error)
Build 当调用`grpc.Dial()`时执行
func (*UsageLBConf) Close ¶
func (s *UsageLBConf) Close()
func (*UsageLBConf) DelNode ¶
func (d *UsageLBConf) DelNode(key []byte) error
func (*UsageLBConf) GetAddress ¶
func (d *UsageLBConf) GetAddress() []resolver.Address
func (*UsageLBConf) ResolveNow ¶
func (s *UsageLBConf) ResolveNow(rn resolver.ResolveNowOptions)
func (*UsageLBConf) Scheme ¶
func (d *UsageLBConf) Scheme() string
Click to show internal directories.
Click to hide internal directories.