balancer

package
v1.0.66 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 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)
	ErrServerIsNotAvailable = errors.New("server not available")
)

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(config Config, debug string) (*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

type Config struct {
	Urls        []string
	Token       string
	WebhookAddr string
}

Jump to

Keyboard shortcuts

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