config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInt64D

func GetInt64D(key string, defaultVal int64) int64

--------------------------------------------------

func GetInt64E

func GetInt64E(key string) (int64, error)

func GetInt64M

func GetInt64M(key string) int64

func GetStringD

func GetStringD(key string, defaultVal string) string

--------------------------------------------------

func GetStringE

func GetStringE(key string) (string, error)

func GetStringM

func GetStringM(key string) string

func InitConfig

func InitConfig(confPath string) (err error)

func MustGetConfig

func MustGetConfig() config.Config

func MustInitConfig

func MustInitConfig(confFolder string)

func Scan

func Scan(v any) (err error)

支持定义结构体来解析配置

func SetDefaults

func SetDefaults(ptr any) error

-------------------------------------------------- 支持代码配置默认值,支持字符串/整形/浮点型/布尔型 通过Tag如`default:"10"`来设置默认值,值都使用字符串来填写

Types

This section is empty.

Jump to

Keyboard shortcuts

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