Documentation
¶
Index ¶
- func GetEnv(key string) string
- func GetEnvBool(key string, defaultValue bool) bool
- func GetEnvDuration(key string, defaultValue time.Duration) time.Duration
- func GetEnvFloat(key string, defaultValue float64) float64
- func GetEnvInt(key string, defaultValue int) int
- func GetEnvOrDefault(key, defaultValue string) string
- func IsValidAlphabetic(str string) bool
- func IsValidAlphanumeric(str string) bool
- func IsValidBase64(base64Str string) bool
- func IsValidDomain(domain string) bool
- func IsValidEmail(email string) bool
- func IsValidFloat(str string) bool
- func IsValidHex(hex string) bool
- func IsValidHost(host string) bool
- func IsValidIP(ip string) bool
- func IsValidIPv4(ip string) bool
- func IsValidIPv6(ip string) bool
- func IsValidInteger(str string) bool
- func IsValidLowercase(str string) bool
- func IsValidNonEmptyString(str string) bool
- func IsValidNonNegativeFloat(str string) bool
- func IsValidNonNegativeInteger(str string) bool
- func IsValidNumber(str string) bool
- func IsValidNumeric(str string) bool
- func IsValidPort(port string) bool
- func IsValidPositiveFloat(str string) bool
- func IsValidPositiveInteger(str string) bool
- func IsValidSlug(slug string) bool
- func IsValidURL(urlStr string) bool
- func IsValidUUID(uuid string) bool
- func IsValidUppercase(str string) bool
- func LoadYAMLConfig(filename string, target interface{}) error
- func RequiredEnv(key string) string
- func SubstituteEnvVars(content []byte) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetEnvBool ¶
GetEnvBool returns an environment variable as bool with a default value
func GetEnvDuration ¶
GetEnvDuration returns an environment variable as time.Duration with a default value
func GetEnvFloat ¶
GetEnvFloat returns an environment variable as float64 with a default value
func GetEnvOrDefault ¶
func IsValidAlphabetic ¶ added in v1.1.0
IsValidAlphabetic checks if a string contains only alphabetic characters
func IsValidAlphanumeric ¶ added in v1.1.0
IsValidAlphanumeric checks if a string contains only alphanumeric characters
func IsValidBase64 ¶
IsValidBase64 checks if a string is valid base64
func IsValidDomain ¶
IsValidDomain checks if a string is a valid domain name
func IsValidEmail ¶
func IsValidFloat ¶ added in v1.1.0
IsValidFloat checks if a string represents a valid float
func IsValidHex ¶
IsValidHex checks if a string contains only hexadecimal characters
func IsValidHost ¶
IsValidHost checks if a string is a valid hostname or IP
func IsValidIPv4 ¶
IsValidIPv4 checks if a string is a valid IPv4 address
func IsValidIPv6 ¶
IsValidIPv6 checks if a string is a valid IPv6 address
func IsValidInteger ¶ added in v1.1.0
IsValidInteger checks if a string represents a valid integer
func IsValidLowercase ¶ added in v1.1.0
IsValidLowercase checks if a string contains only lowercase characters
func IsValidNonEmptyString ¶ added in v1.1.0
IsValidNonEmptyString checks if a string is not empty and not just whitespace
func IsValidNonNegativeFloat ¶ added in v1.1.0
IsValidNonNegativeFloat checks if a string represents a valid non-negative float
func IsValidNonNegativeInteger ¶ added in v1.1.0
IsValidNonNegativeInteger checks if a string represents a valid non-negative integer
func IsValidNumber ¶ added in v1.1.0
IsValidNumber checks if a string represents a valid number
func IsValidNumeric ¶ added in v1.1.0
IsValidNumeric checks if a string contains only numeric characters
func IsValidPort ¶
func IsValidPositiveFloat ¶ added in v1.1.0
IsValidPositiveFloat checks if a string represents a valid positive float
func IsValidPositiveInteger ¶ added in v1.1.0
IsValidPositiveInteger checks if a string represents a valid positive integer
func IsValidSlug ¶
IsValidSlug checks if a string is a valid URL slug
func IsValidURL ¶
func IsValidUUID ¶
IsValidUUID checks if a string is a valid UUID
func IsValidUppercase ¶ added in v1.1.0
IsValidUppercase checks if a string contains only uppercase characters
func LoadYAMLConfig ¶ added in v1.2.0
LoadYAMLConfig loads and parses a YAML config file with environment variable substitution
func RequiredEnv ¶
RequiredEnv returns an environment variable or panics if not set
func SubstituteEnvVars ¶ added in v1.2.0
SubstituteEnvVars replaces ${VARIABLE} patterns with environment variable values Supports ${VARIABLE}, ${VARIABLE:-default}, and ${VARIABLE=default} syntax Both :- and = use the default value if the variable is unset or empty
Types ¶
This section is empty.