config

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: GPL-3.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnv

func GetEnv(env string) string

GetEnv 获取环境变量

func GetProperties

func GetProperties(envParams ...string) (*properties.Properties, error)

GetProperties 读取环境变量ENV,读取参数 --env 读取配置的目录:程序所在目录,程序运行目录 配置文件读取顺序:config/default.properties,config/${env}.properties,后面的覆盖前面的

func GetTestProperties

func GetTestProperties() (props *properties.Properties, err error)

func NewConfig

func NewConfig() (gone.Vampire, gone.GonerId)

func NewConfigure

func NewConfigure() (gone.Goner, gone.GonerId)

func Priest

func Priest(cemetery gone.Cemetery) error

Types

type Configure

type Configure interface {
	//GetProperties 将获取`key`所对应的值,值将写入到参数`v`中;参数`v`,只接受指针类型;如果`key`对应的值不存在,将使用defaultVal
	Get(key string, v any, defaultVal string) error
}

Configure 配置接口

Jump to

Keyboard shortcuts

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