config

package
v0.0.0-...-7c35eaa Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Mode string `mapstructure:"MODE"` // "dev", "stage", "prod"
}

type Config

type Config struct {
	App      App      `mapstructure:"APP"`
	Rest     Rest     `mapstructure:"REST"`
	Database Database `mapstructure:"DATABASE"`
	Swagger  Swagger  `mapstructure:"SWAGGER"`
	Jwt      Jwt      `mapstructure:"JWT"`
	Smtp     Smtp     `mapstructure:"SMTP"`
}

func NewConfig

func NewConfig() Config

type Database

type Database struct {
	Host     string `mapstructure:"HOST"`
	Port     int    `mapstructure:"PORT"`
	LogLevel int    `mapstructure:"LOG_LEVEL"` // 1:Silent, 2:Error, 3:Warn, 4:Info
	UserName string `mapstructure:"USER_NAME"`
	Password string `mapstructure:"PASSWORD"`
	DbName   string `mapstructure:"DB_NAME"`
}

type Jwt

type Jwt struct {
	SecretKey string `mapstructure:"SECRET_KEY"`
}

type Rest

type Rest struct {
	Port int    `mapstructure:"PORT"`
	Mode string `mapstructure:"MODE"` // "debug" or "release"
}

type Smtp

type Smtp struct {
	Host     string `mapstructure:"HOST"`
	Port     int    `mapstructure:"PORT"`
	UserName string `mapstructure:"USER_NAME"`
	Password string `mapstructure:"PASSWORD"`
}

type Swagger

type Swagger struct {
	Host     string `mapstructure:"HOST"`
	BasePath string `mapstructure:"BASE_PATH"`
}

Jump to

Keyboard shortcuts

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