config

package
v0.0.0-...-3a27eef Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: GPL-3.0 Imports: 3 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 {
	DB         DBConfig
	LogPath    string          `` /* 158-byte string literal not displayed */
	LogLevel   logger.LogLevel `env:"LOG_LEVEL" env-description:"Logging level [FATAL, ERROR, WARN, DEBUG, INFO, STASH]" env-default:"WARN"`
	Host       string          `env:"APP_HOST" env-description:"Address or addr-pattern what will listen to the application" env-default:""`
	Port       string          `env:"APP_PORT" env-description:"Application port" env-default:"8080"`
	SigningKey string          `env:"SUPER_KEY" env-description:"Secret key to generate JWT Authorization tokens" env-required:"true"`
}

Config structure

func GetConfig

func GetConfig() (*Config, error)

GetConfig initial configuration from env

type DBConfig

type DBConfig struct {
	Dialect  string `env:"DB_DIALECT" env-description:"The SQL dialect of your DBMS" env-default:"postgres"`
	Host     string `env:"DB_HOST" env-description:"DB address" env-required:"true"`
	Port     string `env:"DB_PORT" env-description:"DB port" env-required:"true"`
	Username string `env:"DB_USER" env-description:"DBMS name of the role" env-required:"true"`
	Password string `env:"DB_PASSWORD" env-description:"DBMS auth password" env-required:"true"`
	Name     string `env:"DB_NAME" env-description:"Name of the database" env-required:"true"`
	Charset  string `env:"DB_CHARSET" env-description:"" `
}

DBConfig contain main fields for connect to DB

Jump to

Keyboard shortcuts

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