util

package
v0.0.0-...-f944a7c Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoRandom

type GoRandom struct {
}

GoRandom uses Go's internal random generator to return a random number between minimum and maximum

func (GoRandom) NextInt

func (g GoRandom) NextInt(minimum int, maximum int) (int, error)

type LoadBalancer

type LoadBalancer interface {
	http.Handler
	Add(u *url.URL) (err error)
	Remove(u *url.URL) (err error)
}

LoadBalancer must support http.Handler and also give ability to add and remove

type RandomInt

type RandomInt interface {
	NextInt(minimum int, maximum int) (int, error)
}

RandomInt gives a nextInt from its range which may or may not actually be random

type TestingRandom

type TestingRandom struct {
	Values []int

	CallCount int
	// contains filtered or unexported fields
}

TestingRandom gives the next value in its array as it's 'nextInt', looping back to the first on reaching the end

func (*TestingRandom) NextInt

func (t *TestingRandom) NextInt(minimum int, maximum int) (int, error)

Jump to

Keyboard shortcuts

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