Documentation
¶
Index ¶
- type ActionOverConfig
- type ConfigTypeName
- type ConfigsPerEnvironment
- type ConfigsPerType
- type ConfigsPerTypePerEnvironments
- type DependenciesPerEnvironment
- type DuplicateConfigIdentifierError
- type EnvironmentName
- type Project
- func (p Project) ForEveryConfigDo(action ActionOverConfig)
- func (p Project) ForEveryConfigInEnvironmentDo(environment string, action ActionOverConfig)
- func (p Project) GetConfigFor(env string, c coordinate.Coordinate) (config.Config, bool)
- func (p Project) HasDependencyOn(environment string, project Project) bool
- func (p Project) String() string
- type ProjectID
- type ProjectLoaderContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionOverConfig ¶
ActionOverConfig is a function that will be performed over each config that is part of a project via a Project.ForEveryConfigDo method
type ConfigTypeName ¶
type ConfigTypeName = string
type ConfigsPerEnvironment ¶
type ConfigsPerEnvironment map[EnvironmentName][]config.Config
ConfigsPerEnvironment is a map of EnvironmentName to configs. This is a flattened version of ConfigsPerTypePerEnvironments
type ConfigsPerType ¶
type ConfigsPerType map[ConfigTypeName][]config.Config
ConfigsPerType is a map of ConfigTypeName string (e.g. API ID, settings schema, automation resource, ...) to configs of that type
func (ConfigsPerType) AllConfigs ¶
func (cpt ConfigsPerType) AllConfigs(yield func(config.Config) bool)
AllConfigs is an iterator iterating over all configs
type ConfigsPerTypePerEnvironments ¶
type ConfigsPerTypePerEnvironments map[EnvironmentName]ConfigsPerType
ConfigsPerTypePerEnvironments is a map of EnvironmentName to a ConfigsPerType map
type DependenciesPerEnvironment ¶
type DependenciesPerEnvironment map[EnvironmentName][]ProjectID
DependenciesPerEnvironment is a map of EnvironmentName to project IDs
type DuplicateConfigIdentifierError ¶
type DuplicateConfigIdentifierError struct {
// Location (coordinate) of the config.Config in whose ID overlaps with an existign one
Location coordinate.Coordinate `json:"location"`
// EnvironmentDetails of the environment for which the duplicate was loaded
EnvironmentDetails configErrors.EnvironmentDetails `json:"environmentDetails"`
}
DuplicateConfigIdentifierError occurs if configuration IDs are found more than once
func (DuplicateConfigIdentifierError) Coordinates ¶
func (e DuplicateConfigIdentifierError) Coordinates() coordinate.Coordinate
func (DuplicateConfigIdentifierError) Error ¶
func (e DuplicateConfigIdentifierError) Error() string
func (DuplicateConfigIdentifierError) LocationDetails ¶
func (e DuplicateConfigIdentifierError) LocationDetails() configErrors.EnvironmentDetails
type EnvironmentName ¶
type EnvironmentName = string
type Project ¶
type Project struct {
Id string
// set to the name defined in manifest if this project is part of a grouping, else will be empty
GroupId string
// Configs are the configurations within this Project
Configs ConfigsPerTypePerEnvironments
// Dependencies of this project to other projects
Dependencies DependenciesPerEnvironment
}
func LoadProjects ¶
func LoadProjects(ctx context.Context, fs afero.Fs, loaderContext ProjectLoaderContext, specificProjectNames []string) ([]Project, []error)
Tries to load the specified projects. If no project names are specified, all projects are loaded.
func (Project) ForEveryConfigDo ¶
func (p Project) ForEveryConfigDo(action ActionOverConfig)
ForEveryConfigDo executes the given ActionOverConfig actions for each configuration defined in the project for each environment Actions can not modify the configs inside the Project.
func (Project) ForEveryConfigInEnvironmentDo ¶
func (p Project) ForEveryConfigInEnvironmentDo(environment string, action ActionOverConfig)
ForEveryConfigInEnvironmentDo executes the given ActionOverConfig actions for each configuration defined in the project for a given environment. It behaves like ForEveryConfigDo just limited to a single environment. Actions can not modify the configs inside the Project.
func (Project) GetConfigFor ¶
func (p Project) GetConfigFor(env string, c coordinate.Coordinate) (config.Config, bool)
GetConfigFor searches a config object for matching the given coordinate in the current project.
func (Project) HasDependencyOn ¶
HasDependencyOn returns whether the project it is called on, has a dependency on the given project, for the given environment