config

package
v0.1.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const SliceMaxSize = 100

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 ParseConfAnnotation added in v0.0.22

func ParseConfAnnotation(tag string) (key string, defaultVal string)

func Priest

func Priest(cemetery gone.Cemetery) error

Types

type Configure

type Configure interface {
	//Get 将获取`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