config

package
v0.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingEnvDefault = errors.New("missing default env config")
	ErrParseEnvFail      = errors.New("fail to parse env config")
)

Functions

func Parse

func Parse[Config any](content string) (Config, error)

Parse 从toml和env中解析配置出内容

func ParseEnv

func ParseEnv[Config any](currentEnv string, defaultConfig map[string]Config) (Config, error)

ParseEnv 根据当前env解析配置内容,解析优先级如下

  • toml中定义的对应env下的配置
  • env中定义的环境变量配置
  • toml中定义的default配置

Types

This section is empty.

Jump to

Keyboard shortcuts

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