etcd

package
v2.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2024 License: MIT Imports: 24 Imported by: 5

Documentation

Index

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 NewGrpc

func NewGrpc(data ...map[string]interface{})

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 NewRest

func NewRest(data ...map[string]interface{})

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL