policy

package
v1.6.9 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Policy

type Policy interface {
	List(policy ...interface{}) []interface{}
	String() string
}

Policy defines a policy we use for selecting upstreams.

type Random

type Random struct{}

Random is a policy that implements random upstream selection.

func (*Random) List

func (r *Random) List(p ...interface{}) []interface{}

List returns a set of proxies to be used for this client depending on Random policy.

func (*Random) String

func (r *Random) String() string

String returns the name of policy Random

type RoundRobin

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

RoundRobin is a policy that selects hosts based on round robin ordering.

func (*RoundRobin) List

func (r *RoundRobin) List(p ...interface{}) []interface{}

List returns a set of proxies to be used for this client depending on RoundRobin policy.

func (*RoundRobin) String

func (r *RoundRobin) String() string

String returns the name of policy RoundRobin

type Sequential

type Sequential struct{}

Sequential is a policy that selects hosts based on sequential ordering.

func (*Sequential) List

func (r *Sequential) List(p ...interface{}) []interface{}

List returns a set of proxies without filter.

func (*Sequential) String

func (r *Sequential) String() string

String returns the name of policy Sequential

Jump to

Keyboard shortcuts

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