{"modulePath":"github.com/devfile/api/v2","version":"v2.3.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package validation\n\n## Constants\n\n```go\nconst (\n\t// EnvProjectsSrc is the env defined for path to the project source in a component container\n\tEnvProjectsSrc = \"PROJECT_SOURCE\"\n\n\t// EnvProjectsRoot is the env defined for project mount in a component container when component's mountSources=true\n\tEnvProjectsRoot = \"PROJECTS_ROOT\"\n)\n```\n\n```go\nconst (\n\t// attribute key of the imported element resource information\n\tImportSourceAttribute = \"api.devfile.io/imported-from\"\n\t// attribute key of the parent overridden element resource information\n\tParentOverrideAttribute = \"api.devfile.io/parent-override-from\"\n\t// attribute key of the plugin overridden element resource information\n\tPluginOverrideAttribute = \"api.devfile.io/plugin-override-from\"\n)\n```\nattribute keys for imported and overridden elements the value of those keys is the resource information\n\n## Functions\n\n```go\nfunc ValidateCommands(commands []v1alpha2.Command, components []v1alpha2.Component) (returnedErr error)\n```\nValidateCommands validates the devfile commands and checks: 1. there are no duplicate command ids 2. the command type is not invalid 3. if a command is part of a command group, there is a single default command\n\n```go\nfunc ValidateComponents(components []v1alpha2.Component) (returnedErr error)\n```\nValidateComponents validates that the components 1. makes sure the container components reference a valid volume component if it uses volume mounts 2. makes sure the volume components are unique 3. checks the URI specified in openshift components and kubernetes components are with valid format 4. makes sure the component name is unique 5. makes sure the image dockerfile component git src has at most one remote\n\n```go\nfunc ValidateEvents(events v1alpha2.Events, commands []v1alpha2.Command) (err error)\n```\nValidateEvents validates all the devfile events\n\n```go\nfunc ValidateProjects(projects []v1alpha2.Project) (returnedErr error)\n```\nValidateProjects checks if the project has more than one remote configured then a checkout remote is mandatory and if the checkout remote matches the renote configured\n\n```go\nfunc ValidateStarterProjects(starterProjects []v1alpha2.StarterProject) (returnedErr error)\n```\nValidateStarterProjects checks if starter project has only one remote configured and if the checkout remote matches the remote configured\n\n```go\nfunc ValidateURI(uri string) error\n```\nValidateURI checks if the string is with valid uri format, return error if not valid\n\n## Types\n\n```go\ntype AnnotationConflictError struct {\n\t// contains filtered or unexported fields\n}\n```\nAnnotationConflictError returns an error if an annotation has been declared with conflict values\n\n```go\nfunc (e *AnnotationConflictError) Error() string\n```\n\n```go\ntype AnnotationType string\n```\n\n```go\nconst (\n\tDeploymentAnnotation AnnotationType = \"deployment\"\n\tServiceAnnotation    AnnotationType = \"service\"\n)\n```\n\n```go\ntype InvalidCommandError struct {\n\t// contains filtered or unexported fields\n}\n```\nInvalidCommandError returns an error if the command is invalid\n\n```go\nfunc (e *InvalidCommandError) Error() string\n```\n\n```go\ntype InvalidCommandTypeError struct {\n\t// contains filtered or unexported fields\n}\n```\nInvalidCommandError returns an error if the command is invalid\n\n```go\nfunc (e *InvalidCommandTypeError) Error() string\n```\n\n```go\ntype InvalidComponentError struct {\n\t// contains filtered or unexported fields\n}\n```\nInvalidComponentError returns an error if the component is invalid\n\n```go\nfunc (e *InvalidComponentError) Error() string\n```\n\n```go\ntype InvalidEndpointError struct {\n\t// contains filtered or unexported fields\n}\n```\nInvalidEndpointError returns an error if the component endpoint is invalid\n\n```go\nfunc (e *InvalidEndpointError) Error() string\n```\n\n```go\ntype InvalidEventError struct {\n\t// contains filtered or unexported fields\n}\n```\nInvalidEventError returns an error if the devfile event type has invalid events\n\n```go\nfunc (e *InvalidEventError) Error() string\n```\n\n```go\ntype InvalidProjectCheckoutRemoteError struct {\n\t// contains filtered or unexported fields\n}\n```\nInvalidProjectCheckoutRemoteError returns an error if there is an unmatched, checkoutFrom remote specified\n\n```go\nfunc (e *InvalidProjectCheckoutRemoteError) Error() string\n```\n\n```go\ntype InvalidResourceRequestError struct {\n\t// contains filtered or unexported fields\n}\n```\nInvalidResourceRequestError returns an error if resource limit \\\u003c resource requested\n\n```go\nfunc (e *InvalidResourceRequestError) Error() string\n```\n\n```go\ntype InvalidVolumeError struct {\n\t// contains filtered or unexported fields\n}\n```\nInvalidVolumeError returns an error if the volume is invalid\n\n```go\nfunc (e *InvalidVolumeError) Error() string\n```\n\n```go\ntype MissingDefaultCmdWarning struct {\n\t// contains filtered or unexported fields\n}\n```\nMissingDefaultCmdWarning returns an error if there is no default command for a single group kind\n\n```go\nfunc (e *MissingDefaultCmdWarning) Error() string\n```\n\n```go\ntype MissingProjectCheckoutFromRemoteError struct {\n\t// contains filtered or unexported fields\n}\n```\nMissingProjectCheckoutFromRemoteError returns an error if there are multiple git remotes but the checkoutFrom remote has not been specified\n\n```go\nfunc (e *MissingProjectCheckoutFromRemoteError) Error() string\n```\n\n```go\ntype MissingProjectRemoteError struct {\n\t// contains filtered or unexported fields\n}\n```\nMissingProjectRemoteError returns an error if the git remotes object under a project is empty\n\n```go\nfunc (e *MissingProjectRemoteError) Error() string\n```\n\n```go\ntype MissingRemoteError struct {\n\t// contains filtered or unexported fields\n}\n```\nMissingRemoteError returns an error if the git remotes object is empty\n\n```go\nfunc (e *MissingRemoteError) Error() string\n```\n\n```go\ntype MissingVolumeMountError struct {\n\t// contains filtered or unexported fields\n}\n```\nMissingVolumeMountError returns an error if the container volume mount does not reference a valid volume component\n\n```go\nfunc (e *MissingVolumeMountError) Error() string\n```\n\n```go\ntype MultipleDefaultCmdError struct {\n\t// contains filtered or unexported fields\n}\n```\nMultipleDefaultCmdError returns an error if there are multiple default commands for a single group kind\n\n```go\nfunc (e *MultipleDefaultCmdError) Error() string\n```\n\n```go\ntype MultipleRemoteError struct {\n\t// contains filtered or unexported fields\n}\n```\nMultipleRemoteError returns an error if multiple git remotes are specified. There can only be one remote.\n\n```go\nfunc (e *MultipleRemoteError) Error() string\n```\n\n```go\ntype ParsingResourceRequirementError struct {\n\t// contains filtered or unexported fields\n}\n```\nParsingResourceRequirementError returns an error if failed to parse a resource requirement\n\n```go\nfunc (e *ParsingResourceRequirementError) Error() string\n```\n\n```go\ntype ReservedEnvError struct {\n\t// contains filtered or unexported fields\n}\n```\nReservedEnvError returns an error if the user attempts to customize a reserved ENV in a container\n\n```go\nfunc (e *ReservedEnvError) Error() string\n```\n\n```go\ntype ResourceRequirementType string\n```\n\n```go\nconst (\n\tMemoryLimit   ResourceRequirementType = \"memoryLimit\"\n\tCpuLimit      ResourceRequirementType = \"cpuLimit\"\n\tMemoryRequest ResourceRequirementType = \"memoryRequest\"\n\tCpuRequest    ResourceRequirementType = \"cpuRequest\"\n)\n```\n\n","path":"github.com/devfile/api/v2/pkg/validation","name":"validation","synopsis":"","isRedistributable":true}
