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.
func (InheritanceTracker) Format ¶ added in v0.0.1
func (i InheritanceTracker) Format(key string, verbose, withKey bool) string
Format returns the formatted value of a single variable.
type Profiles ¶
type Profiles map[string]*profile
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.