balancer

package
v2.3.125 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2025 License: MIT Imports: 10 Imported by: 0

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