utils

package
v0.0.0-...-baa1a54 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2018 License: MIT Imports: 8 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Int31n

func Int31n(n int32) int32

Int31n returns a pseudo-random int32 in range [0, n).

func RandomPort

func RandomPort() (int, error)

RandomPort() returns a random port to be used with net.Listen(). It's an helper function to register to kontrol before binding to a port. Note that this racy, there is a possibility that someoe binds to the port during the time you get the port and someone else finds it. Therefore use in caution.

func RandomString

func RandomString(n int) string

RandomString returns random string read from crypto/rand.

Types

This section is empty.

Jump to

Keyboard shortcuts

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