config

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppEnv

func AppEnv() string

AppEnv returns the current application environment (development, production, testing).

func Env

func Env(key, fallback string) string

Env returns the value of an environment variable, or the fallback if empty/unset.

func EnvBool

func EnvBool(key string, fallback bool) bool

EnvBool returns the value of an environment variable as a bool. Only "true" and "1" are considered truthy. Everything else returns the fallback.

func EnvInt

func EnvInt(key string, fallback int) int

EnvInt returns the value of an environment variable as an int, or the fallback if empty/unset or not a valid integer.

func IsDebug

func IsDebug() bool

IsDebug returns true if APP_DEBUG is "true" or "1".

func IsDevelopment

func IsDevelopment() bool

IsDevelopment returns true if APP_ENV is "development".

func IsProduction

func IsProduction() bool

IsProduction returns true if APP_ENV is "production".

func IsTesting

func IsTesting() bool

IsTesting returns true if APP_ENV is "testing".

func Load

func Load()

Load reads the .env file and sets environment variables. If no .env file is found, it logs a message and continues (system environment variables are still available).

Types

This section is empty.

Jump to

Keyboard shortcuts

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