config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnv

func GetEnv(key string) string

func GetEnvBool

func GetEnvBool(key string, defaultValue bool) bool

GetEnvBool returns an environment variable as bool with a default value

func GetEnvDuration

func GetEnvDuration(key string, defaultValue time.Duration) time.Duration

GetEnvDuration returns an environment variable as time.Duration with a default value

func GetEnvFloat

func GetEnvFloat(key string, defaultValue float64) float64

GetEnvFloat returns an environment variable as float64 with a default value

func GetEnvInt

func GetEnvInt(key string, defaultValue int) int

GetEnvInt returns an environment variable as int with a default value

func GetEnvOrDefault

func GetEnvOrDefault(key, defaultValue string) string

func IsValidBase64

func IsValidBase64(base64Str string) bool

IsValidBase64 checks if a string is valid base64

func IsValidDomain

func IsValidDomain(domain string) bool

IsValidDomain checks if a string is a valid domain name

func IsValidEmail

func IsValidEmail(email string) bool

func IsValidHex

func IsValidHex(hex string) bool

IsValidHex checks if a string contains only hexadecimal characters

func IsValidHost

func IsValidHost(host string) bool

IsValidHost checks if a string is a valid hostname or IP

func IsValidIP

func IsValidIP(ip string) bool

IsValidIP checks if a string is a valid IP address

func IsValidIPv4

func IsValidIPv4(ip string) bool

IsValidIPv4 checks if a string is a valid IPv4 address

func IsValidIPv6

func IsValidIPv6(ip string) bool

IsValidIPv6 checks if a string is a valid IPv6 address

func IsValidPort

func IsValidPort(port string) bool

func IsValidSlug

func IsValidSlug(slug string) bool

IsValidSlug checks if a string is a valid URL slug

func IsValidURL

func IsValidURL(urlStr string) bool

func IsValidUUID

func IsValidUUID(uuid string) bool

IsValidUUID checks if a string is a valid UUID

func RequiredEnv

func RequiredEnv(key string) string

RequiredEnv returns an environment variable or panics if not set

Types

This section is empty.

Jump to

Keyboard shortcuts

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