Documentation
¶
Index ¶
- func Adjective() string
- func AlphaNum(length int) string
- func App() string
- func DeploymentTier() string
- func IP(options ...IPOption) string
- func K8sLabels() []string
- func K8sNamespace() string
- func K8sNodeName() string
- func K8sPodName() string
- func MAC() string
- func Name() string
- func Names(n int) []string
- func Noun() string
- func Port(options ...PortOption) uint32
- type IPOption
- type PortOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeploymentTier ¶
func DeploymentTier() string
DeploymentTier generates a random software deployment tier such as prod, staging, etc.
func IP ¶
IP generates a random IP address. Options may be provided to specify a network for the address or if it should be IPv4 or IPv6.
func K8sNamespace ¶
func K8sNamespace() string
K8sNamespace generates a random Kubernetes namespace name.
func Port ¶
func Port(options ...PortOption) uint32
Port generates a random port number between 1 and 65535 or in the range specified by the given option.
Types ¶
type IPOption ¶
type IPOption interface {
// contains filtered or unexported methods
}
IPOption is an option to use with IP.
func WithIPCIDR ¶
WithIPCIDR defines a network for generated IPs. This option is incompatible with WithIPv4 and WithIPv6. It panics if the given cidr is invalid.
type PortOption ¶
type PortOption interface {
// contains filtered or unexported methods
}
PortOption is an option to use with Port.
func WithPortDynamic ¶
func WithPortDynamic() PortOption
WithPortDynamic specifies that the generated port must be in the dynamic range, i.e. [49152,65535]. This option is incompatible with WithPortSystem and WithPortUser.
func WithPortSystem ¶
func WithPortSystem(zero bool) PortOption
WithPortSystem specifies that the generated port must in the system range. If zero is true, the port range is [0,1023], otherwise it's [1,1023]. This option is incompatible with WithPortUser and WithPortDynamic.
func WithPortUser ¶
func WithPortUser() PortOption
WithPortUser specifies that the generated port must be in the user range, i.e. [1024, 49151]. This option is incompatible with WithPortSystem and WithPortDynamic.