config

package
v0.0.0-...-bcd2c7c Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigPath = "deploy/config/"
	ConfigName = "setting"
	ConfigType = "yml"
)

Variables

This section is empty.

Functions

func SetUp

func SetUp(register func(*Config)) error

Types

type AppConfig

type AppConfig struct {
	ServerAddress string `mapstructure:"server_address"`
	StaticPrefix  string `mapstructure:"static_prefix"`
}

type Config

type Config struct {
	Version     string    `mapstructure:"version"`
	Mode        string    `mapstructure:"mode"`
	Application AppConfig `mapstructure:"application"`
	Database    DBConfig  `mapstructure:"database"`
	Jwt         JWTConfig `mapstructure:"jwt"`
	Log         LogConfig `mapstructure:"log"`
	Author      []string  `mapstructure:"author"`
}

type DBConfig

type DBConfig struct {
	DBDriver    string `mapstructure:"driver"`
	LoggerLevel int    `mapstructure:"level"`
	DBUser      string `mapstructure:"user"`
	DBPassword  string `mapstructure:"password"`
	DBPort      int    `mapstructure:"port"`
	DBName      string `mapstructure:"name"`
	DBHost      string `mapstructure:"host"`
	ParseTime   bool   `mapstructure:"parse_time"`
}

type JWTConfig

type JWTConfig struct {
	Secret  string `mapstructure:"secret"`
	Timeout string `mapstructure:"timeout"`
}

type LogConfig

type LogConfig struct {
	Level string `mapstructure:"level"`
}

Jump to

Keyboard shortcuts

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