rando

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AsciiUpper  []string
	AsciiLower  []string
	AsciiNumber []string
)

Functions

func AnyAsciiRandfix

func AnyAsciiRandfix(in, del string, min uint) (_ string, err error)

AnyAsciiRandfix concatenates a random ASCII string of 1 to min length to the beginning and end of in. This aims to enhance randomization of values.

func AnyAsciiSlice

func AnyAsciiSlice(minLen uint32, allowNumbers bool) (out []string)

AnyAsciiSlice will generate any alphanumeric value, including upper case, in a slice. Suppress numbers by setting allowNumbers to false.

func AnyAsciiString

func AnyAsciiString(minLen uint32, allowNumbers bool, del string) string

AnyAsciiString uses AnyAsciiSlice to generate a string value that was joined on del.

func AnySlice

func AnySlice(minLen uint32) (out []string)

AnySlice returns a slice of random values.

minLen determines the maximum length of the values joined on an empty string.

func AnyString

func AnyString(minLen uint32, del string) string

AnyString returns a string of random values joined by a delimiter.

minLen determines the maximum length of the values joined on an empty string.

func DnsName

func DnsName[S shared.StringType](nT S, dnsApex string, doResolve bool) (name string, resolved bool, ips []net.IP, err error)

DnsName returns a randomized DNS FQDN.

When doResolve is true, DNS resolution will occur.

nT indicates the type of noun to use, i.e., common or proper.

func DnsNameMustNotResolve

func DnsNameMustNotResolve[S shared.StringType](nT S, dnsApex string) (name string, err error)

DnsNameMustNotResolve perpetually generates FQDN values and attempts name resolution until one fails, resulting in a unique FQDN that is not associated with an active DNS A record.

func DnsUntil

func DnsUntil[S shared.StringType](nT S, dnsNameApex string, dnsNameUntilNoResolve bool) (fqdn string, resolved bool, ips []net.IP, err error)

func Hostname

func Hostname[S shared.StringType](nT S) (v string, err error)

Hostname returns a randomized "adjective-noun" hostname.

nT indicates the type of noun to use, i.e., common or proper.

func NounType

func NounType() nouns.NounType

NounType returns one of the two wordlists.NounType values.

func UintGTZ

func UintGTZ(max uint) (out uint, err error)

UintGTZ returns an uint that is greater-than-zero.

func Uuid

func Uuid() string

Uuid returns a Uuid string.

Types

type MaxDnsTries

type MaxDnsTries string

func (MaxDnsTries) Error

func (m MaxDnsTries) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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