utils

package
v0.0.0-...-a5a3fa4 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	PostgresUser     string `mapstructure:"POSTGRES_USER" env:"POSTGRES_USER"`
	PostgresPassword string `mapstructure:"POSTGRES_PASSWORD" env:"POSTGRES_PASSWORD"`
	DbName           string `mapstructure:"DB_NAME" env:"DB_NAME"`
	DbHost           string `mapstructure:"DB_HOST" env:"DB_HOST"`
	DbPort           int    `mapstructure:"DB_PORT" env:"DB_PORT"`
	SecretKey        string `mapstructure:"SECRET_KEY" env:"SECRET_KEY"`
	RedisPass        string `mapstructure:"REDIS_PASS" env:"REDIS_PASS"`
	RedisHost        string `mapstructure:"REDIS_HOST" env:"REDIS_HOST"`
	RedisDb          int    `mapstructure:"REDIS_DB"   env:"REDIS_DB"`
	MaxFileSize      int64  `mapstructure:"MAX_FILE_SIZE" env:"MAX_FILE_SIZE"`
}

Config stores all configuration of the application

func LoadConfig

func LoadConfig(path string, name string) (config Config, err error)

LoadConfig Loads the config from the .env file, if not present it loads it from the environment variables Usage: conf, err := LoadConfig("../","filename") filename is assumed to have a .env extension do not add .env to the filename

Jump to

Keyboard shortcuts

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