Documentation
¶
Overview ¶
Package profile provides profile and store management for environment variable sets.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrUnsupportedFileType is returned when the file type is not supported. ErrUnsupportedFileType = errors.New("unsupported file type") // ErrProfileNotFound is returned when a profile is not found in the store. ErrProfileNotFound = errors.New("profile not found") )
Functions ¶
Types ¶
type Env ¶
Env is a map of environment variable names to their non-stringified values.
func (*Env) Stringified ¶ added in v0.0.1
Stringified serializes Env into env.Env using Stringify. – Scalars pass through unchanged. – Non-scalars are JSON-minified and single-quoted (see Stringify).
type Inheritance ¶
Inheritance carries a mapping from environment variable names to where they are inherited from.
type InheritanceTracker ¶ added in v0.0.1
type InheritanceTracker struct {
// Inheritance is a mapping from environment variable names to where they are inherited from.
Inheritance Inheritance
// Env is the environment variables.
Env env.Env
// Name is the name of the profile.
Name string
}
InheritanceTracker holds the environment variables and their inheritance sources.
type Profile ¶
type Profile struct {
Env Env `toml:"env,omitempty" yaml:"env,omitempty"`
DotEnv []string `toml:"dotenv,omitempty" yaml:"dotenv,omitempty"`
Extends []string `toml:"extends,omitempty" yaml:"extends,omitempty"`
}
Profile holds metadata plus an env-var map.
type Profiles ¶
Profiles is a map of profile names to their metadata.
func (Profiles) Environment ¶ added in v0.0.1
func (p Profiles) Environment(name string) (*InheritanceTracker, error)
Environment returns the merged environment variables for a profile, resolving dependencies.