kite: github.com/koding/kite/utils Index | Files

package utils

import "github.com/koding/kite/utils"

Index

Package Files

utils.go

func Int31n Uses

func Int31n(n int32) int32

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

func RandomPort Uses

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 Uses

func RandomString(n int) string

RandomString returns random string read from crypto/rand.

Package utils imports 8 packages (graph) and is imported by 2 packages. Updated 2017-01-31. Refresh now. Tools for package owners.