config

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProdConfig product config
	ProdConfig = "config.toml"
	// TestConfig test config
	TestConfig = "test-config.toml"
)

Variables

View Source
var Global = &Config{}
View Source
var JWT = &(Global.JWT)
View Source
var Mail = &(Global.Email)
View Source
var MySQL = &(Global.MySQL)

Functions

func LoadConfig

func LoadConfig(filePath string)

Types

type Config

type Config struct {
	Bind   string
	Secret string
	Email  struct {
		Host     string
		Port     int
		Username string
		Password string
	} `json:"email"`
	JWT struct {
		Expire string
		Key    string
	} `json:"jwt"`
	MySQL struct {
		DSN     string
		LogMode bool
	} `json:"mysql"`
}

Config 配置结构体

Jump to

Keyboard shortcuts

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