Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Env ¶
type Env struct { DB_HOST string `mapstructure:"DB_HOST"` DB_PORT string `mapstructure:"DB_PORT"` DB_USER string `mapstructure:"DB_USER"` DB_PASS string `mapstructure:"DB_PASS"` DB_NAME string `mapstructure:"DB_NAME"` DB_URL string `mapstructure:"DB_URL"` WEB_PORT string `mapstructure:"WEB_PORT"` TIMEOUT string `mapstructure:"TIMEOUT"` ENVIRONMENT string `mapstructure:"ENVIRONMENT"` JWT_TOKEN string `mapstructure:"JWT_TOKEN"` JWT_EXPIRE_HOUR string `mapstructure:"JWT_EXPIRE_HOUR"` TOKEN_TYPE string `mapstructure:"TOKEN_TYPE"` }
func GetEnv ¶
GetEnv retrieves the environment configuration from the .env file or environment variables. If the .env file exists, it reads the configuration from it using viper library. Otherwise, it retrieves the configuration from environment variables using viper.AutomaticEnv(). The retrieved configuration is then unmarshaled into the 'env' struct. If any error occurs during the process, it is returned along with the 'env' struct.
Click to show internal directories.
Click to hide internal directories.