balancer

package
v2.3.214 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	NoAvailableServersNotify = "no available servers"
	ChangedUrlNotify         = "url changed"
)

Variables

View Source
var (
	ErrNoAvailableServers = errors.New(NoAvailableServersNotify)
	ErrEmptyUrls          = errors.New("no urls provided")
	ErrEmptyUrl           = errors.New("empty url")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(urls []string, cfg Config) (*Client, error)

func (*Client) GetCurrentURL

func (c *Client) GetCurrentURL() string

func (*Client) RegisterListener

func (c *Client) RegisterListener(ch chan string)

func (*Client) SendRequest

func (c *Client) SendRequest(originalReq *http.Request, skip bool) (*http.Response, error)

func (*Client) SwitchToNextServer

func (c *Client) SwitchToNextServer() bool

type Config added in v2.3.119

type Config struct {
	HTTPClient  *http.Client
	CheckPath   string
	CheckMethod string
}

Jump to

Keyboard shortcuts

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