creds

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindDotEnvExample added in v1.0.9

func FindDotEnvExample() string

FindDotEnvExample tries to locate a .env.example (template) file. It does NOT load it into process env (templates often contain placeholders). FindDotEnvExample 会尝试定位 .env.example(模板)文件路径。 注意:不会加载模板到进程环境变量(模板通常是占位符,直接加载反而会误导)。

func Get

func Get(key string) string

Get 返回指定 key 的凭据值:先查环境变量,再查 credentials.yaml。

func LoadDotEnv

func LoadDotEnv() (string, error)

LoadDotEnv 会尝试加载固定路径的 .env 文件到进程环境变量中(仅填充尚未设置的 key)。 返回:成功加载的 .env 路径(若未找到则为空)。

func LoadError

func LoadError() error

LoadError 返回读取 credentials.yaml 的错误(如果有)。 便于上层在需要时输出诊断信息。

Types

This section is empty.

Source Files

  • creds.go
  • dotenv.go

Jump to

Keyboard shortcuts

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