loadbalance

package
v0.0.0-...-5af7f74 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: MIT Imports: 1 Imported by: 1

Documentation

Overview

Package loadbalance provides load balancing over Dialers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, s Strategy)

Register registers a Strategy under specified name.

Types

type Strategy

type Strategy func([]proxy.Dialer) proxy.Dialer

A Strategy is a function that accepts some Dialers as arguments and returns a Dialer that when dials, it picks one from those provided Dialers with certain strategy, and completes the dialing with this selected Dialer.

func Get

func Get(name string) Strategy

Get gets a registered Strategy by name. Get returns nil if there is no Strategy registered under this name.

Directories

Path Synopsis
strategy
failover
Package failover provides a load balancing strategy that it tries to pick a reliable Dialer out of many.
Package failover provides a load balancing strategy that it tries to pick a reliable Dialer out of many.
random
Package random provides a load balancing strategy that randomly picks one Dialer out of many.
Package random provides a load balancing strategy that randomly picks one Dialer out of many.
roundrobin
Package roundrobin provides a load balancing strategy that cyclically picks one Dialer out of many.
Package roundrobin provides a load balancing strategy that cyclically picks one Dialer out of many.

Jump to

Keyboard shortcuts

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