lb

package
v0.6.21-b7 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: Apache-2.0 Imports: 24 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ConnectionTimeout               = "server.http.client.timeout"
	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"
	ProtocolHttp                    = "http://"
	ProtocolHttps                   = "https://"
)

Variables

This section is empty.

Functions

func GetClient

func GetClient(timeout time.Duration) *http.Client

Types

type NetHttpClient added in v0.6.16

type NetHttpClient struct {
}

func (NetHttpClient) CheckRetry added in v0.6.16

func (NetHttpClient) CheckRetry(err error, status int) bool

func (NetHttpClient) Exec added in v0.6.16

func (NetHttpClient) Exec(req *request.Request) (r *gResp.Response, err error)

type ServerPool

type ServerPool struct {
	Services sync.Map
	// contains filtered or unexported fields
}

func GetInstance

func GetInstance() *ServerPool

func (*ServerPool) GetService added in v0.5.20

func (s *ServerPool) GetService(name string) *service

func (*ServerPool) GetUrl added in v0.5.20

func (s *ServerPool) GetUrl(serviceName string, path string) string

func (*ServerPool) Run

func (s *ServerPool) Run(req *request.Request, respResult any) (*response.Response, error)

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

func (*ServerPool) SetHttpClient added in v0.6.16

func (s *ServerPool) SetHttpClient(client client.HttpClient)

Jump to

Keyboard shortcuts

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