project

package
v2.26.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionOverConfig

type ActionOverConfig func(c config.Config)

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 (DuplicateConfigIdentifierError) Error

func (DuplicateConfigIdentifierError) LocationDetails

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

func (p Project) HasDependencyOn(environment string, project Project) bool

HasDependencyOn returns whether the project it is called on, has a dependency on the given project, for the given environment

func (Project) String

func (p Project) String() string

type ProjectID

type ProjectID = string

type ProjectLoaderContext

type ProjectLoaderContext struct {
	KnownApis       map[string]struct{}
	WorkingDir      string
	Manifest        manifest.Manifest
	ParametersSerde map[string]parameter.ParameterSerDe
}

Jump to

Keyboard shortcuts

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