randsrc

package
v0.0.0-...-a313e43 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChanSize

func ChanSize(size int) func(*Source)

ChanSize sets the channel size to use to for rand generation

func ForceIgnoreRollover

func ForceIgnoreRollover(forceIgnoreRollover bool) func(*Source)

ForceIgnoreRollover specifies whether RolloverThresh should be ignored. If this is set to true, rand generation does not reset.

func NewRandSrc

func NewRandSrc(
	options ...func(*Source),
) <-chan uint64

NewRandSrc returns a channel where random numbers are published

func Repeat

func Repeat(repeat bool) func(*Source)

Repeat specifies whether to repeat rand generation after reaching RolloverThresh

func RolloverThresh

func RolloverThresh(rolloverThresh uint64) func(*Source)

RolloverThresh specifies the number of rand generations after which to reset. If this is not set, rand generation does not reset

func Seed

func Seed(seed int64) func(*Source)

Seed sets the seed of the rand generation

Types

type Source

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

Source is used to generate random numbers in a channel

Jump to

Keyboard shortcuts

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