randomdummy

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package randomdummy generates random trice data for testing.

Index

Constants

View Source
const (
	// NoDelay avoids any internal waiting.
	NoDelay = time.Duration(0)

	// DefaultDelay performs a short internal waiting for output synchronisation
	DefaultDelay = time.Duration(2 * time.Millisecond)

	// NoLimit is used for limit and means endless (circular) data.
	NoLimit = 0

	// ZeroRandomSeed makes sure generated random numbers are the same from start to start.
	ZeroRandomSeed = 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Randomizer

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

Randomizer delivers an endless circle of random bytes

func New

func New(seed int64, mode string, time time.Duration, limit int) *Randomizer

New creates an instance of Random.

seed is used for random init. Use fixed value like 0 for identical start values. mode is used for bringing some structure in the Read data especiually for tests. time is used for an artificial Read delay limit is the max number of generated bytes, 0 means endless data

func (*Randomizer) Read

func (p *Randomizer) Read(b []byte) (int, error)

Read is the exported method.

Jump to

Keyboard shortcuts

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