Documentation ¶
Index ¶
- Constants
- func RandInt() int
- func RandIntRange(min int, max int) int
- func RandIpAddress(s string) (string, error)
- func RandSSHKeyPair(comment string) (string, string, error)
- func RandString(strlen int) string
- func RandStringFromCharSet(strlen int, charSet string) string
- func RandTLSCert(orgName string) (string, string, error)
- func RandomWithPrefix(name string) string
Constants ¶
const ( // CharSetAlphaNum is the alphanumeric character set for use with // RandStringFromCharSet CharSetAlphaNum = "abcdefghijklmnopqrstuvwxyz012346789" // CharSetAlpha is the alphabetical character set for use with // RandStringFromCharSet CharSetAlpha = "abcdefghijklmnopqrstuvwxyz" )
Variables ¶
This section is empty.
Functions ¶
func RandIntRange ¶
RandIntRange returns a random integer between min (inclusive) and max (exclusive)
func RandIpAddress ¶
RandIpAddress returns a random IP address in the specified CIDR block. The prefix length must be less than 31.
func RandSSHKeyPair ¶
RandSSHKeyPair generates a public and private SSH key pair. The public key is returned in OpenSSH format, and the private key is PEM encoded.
func RandString ¶
RandString generates a random alphanumeric string of the length specified
func RandStringFromCharSet ¶
RandStringFromCharSet generates a random string by selecting characters from the charset provided
func RandTLSCert ¶
RandTLSCert generates a self-signed TLS certificate with a newly created private key, and returns both the cert and the private key PEM encoded.
func RandomWithPrefix ¶
RandomWithPrefix is used to generate a unique name with a prefix, for randomizing names in acceptance tests
Types ¶
This section is empty.