Documentation
¶
Index ¶
- func All(environ []string, systemLookup func(string) string, noUnset bool) (map[string]string, error)
- func AllRaw(environ []string) map[string]string
- func Exists(environ []string, name string) bool
- func Lookup(environ []string, name string, systemLookup func(string) string) (string, bool, error)
- func LookupRaw(environ []string, name string) (string, bool)
- func StripExportPrefix(line string) string
- type GraphEvaluator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func All ¶
func All(environ []string, systemLookup func(string) string, noUnset bool) (map[string]string, error)
Evaluate an array of key=value strings in the dotenv syntax, and return a map of evaluated variables
func AllRaw ¶
Evaluate an array of key=value strings in the dotenv syntax, in raw mode: values are left unprocessed.
func Lookup ¶
Evaluate an array of key=value strings in the dotenv syntax, and return the value of the specified variable
func LookupRaw ¶
Evaluate an array of key=value strings in the dotenv syntax, and return the value of the specified variable in raw mode
func StripExportPrefix ¶ added in v0.21.4
StripExportPrefix removes an optional leading `export` keyword from a dotenv line. This is a widely supported convention (direnv, `set -a; . ./.env`, shell `source`, and most .env loaders), so `export KEY=value` is treated the same as `KEY=value`.
Types ¶
type GraphEvaluator ¶ added in v0.19.1
type GraphEvaluator struct {
NoUnset bool
// contains filtered or unexported fields
}
GraphEvaluator evaluates dotenv variables with dependency resolution and cycle detection
func NewGraphEvaluator ¶ added in v0.19.1
func NewGraphEvaluator(environ []string, systemLookup func(string) string, noUnset bool) (*GraphEvaluator, error)
NewGraphEvaluator creates a new graph-based evaluator