loadconf

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Name    string  `toml:"name"`
	Version string  `toml:"version"`
	Web     web     `toml:"web"`
	Db      db      `toml:"db"`
	Redis   redis   `toml:"redis"`
	LogConf logConf `toml:"logConf"`
}
var Config Configuration

type Loader

type Loader interface {
	LoadToStruct(config interface{}) error                                // 将解析的配置文件值、环境变量值映射到 配置结构体中
	SetConfigFileSearcher(configName string, searchPath ...string) Loader // 设置配置文件名称,路径多个
	EnableEnvSearcher(envPrefix string) Loader                            // 开启读取环境变量,设置环境变量前缀可选
}

func NewLoader

func NewLoader() (o Loader)

初始化配置

Jump to

Keyboard shortcuts

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