helper

package
v0.0.0-...-4bfe12e Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenBetweenTimeUTC

func GenBetweenTimeUTC(begin time.Time, end time.Time) time.Time

GenBetweenTimeUTC generate a timestamp between the given parameters as earlier as 'begin' and before 'end'. delta is the duration that set the threshold for the time. Return a time.Time for the expected interval.

func GenFutureNearTimeUTC

func GenFutureNearTimeUTC(delta time.Duration) time.Time

GenFutureNearTimeUTC generate a past timestamp not further than delta. delta is the duration that set the threshold for the time. Return a time.Time for the expected interval.

func GenIssuerWithRealm

func GenIssuerWithRealm(issuer string, realm string) string

GenIssuerWithRealm generate a certificate issuer for the given issuer and realm. issuer is a string describing the certificate issuer, for instance "Verisign". realm is the domain realm that the certificate is issuer belongs to. Return a string with the issuer string.

func GenPastNearTime

func GenPastNearTime(delta time.Duration) time.Time

GenPastNearTime generate a past timestamp not further than delta. delta is the duration that set the threshold for the time. Return a time.Time for the expected interval.

func GenPemCertificate

func GenPemCertificate() string

GenPemCertificate currently return a static PEM certificate.

func GenRandBool

func GenRandBool() bool

GenRandBool generate a random boolean. Return a bool value.

func GenRandDescription

func GenRandDescription() string

GenRandTitle generate random title Return a random string pointer, a pointer to empty string or nil.

func GenRandDomainLabel

func GenRandDomainLabel() string

GenRandDomainLabel generate a random label according to RFC1035 Return the string representing a valid domain label.

func GenRandDomainName

func GenRandDomainName(level int) string

GenRandDomainName generate a random domain name for testing using .test as defined at RFC 6761 level is >= 2 and <= 4. Return a domain name

func GenRandEmail

func GenRandEmail() string

GenRandEmail generate a random email. Return a string.

func GenRandFQDN

func GenRandFQDN() string

GenRandFQDN Generate a random FQDN using a random 3 level domain name. Return a string value.

func GenRandFQDNWithDomain

func GenRandFQDNWithDomain(domain string) string

GenRandFQDNWithDomain Generate a random FQDN for the given domain. domain is the domain that belong the returned FQDN Return a FQDN string representation.

func GenRandFirstName

func GenRandFirstName() string

GenRandFirstName generate a random first name. Return a string.

func GenRandLastName

func GenRandLastName() string

GenRandLastName generate a random last name. Return a string.

func GenRandLocationDescription

func GenRandLocationDescription() string

GenRandLocationDescription generate a random description by adding " location" to a random location label. Return a string with the description.

func GenRandLocationLabel

func GenRandLocationLabel() string

GenRandLocationLabel generate a random location label. Return a string with the label value.

func GenRandNum

func GenRandNum(min, max int64) int64

GenRandNum generate a random number >= min and <= max interval. min is the lower boundary interval including the value. max is the higher boundary interval including the value.

func GenRandParagraph

func GenRandParagraph(n int) string

GenRandParagraph generate a random paragraph. Return a multiline string.

func GenRandPointyBool

func GenRandPointyBool() *bool

GenRandPointyBool generate a random bool pointer. Return nil, or a bool pointer.

func GenRandString

func GenRandString(letters []rune, n int) string

GenRandString generate a random string from the letters set with length n. letters the set of letters to use. n the length of the string. Return a random string.

func GenRandTitle

func GenRandTitle() string

GenRandTitle generate random title

func GenRandUserID

func GenRandUserID() string

GenRandUserID Generate a random UUID. Return a string.

func GenRandUsername

func GenRandUsername() string

GenRandUsername generate a random username. Return a string.

func GenSubjectWithRealm

func GenSubjectWithRealm(subject string, realm string) string

GenSubjectWithRealm generate a certificate subject for the given subject and realm. subject is a string describing the certificate subject, for instance "My Site". realm is the domain realm that the certificate is issued for. Return a string with the subject string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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