conf

package
v0.0.0-...-d57715f Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 环境
	EnvDebug = "debug" // 开启了debug
	EnvDev   = "dev"   // 开发环境
	EnvTest  = "sit"   // 测试环境
	EnvProd  = "prod"  // 生产环境
)

Variables

This section is empty.

Functions

func Confer

func Confer() *viper.Viper

func GetBool

func GetBool(s string) bool

func GetDuration

func GetDuration(s string) time.Duration

func GetDurationD

func GetDurationD(s string, d time.Duration) time.Duration

GetDurationD GetDuration with a default value

func GetEnv

func GetEnv() string

func GetInt

func GetInt(s string) int

func GetIntD

func GetIntD(s string, d int) int

GetIntD GetInt with a default value

func GetString

func GetString(s string) string

func GetStringD

func GetStringD(s string, d string) string

GetStringD GetString with a default value

func GetStringMapString

func GetStringMapString(s string) map[string]string

func GetStringSlice

func GetStringSlice(s string) []string

func IsDebug

func IsDebug() bool

func IsEnv

func IsEnv() bool

func IsProd

func IsProd() bool

func Setup

func Setup(path string, common ...string)

func UnmarshalKey

func UnmarshalKey(s string, rawVal interface{}) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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