{"modulePath":"github.com/devfile/api/v2","version":"v2.3.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package variables\n\n## Functions\n\n```go\nfunc ValidateAndReplaceForCommands(variables map[string]string, commands []v1alpha2.Command) map[string][]string\n```\nValidateAndReplaceForCommands validates the commands data for global variable references and replaces them with the variable value. Returns a map of command ids and invalid variable references if present.\n\n```go\nfunc ValidateAndReplaceForComponents(variables map[string]string, components []v1alpha2.Component) map[string][]string\n```\nValidateAndReplaceForComponents validates the components data for global variable references and replaces them with the variable value Returns a map of component names and invalid variable references if present.\n\n```go\nfunc ValidateAndReplaceForProjects(variables map[string]string, projects []v1alpha2.Project) map[string][]string\n```\nValidateAndReplaceForProjects validates the projects data for global variable references and replaces them with the variable value. Returns a map of project names and invalid variable references if present.\n\n```go\nfunc ValidateAndReplaceForStarterProjects(variables map[string]string, starterProjects []v1alpha2.StarterProject) map[string][]string\n```\nValidateAndReplaceForStarterProjects validates the starter projects data for global variable references and replaces them with the variable value. Returns a map of starter project names and invalid variable references if present.\n\n## Types\n\n```go\ntype InvalidKeysError struct {\n\tKeys []string\n}\n```\nInvalidKeysError returns an error for the invalid keys\n\n```go\nfunc (e *InvalidKeysError) Error() string\n```\n\n```go\ntype VariableWarning struct {\n\t// Commands stores a map of command ids to the invalid variable references\n\tCommands map[string][]string\n\n\t// Components stores a map of component names to the invalid variable references\n\tComponents map[string][]string\n\n\t// Projects stores a map of project names to the invalid variable references\n\tProjects map[string][]string\n\n\t// StarterProjects stores a map of starter project names to the invalid variable references\n\tStarterProjects map[string][]string\n\n\t// DependentProjects stores a map of dependent project names to invalid variable references\n\tDependentProjects map[string][]string\n}\n```\nVariableWarning stores the invalid variable references for each devfile object\n\n```go\nfunc ValidateAndReplaceGlobalVariable(workspaceTemplateSpec *v1alpha2.DevWorkspaceTemplateSpec) VariableWarning\n```\nValidateAndReplaceGlobalVariable validates the workspace template spec data for global variable references and replaces them with the variable value\n\n","path":"github.com/devfile/api/v2/pkg/validation/variables","name":"variables","synopsis":"","isRedistributable":true}
