random

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2021 License: Apache-2.0, MIT Imports: 6 Imported by: 0

Documentation

Overview

Package random contains functions for generating random values

Index

Constants

This section is empty.

Variables

View Source
var Rnd = rand.New(rand.NewSource(time.Now().UnixNano()))

Rnd -

Functions

func Float

func Float(min, max float64) (float64, error)

Float - For now this is really just a wrapper around `rand.Float64`

func Item

func Item(items []interface{}) (interface{}, error)

Item -

func Number

func Number(min, max int64) (int64, error)

Number -

func StringBounds

func StringBounds(count int, lower, upper rune) (r string, err error)

StringBounds returns a random string of characters with a codepoint between the lower and upper bounds. Only valid characters are returned and if a range is given where no valid characters can be found, an error will be returned.

func StringRE

func StringRE(count int, match string) (r string, err error)

StringRE - Generate a random string that matches a given regular expression. Defaults to "[a-zA-Z0-9_.-]"

Types

This section is empty.

Jump to

Keyboard shortcuts

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