Documentation ¶
Index ¶
- Constants
- Variables
- func CloseEtcdClient()
- func InitEtcdCli()
- func NewGrpc(data ...map[string]interface{})
- func NewGrpcClientConn(service string, lb string, dialOptions ...grpc.DialOption) *grpc.ClientConn
- func NewRRGrpcClientConn(service string, dialOptions ...grpc.DialOption) *grpc.ClientConn
- func NewRest(data ...map[string]interface{})
- func NewSWRRGrpcClientConn(service string, dialOptions ...grpc.DialOption) *grpc.ClientConn
- func ShutdownGrpc()
- func ShutdownRest()
- type Chooser
- type RRServiceProvider
- type SWRRServiceProvider
Constants ¶
View Source
const Name = "etcd_weight_balancer"
Variables ¶
View Source
var EtcdCli *clientv3.Client
Functions ¶
func CloseEtcdClient ¶
func CloseEtcdClient()
func InitEtcdCli ¶
func InitEtcdCli()
func NewGrpcClientConn ¶
func NewGrpcClientConn(service string, lb string, dialOptions ...grpc.DialOption) *grpc.ClientConn
func NewRRGrpcClientConn ¶
func NewRRGrpcClientConn(service string, dialOptions ...grpc.DialOption) *grpc.ClientConn
func NewSWRRGrpcClientConn ¶ added in v2.0.1
func NewSWRRGrpcClientConn(service string, dialOptions ...grpc.DialOption) *grpc.ClientConn
func ShutdownGrpc ¶
func ShutdownGrpc()
func ShutdownRest ¶
func ShutdownRest()
Types ¶
type Chooser ¶
type Chooser struct {
// contains filtered or unexported fields
}
Chooser from naming_client package in nacos-sdk-go
type RRServiceProvider ¶
type RRServiceProvider struct {
// contains filtered or unexported fields
}
RRServiceProvider is a simple round-robin load balance implementation for IServiceProvider
func NewRRServiceProvider ¶
func NewRRServiceProvider(serviceName string) *RRServiceProvider
NewRRServiceProvider creates new RRServiceProvider instance
func (*RRServiceProvider) Close ¶ added in v2.0.6
func (r *RRServiceProvider) Close()
func (*RRServiceProvider) SelectServer ¶
func (n *RRServiceProvider) SelectServer() string
SelectServer return service address from environment variable
type SWRRServiceProvider ¶
type SWRRServiceProvider struct {
*RRServiceProvider
}
SWRRServiceProvider is a smooth weighted round-robin service provider
func NewSWRRServiceProvider ¶
func NewSWRRServiceProvider(serviceName string) *SWRRServiceProvider
NewSWRRServiceProvider creates new SWRRServiceProvider instance
func (*SWRRServiceProvider) SelectServer ¶
func (n *SWRRServiceProvider) SelectServer() string
SelectServer selects a node which is supplying service specified by name property from cluster
Click to show internal directories.
Click to hide internal directories.