envfile

package
v0.46.3 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package envfile parses .env files into key/value pairs.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("no volcano.env file found.\ncreate volcano/volcano.env or use --file to specify a path")

ErrNotFound is returned when no path is given and neither default location holds an env file.

Functions

func LoadFirstEnvVars

func LoadFirstEnvVars(candidates ...string) ([]string, error)

LoadFirstEnvVars reads the first existing env file from candidates and returns its variables as sorted KEY=value entries. If no candidate exists, it returns nil and no error.

func ResolvePath added in v0.45.0

func ResolvePath(fileArg string) (string, error)

ResolvePath returns the env file Load would read. An explicit path must exist; otherwise it looks for volcano/volcano.env and ./volcano.env, returns ErrNotFound when neither exists, and an error when both do.

Types

type File

type File struct {
	Path      string
	Variables map[string]string
}

File is a loaded Volcano env file.

func Load

func Load(fileArg string) (*File, error)

Load resolves and reads the selected Volcano env file.

Jump to

Keyboard shortcuts

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