config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Inject added in v1.0.0

func Inject(container *dig.Container)

Types

type Config

type Config struct {
	*viper.Viper
	// 运行环境
	Environment string
	// 应用名称
	Name string
}

Config 配置

func New

func New() *Config

New 实例

func (*Config) GetDefaultInt added in v1.0.0

func (conf *Config) GetDefaultInt(key string, dn int) int

GetDefaultInt get int with default value

func (*Config) GetDefaultString added in v1.0.0

func (conf *Config) GetDefaultString(key string, ds string) string

GetDefaultString get string with default value

func (*Config) IsDevelop added in v1.0.0

func (conf *Config) IsDevelop() bool

IsDevelop 是否为测试环境

func (*Config) IsProduct added in v0.9.16

func (conf *Config) IsProduct() bool

IsProduct 是否为生产环境

func (*Config) LoadFile

func (conf *Config) LoadFile(path ...string) error

LoadFile 加载配置文件

Jump to

Keyboard shortcuts

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