lb

package
v0.20.2 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_TIMEOUT                 = 30
	RetryOnConnectionFailure        = "server.http.retry.onConnectionFailure"
	RetryEnabled                    = "server.http.retry.enabled"
	RetryOnAllOperations            = "server.http.retry.allOperations"
	MaxRetriesOnNextServiceInstance = "server.http.retry.maxRetriesOnNextServiceInstance"
	RetryableStatusCodes            = "server.http.retry.retryableStatusCodes"
)

Variables

This section is empty.

Functions

func GetClient

func GetClient() *http.Client

Types

type ServerPool

type ServerPool struct {
	Services sync.Map
}

func GetInstance

func GetInstance() *ServerPool

func (*ServerPool) Run

func (s *ServerPool) Run(req *request.Request) (int, error)

lb对接收到的请求 进行负载均衡

func (*ServerPool) SetService

func (s *ServerPool) SetService(name string, instances []*registry.Instance) *service

Jump to

Keyboard shortcuts

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