testrand

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2019 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package testrand implements generating random base types for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes

func Bytes(size memory.Size) []byte

Bytes generates size amount of random data.

func BytesInt

func BytesInt(size int) []byte

BytesInt generates size amount of random data.

func Float64n added in v0.18.0

func Float64n(n int64) float64

Float64n returns floating point pseudo-random number in [-n,0] || [0,n] based on the sign of the input

func Int63n

func Int63n(n int64) int64

Int63n returns, as an int64, a non-negative pseudo-random number in [0,n) from the default Source. It panics if n <= 0.

func Intn

func Intn(n int) int

Intn returns, as an int, a non-negative pseudo-random number in [0,n) from the default Source. It panics if n <= 0.

func Key

func Key() storj.Key

Key creates a random test key.

func NodeID

func NodeID() storj.NodeID

NodeID creates a random node id.

func Nonce

func Nonce() storj.Nonce

Nonce creates a random test nonce.

func PieceID

func PieceID() storj.PieceID

PieceID creates a random piece id.

func Read

func Read(data []byte)

Read reads pseudo-random data into data.

func Reader

func Reader() io.Reader

Reader creates a new random data reader.

func SegmentID added in v0.16.0

func SegmentID(size int) storj.SegmentID

SegmentID creates a random segment ID

func SerialNumber

func SerialNumber() storj.SerialNumber

SerialNumber creates a random serial number.

func StreamID added in v0.15.0

func StreamID(size int) storj.StreamID

StreamID creates a random stream ID

func UUID

func UUID() uuid.UUID

UUID creates a random uuid.

Types

This section is empty.

Jump to

Keyboard shortcuts

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