configfile

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EnvPath 是 FlowLink 运行配置默认读取的路径环境变量。
	EnvPath = "FLOWLINK_CONFIG"
)

Variables

This section is empty.

Functions

func Load

func Load(path string, target interface{}, options ...Option) error

Load 按 Switch 配置约定读取一个文件或环境目录,并反序列化到 target。

target 由调用方提供,configfile 只负责环境解析、文件发现和 YAML 解析, 不理解 FlowLink 的具体配置结构。

Types

type Option

type Option func(*loadOptions)

Option 调整 FlowLink 文件配置加载行为。

func WithDefaultEnv

func WithDefaultEnv(env string) Option

WithDefaultEnv 设置 APP_ENV 为空时使用的默认环境。

func WithFilePattern

func WithFilePattern(pattern string) Option

WithFilePattern 设置目录模式下匹配的配置文件名。

Jump to

Keyboard shortcuts

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