helper

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2019 License: MIT Imports: 4 Imported by: 7

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 Check

func Check(e error)

Check is a helper function which streamlines error checking

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 RandomFloat32 added in v0.0.14

func RandomFloat32(min, max float32) float32

RandomFloat32 initalizate 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 initalizate 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 initalizate 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 initalizate 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 initalizate a new seed using the UNIX Nano time and return an integer between the 2 input value

func RecognizeFormat

func RecognizeFormat(input string) (string, string)

RecognizeFormat is delegated to valutate the extension and return the properly Mimetype by a given format type reurn: (Mimetype http compliant,Content-Disposition header 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 initalizate 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, len 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 initalizate 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, len 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 initalizate 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 initalizate 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, len 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 initalizate 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, len 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, len 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