Documentation ¶
Overview ¶
Package petname is a library for generating human-readable, random names for objects (e.g. hostnames, containers, blobs).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Adjective ¶
func Adjective() string
Adjective returns a random adjective from a list of petname adjectives.
func Generate ¶
Generate will create a petname using the given configuration. Casing and word separation are different, allowing things such as `Word-Word-Word` or `WORD_WORD_WORD`.
func NonDeterministicMode ¶
func NonDeterministicMode()
NonDeterministicMode configures the local random generator used internally to provide non deterministic results, instead of a pre-defined order that is reproducible even after a process restart. If you wish to specify a custom contant, call [Seed(int64)].
func Seed ¶
func Seed(seed int64)
Seed configures the local random generator, allowing you to specify a constant for reproducible "randomness" or provide a custom value for "true" randomness.
func SetAdjectives ¶
func SetAdjectives(a []string)
SetAdjectives specifies which adjectives to use when generating petnames. Note that these are expected to be all lowercase characters and not containing any trailing or leading whitespace.
func SetAdverbs ¶
func SetAdverbs(a []string)
SetAdverbs specifies which adverbs to use when generating petnames. Note that these are expected to be all lowercase characters and not containing any trailing or leading whitespace.