config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ReleaseMode = "release"
	DebugMode   = "debug"
)
View Source
var Val struct {
	Server struct {
		Address string `mapstructure:"address" validate:"required"`
		Mode    string `mapstructure:"mode" validate:"oneof=debug release"`
		DB      string `mapstructure:"db" validate:"required"`
	} `mapstructure:"server" validate:"required"`
	Log struct {
		Filename string `mapstructure:"filename" validate:"required"`
		MaxSize  int    `mapstructure:"max_size" validate:"gt=0"`
		MaxAge   int    `mapstructure:"max_age" validate:"gt=0"`
	} `mapstructure:"log" validate:"required"`
	Setting struct {
		AutoOpenBrowser bool   `mapstructure:"auto_open_browser"` // 启动项目时是否自动打开浏览器访问 http://${Val.Server.Address}
		FileStorePath   string `mapstructure:"file_store_path"`
	} `mapstructure:"setting" validate:"required"`
}

Functions

func Init

func Init(name string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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