helper

package
v0.0.45 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: MIT Imports: 6 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteCountIEC

func ByteCountIEC(b int64) string

ByteCountIEC convert the byte in input to MB/KB/TB ecc

func ByteCountSI

func ByteCountSI(b int64) string

ByteCountSI convert the byte in input to MB/KB/TB ecc

func ConvertSize added in v0.0.18

func ConvertSize(bytes float64, dimension string) float64

ConvertSize is delegated to return the dimension related to the input byte size

func GenerateSequentialFloat32Array added in v0.0.14

func GenerateSequentialFloat32Array(length int) []float32

GenerateSequentialFloat32Array is delegated to generate an array of sequential number

func GenerateSequentialIntArray added in v0.0.14

func GenerateSequentialIntArray(length int) []int

GenerateSequentialIntArray is delegated to generate an array of sequential number

func Marshal added in v0.0.43

func Marshal(data interface{}) string

func MarshalIndent added in v0.0.43

func MarshalIndent(data interface{}) string

func RandomByte added in v0.0.41

func RandomByte(length int) []byte

RandomByte is delegated to generate a byte array with the given input length

func RandomFloat32 added in v0.0.14

func RandomFloat32(min, max float32) float32

RandomFloat32 initialize a new seed using the UNIX Nano time and return a float32 between the 2 input value

func RandomFloat64 added in v0.0.14

func RandomFloat64(min, max float64) float64

RandomFloat64 initialize a new seed using the UNIX Nano time and return a float64 between the 2 input value

func RandomInt added in v0.0.2

func RandomInt(min, max int) int

RandomInt initialize a new seed using the UNIX Nano time and return an integer between the 2 input value

func RandomInt32 added in v0.0.14

func RandomInt32(min, max int32) int32

RandomInt32 initialize a new seed using the UNIX Nano time and return an integer between the 2 input value

func RandomInt64 added in v0.0.14

func RandomInt64(min, max int64) int64

RandomInt64 initialize a new seed using the UNIX Nano time and return an integer between the 2 input value

Types

type RandomGenerator added in v0.0.14

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

RandomGenerator is delegated to generate random without call seed every time

func InitRandomizer added in v0.0.14

func InitRandomizer() RandomGenerator

InitRandomizer initialize a new RandomGenerator

func (RandomGenerator) RandomFloat32 added in v0.0.14

func (rander RandomGenerator) RandomFloat32(min, max float32) float32

RandomFloat32 initialize a new seed using the UNIX Nano time and return a float32 between the 2 input value

func (RandomGenerator) RandomFloat32Array added in v0.0.14

func (rander RandomGenerator) RandomFloat32Array(min, max float32, length int) []float32

RandomFloat32Array return a new array with random number from min to max of length len

func (RandomGenerator) RandomFloat64 added in v0.0.14

func (rander RandomGenerator) RandomFloat64(min, max float64) float64

RandomFloat64 initialize a new seed using the UNIX Nano time and return a float64 between the 2 input value

func (RandomGenerator) RandomFloat64Array added in v0.0.14

func (rander RandomGenerator) RandomFloat64Array(min, max float64, length int) []float64

RandomFloat64Array return a new array with random number from min to max of length len

func (RandomGenerator) RandomInt added in v0.0.14

func (rander RandomGenerator) RandomInt(min, max int) int

RandomInt initialize a new seed using the UNIX Nano time and return an integer between the 2 input value

func (RandomGenerator) RandomInt32 added in v0.0.14

func (rander RandomGenerator) RandomInt32(min, max int32) int32

RandomInt32 initialize a new seed using the UNIX Nano time and return an integer between the 2 input value

func (RandomGenerator) RandomInt32Array added in v0.0.14

func (rander RandomGenerator) RandomInt32Array(min, max int32, length int) []int32

RandomInt32Array return a new array with random number from min to max of length len

func (RandomGenerator) RandomInt64 added in v0.0.14

func (rander RandomGenerator) RandomInt64(min, max int64) int64

RandomInt64 initialize a new seed using the UNIX Nano time and return an integer between the 2 input value

func (RandomGenerator) RandomInt64Array added in v0.0.14

func (rander RandomGenerator) RandomInt64Array(min, max int64, length int) []int64

RandomInt64Array return a new array with random number from min to max of length len

func (RandomGenerator) RandomIntArray added in v0.0.14

func (rander RandomGenerator) RandomIntArray(min, max, length int) []int

RandomIntArray return a new array with random number from min to max of length len

Jump to

Keyboard shortcuts

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