loader

package
v2.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(context *Context) (manifest.Manifest, []error)

Types

type Context

type Context struct {
	// Fs holds the abstraction of the file system.
	Fs afero.Fs

	// ManifestPath holds the path from where the manifest should be loaded.
	ManifestPath string

	// Environments is a filter to what environments should be loaded.
	// If it's empty, all environments are loaded.
	// If both Environments and Groups are specified, the union of both results is returned.
	//
	// If Environments contains items that do not match any environment in the specified manifest file, the loading errors.
	Environments []string

	// Groups is a filter to what environment-groups (and thus environments) should be loaded.
	// If it's empty, all environment-groups are loaded.
	// If both Environments and Groups are specified, the union of both results is returned.
	//
	// If Groups contains items that do not match any environment in the specified manifest file, the loading errors.
	Groups []string

	// Opts are Options holding optional configuration for Load
	Opts Options
}

Context holds all information for Load

type EnvironmentDetails

type EnvironmentDetails struct {
	Group       string `json:"group"`
	Environment string `json:"environment"`
}

type EnvironmentLoaderError

type EnvironmentLoaderError struct {
	ManifestLoaderError
	// EnvironmentDetails of the environment that failed to be loaded
	EnvironmentDetails EnvironmentDetails `json:"environmentDetails"`
}

func (EnvironmentLoaderError) Error

func (e EnvironmentLoaderError) Error() string

type ManifestLoaderError

type ManifestLoaderError struct {
	// ManifestPath is the path of the manifest file that failed to load
	ManifestPath string `json:"manifestPath"`
	// Reason describing what went wrong
	Reason string `json:"reason"`
}

func (ManifestLoaderError) Error

func (e ManifestLoaderError) Error() string

type Options

type Options struct {
	DoNotResolveEnvVars      bool
	RequireEnvironmentGroups bool
	RequireAccounts          bool
}

Options are optional configuration for Load

type ProjectLoaderError

type ProjectLoaderError struct {
	ManifestLoaderError
	// Project name that failed to be loaded
	Project string `json:"project"`
}

func (ProjectLoaderError) Error

func (e ProjectLoaderError) Error() string

Jump to

Keyboard shortcuts

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