env

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBool

func GetBool(key string, defaultValue bool) bool

GetBool is function to read bool env value

func GetInt

func GetInt(key string, defaultValue int) int

GetInt is function to read int env value

func GetString

func GetString(key string, defaultValue string) string

GetString is function to read string env value

func SetFile

func SetFile(filePath, fileName string)

Types

type Config

type Config struct {
	Production    bool   `mapstucture:"production"`      //
	SuperUsername string `mapstructure:"super_username"` //
	SuperPassword string `mapstructure:"super_password"` //
	DBHost        string `mapstructure:"db_host"`        //
	DBPort        string `mapstructure:"db_port"`        //
	DBName        string `mapstructure:"db_name"`        //
	DBUser        string `mapstructure:"db_user"`        //
	DBPassword    string `mapstructure:"db_password"`    //
	AppName       string `mapstructure:"app_name"`       //
	AppBaseURL    string `mapstructure:"base_url"`       //
	AppBaseURLV1  string `mapstructure:"base_url_v1"`    //
	AppPort       string `mapstructure:"port"`           //
	SecretKey     string `mapstructure:"secretkey"`      //
	SMTPHost      string `mapstructure:"smtp_host"`      //
	SMTPPort      int    `mapstructure:"smtp_port"`      //
	SMTPSender    string `mapstructure:"smtp_sender"`    //
	SMTPEmail     string `mapstructure:"smtp_email"`     //
	SMTPPassword  string `mapstructure:"smtp_password"`  //
	RedisHost     string `mapstructure:"redis_host"`     //
	RedisPort     string `mapstructure:"redis_port"`     //
	RedisPassword string `mapstructure:"redis_password"` //
	RedisDB       int    `mapstructure:"redis_db"`       //
}

Config is struct from env variables

func Var

func Var() Config

InitConfig is fuction to initialize viper from reading env variables

Jump to

Keyboard shortcuts

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