config

package
v0.0.0-...-cfe2f6a Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Global = &struct {
	JWTSecret []byte
	UserImg   string
}{}

Functions

This section is empty.

Types

type Config

type Config struct {
	Database struct {
		Host        string `yaml:"host" env:"DB_HOST" env-description:"Database host"`
		Port        string `yaml:"port" env:"DB_PORT" env-description:"Database port"`
		Username    string `yaml:"username" env:"DB_USER" env-description:"Database user name"`
		Password    string `yaml:"password" env:"DB_PASSWORD" env-description:"Database user password"`
		Name        string `yaml:"db_name" env:"DB_NAME" env-description:"Database name"`
		Connections int    `yaml:"connections" env:"DB_CONNECTIONS" env-description:"Total number of database connections"`
	} `yaml:"database"`
	Default struct {
		UserImg string `yaml:"user_img" env-description:"Default user image"`
	} `yaml:"default"`
	Server struct {
		Host      string `yaml:"host" env:"SRV_HOST,HOST" env-description:"Server host" env-default:"localhost"`
		Port      string `yaml:"port" env:"SRV_PORT,PORT" env-description:"Server port" env-default:"8080"`
		JWTSecret string `yaml:"secret" env:"SRV_SECRET,SECRET" env-description:"JWT secret string"`
	} `yaml:"server"`
}

Config is a application configuration structure

func (*Config) Init

func (cfg *Config) Init()

Jump to

Keyboard shortcuts

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