random

package
Version: v0.0.0-...-7d43bac Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package random provides support for random pick load balancer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoadBalancingStrategy

type LoadBalancingStrategy struct {
	Randomizer *rand.Rand // randomizer
}

LoadBalancingStrategy represents Random Load Balancing mechanism.

func NewRandomLBStrategy

func NewRandomLBStrategy() *LoadBalancingStrategy

NewRandomLBStrategy creates random load balancing strategy instance.

func (LoadBalancingStrategy) PickServiceAddress

func (s LoadBalancingStrategy) PickServiceAddress(sa []*url.URL) (*url.URL, error)

PickServiceAddress randomly picks service address from list of adresses.

Source Files

Jump to

Keyboard shortcuts

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