config

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitConfig

func InitConfig(filepath string)

InitConfig 初始化配置

Types

type AppConfig

type AppConfig struct {
	Release bool
	Http    struct {
		Addr string `toml:"addr" yaml:"addr"`
	}
	Mysql struct {
		Addr   string `toml:"addr" yaml:"addr"`
		User   string `toml:"user" yaml:"user"`
		Pwd    string `toml:"pwd" yaml:"pwd"`
		DbName string `toml:"db_name" yaml:"db_name"`
	}
	Mqtt struct {
		Addr string `toml:"addr" yaml:"addr"`
		User string `toml:"user" yaml:"user"`
		Pwd  string `toml:"pwd" yaml:"pwd"`
	}
}

func Get

func Get() *AppConfig

Get 获取配置,返回配置实例和错误

Jump to

Keyboard shortcuts

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