{"modulePath":"github.com/redhat-developer/ODO","version":"v1.2.6","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package common\n\n## Types\n\n```go\ntype AlreadyExistError struct {\n\t// field which already exist\n\tField string\n\t// field name\n\tName string\n}\n```\nAlreadyExistError error returned if tried to add already existing field\n\n```go\nfunc (e *AlreadyExistError) Error() string\n```\n\n```go\ntype Composite struct {\n\t// Optional map of free-form additional command attributes\n\tAttributes map[string]string `json:\"attributes,omitempty\"`\n\n\t// The list of commands to execute in this composite command.\n\tCommands []string `json:\"commands,omitempty\"`\n\n\t// Defines the group this command is part of\n\tGroup *Group `json:\"group,omitempty\"`\n\n\t// Mandatory identifier that allows referencing this command in composite commands, or from a parent, or in events.\n\tId string `json:\"id\"`\n\n\t// Optional label that provides a label for this command to be used in Editor UI menus for example\n\tLabel string `json:\"label,omitempty\"`\n\n\t// Whether or not the composite command should be executed in parallel\n\tParallel bool `json:\"parallel,omitempty\"`\n}\n```\nComposite command containing a list of commands to execute in a component container\n\n```go\ntype Container struct {\n\n\t// The arguments to supply to the command running the dockerimage component. The arguments are supplied either to the default command provided in the image or to the overridden command. Defaults to an empty array, meaning use whatever is defined in the image.\n\tArgs []string `json:\"args,omitempty\" yaml:\"args,omitempty\" `\n\n\t// The command to run in the dockerimage component instead of the default one provided in the image. Defaults to an empty array, meaning use whatever is defined in the image.\n\tCommand []string `json:\"command,omitempty\" yaml:\"command,omitempty\"`\n\n\tEndpoints []Endpoint `json:\"endpoints,omitempty\" yaml:\"endpoints,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"name\"`\n\n\t// Environment variables used in this container\n\tEnv          []Env  `json:\"env,omitempty\" yaml:\"env,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"name\"`\n\tImage        string `json:\"image,omitempty\" yaml:\"image,omitempty\"`\n\tMemoryLimit  string `json:\"memoryLimit,omitempty\" yaml:\"memoryLimit,omitempty\"`\n\tMountSources bool   `json:\"mountSources,omitempty\" yaml:\"mountSources,omitempty\"`\n\tName         string `json:\"name\" yaml:\"name\"`\n\n\t// Optional specification of the path in the container where project sources should be transferred/mounted when `mountSources` is `true`. When omitted, the value of the `PROJECTS_ROOT` environment variable is used.\n\tSourceMapping string `json:\"sourceMapping,omitempty\" yaml:\"sourceMapping,omitempty\"`\n\n\t// List of volumes mounts that should be mounted is this container.\n\tVolumeMounts []VolumeMount `json:\"volumeMounts,omitempty\" yaml:\"volumeMounts,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"name\"`\n}\n```\nContainer Allows adding and configuring workspace-related containers\n\n```go\ntype DevfileCommand struct {\n\n\t// Composite command executed in a component container\n\tComposite *Composite `json:\"composite,omitempty\" yaml:\"composite,omitempty\"`\n\t// CLI Command executed in a component container\n\tExec *Exec `json:\"exec,omitempty\" yaml:\"exec,omitempty\"`\n}\n```\nDevfileCommand command specified in devfile\n\n```go\nfunc (dc DevfileCommand) GetGroup() *Group\n```\nGetGroup returns the group the command belongs to\n\n```go\nfunc (dc DevfileCommand) GetID() string\n```\nGetID returns the ID of the command\n\n```go\nfunc (dc *DevfileCommand) SetIDToLower() string\n```\nSetIDToLower converts the command's id to lower case for more efficient processing and returns the new id\n\n```go\ntype DevfileCommandGroupType string\n```\nDevfileCommandGroupType describes the kind of command group. +kubebuilder:validation:Enum=build;run;test;debug\n\n```go\nconst (\n\tBuildCommandGroupType DevfileCommandGroupType = \"build\"\n\tRunCommandGroupType   DevfileCommandGroupType = \"run\"\n\tTestCommandGroupType  DevfileCommandGroupType = \"test\"\n\tDebugCommandGroupType DevfileCommandGroupType = \"debug\"\n\t// To Support V1\n\tInitCommandGroupType DevfileCommandGroupType = \"init\"\n)\n```\n\n```go\ntype DevfileComponent struct {\n\n\t// Allows adding and configuring workspace-related containers\n\tContainer *Container `json:\"container,omitempty\" yaml:\"container,omitempty\"`\n\n\t// Allows importing into the workspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.\n\tKubernetes *Kubernetes `json:\"kubernetes,omitempty\" yaml:\"kubernetes,omitempty\"`\n\n\t// Allows importing into the workspace the OpenShift resources defined in a given manifest. For example this allows reusing the OpenShift definitions used to deploy some runtime components in production.\n\tOpenshift *Openshift `json:\"openshift,omitempty\" yaml:\"openshift,omitempty\"`\n\n\t// Allows specifying the definition of a volume shared by several other components\n\tVolume *Volume `json:\"volume,omitempty\" yaml:\"volume,omitempty\"`\n}\n```\nDevfileComponent component specified in devfile\n\n```go\ntype DevfileComponentType string\n```\nDevfileComponentType describes the type of component. Only one of the following component type may be specified To support some print actions\n\n```go\nconst (\n\tContainerComponentType  DevfileComponentType = \"Container\"\n\tKubernetesComponentType DevfileComponentType = \"Kubernetes\"\n\tOpenshiftComponentType  DevfileComponentType = \"Openshift\"\n\tPluginComponentType     DevfileComponentType = \"Plugin\"\n\tVolumeComponentType     DevfileComponentType = \"Volume\"\n\tCustomComponentType     DevfileComponentType = \"Custom\"\n)\n```\n\n```go\ntype DevfileEvents struct {\n\n\t// Names of commands that should be executed after the workspace is completely started. In the case of Che-Theia, these commands should be executed after all plugins and extensions have started, including project cloning. This means that those commands are not triggered until the user opens the IDE in his browser.\n\tPostStart []string `json:\"postStart,omitempty\" yaml:\"postStart,omitempty\"`\n\n\t// Names of commands that should be executed after stopping the workspace.\n\tPostStop []string `json:\"postStop,omitempty\" yaml:\"postStop,omitempty\"`\n\n\t// Names of commands that should be executed before the workspace start. Kubernetes-wise, these commands would typically be executed in init containers of the workspace POD.\n\tPreStart []string `json:\"preStart,omitempty\" yaml:\"preStart,omitempty\"`\n\n\t// Names of commands that should be executed before stopping the workspace.\n\tPreStop []string `json:\"preStop,omitempty\" yaml:\"preStop,omitempty\"`\n}\n```\nEvents Bindings of commands to events. Each command is referred-to by its name.\n\n```go\ntype DevfileMetadata struct {\n\n\t// Name Optional devfile name\n\tName string `json:\"name,omitempty\" yaml:\"name,omitempty\"`\n\n\t// Version Optional semver-compatible version\n\tVersion string `json:\"version,omitempty\" yaml:\"version,omitempty\"`\n}\n```\nDevfileMetadata metadata for devfile\n\n```go\ntype DevfileParent struct {\n\n\t// Id in a registry that contains a Devfile yaml file\n\tId string `json:\"id,omitempty\" yaml:\"id,omitempty\"`\n\n\t// Reference to a Kubernetes CRD of type DevWorkspaceTemplate\n\tKubernetes Kubernetes `json:\"kubernetes,omitempty\" yaml:\"kubernetes,omitempty\"`\n\n\t// Uri of a Devfile yaml file\n\tUri string `json:\"uri,omitempty\" yaml:\"uri,omitempty\"`\n\n\tRegistryUrl string `json:\"registryUrl,omitempty\" yaml:\"registryUrl,omitempty\"`\n\n\t// Projects worked on in the workspace, containing names and sources locations\n\tProjects []DevfileProject `json:\"projects,omitempty\" yaml:\"projects,omitempty\"`\n\n\t// Predefined, ready-to-use, workspace-related commands\n\tCommands []DevfileCommand `json:\"commands,omitempty\" yaml:\"commands,omitempty\"`\n\n\t// List of the workspace components, such as editor and plugins, user-provided containers, or other types of components\n\tComponents []DevfileComponent `json:\"components,omitempty\" yaml:\"components,omitempty\"`\n\n\t// Bindings of commands to events. Each command is referred-to by its name.\n\tEvents DevfileEvents `json:\"events,omitempty\" yaml:\"events,omitempty\"`\n\n\t// StarterProjects is a project that can be used as a starting point when bootstrapping new projects\n\tStarterProjects []DevfileStarterProject `json:\"starterProjects,omitempty\" yaml:\"starterProjects,omitempty\"`\n}\n```\nDevfileParent Parent workspace template\n\n```go\ntype DevfileProject struct {\n\n\t// Path relative to the root of the projects to which this project should be cloned into. This is a unix-style relative path (i.e. uses forward slashes). The path is invalid if it is absolute or tries to escape the project root through the usage of '..'. If not specified, defaults to the project name.\n\tClonePath string `json:\"clonePath,omitempty\" yaml:\"clonePath,omitempty\"`\n\n\t// Project's Git source\n\tGit *Git `json:\"git,omitempty\" yaml:\"git,omitempty\"`\n\n\t// Project's GitHub source\n\tGithub *Github `json:\"github,omitempty\" yaml:\"github,omitempty\"`\n\n\t// Project name\n\tName string `json:\"name\" yaml:\"name\"`\n\n\t// Project's Zip source\n\tZip *Zip `json:\"zip,omitempty\" yaml:\"zip,omitempty\"`\n}\n```\nDevfileProject project defined in devfile\n\n```go\ntype DevfileStarterProject struct {\n\n\t// Project name\n\tName string `json:\"name\" yaml:\"name\"`\n\n\t// Description of a starter project\n\tDescription string `json:\"description,omitempty\" yaml:\"description,omitempty\"`\n\n\t// Description of a starter project\n\tMarkdownDescription string `json:\"markdownDescription,omitempty\" yaml:\"markdownDescription,omitempty\"`\n\n\t// Path relative to the root of the projects to which this project should be cloned into. This is a unix-style relative path (i.e. uses forward slashes). The path is invalid if it is absolute or tries to escape the project root through the usage of '..'. If not specified, defaults to the project name.\n\tClonePath string `json:\"clonePath,omitempty\" yaml:\"clonePath,omitempty\"`\n\n\t// Project's Git source\n\tGit *Git `json:\"git,omitempty\" yaml:\"git,omitempty\"`\n\n\t// Project's GitHub source\n\tGithub *Github `json:\"github,omitempty\" yaml:\"github,omitempty\"`\n\n\t// Project's Zip source\n\tZip *Zip `json:\"zip,omitempty\" yaml:\"zip,omitempty\"`\n}\n```\nDevfileStarterProject getting started project\n\n```go\ntype Endpoint struct {\n\tAttributes map[string]string `json:\"attributes,omitempty\" yaml:\"attributes,omitempty\"`\n\n\t// Describes how the endpoint should be exposed on the network. public|internal|none. Default value is \"public\"\n\tExposure string `json:\"exposure,omitempty\" yaml:\"exposure,omitempty\"`\n\n\tPath       string `json:\"path,omitempty\" yaml:\"path,omitempty\"`\n\tSecure     bool   `json:\"secure,omitempty\" yaml:\"secure,omitempty\"`\n\tName       string `json:\"name\" yaml:\"name\"`\n\tTargetPort int32  `json:\"targetPort\" yaml:\"targetPort\"`\n\n\t// Describes the application and transport protocols of the traffic that will go through this endpoint. Default value is \"http\"\n\tProtocol string `json:\"protocol,omitempty\" yaml:\"protocol,omitempty\"`\n}\n```\nEndpoint holds information about how an application is exposed\n\n```go\ntype Env struct {\n\tName  string `json:\"name\" yaml:\"name\"`\n\tValue string `json:\"value\" yaml:\"value\"`\n}\n```\nEnv\n\n```go\ntype Exec struct {\n\n\t// Optional map of free-form additional command attributes\n\tAttributes map[string]string `json:\"attributes,omitempty\" yaml:\"attributes,omitempty\" patchStrategy:\"merge\"`\n\n\t// The actual command-line string\n\tCommandLine string `json:\"commandLine,omitempty\" yaml:\"commandLine,omitempty\"`\n\n\t// Describes component to which given action relates\n\tComponent string `json:\"component,omitempty\" yaml:\"component,omitempty\"`\n\n\t// Optional list of environment variables that have to be set before running the command\n\tEnv []Env `json:\"env,omitempty\" yaml:\"env,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"name\"`\n\n\t// Defines the group this command is part of\n\tGroup *Group `json:\"group,omitempty\" yaml:\"group,omitempty\"`\n\n\t// Mandatory identifier that allows referencing this command in composite commands, or from a parent, or in events.\n\tId string `json:\"id\" yaml:\"id\"`\n\n\t// Optional label that provides a label for this command to be used in Editor UI menus for example\n\tLabel string `json:\"label,omitempty\" yaml:\"label,omitempty\"`\n\n\t// Working directory where the command should be executed\n\tWorkingDir string `json:\"workingDir,omitempty\" yaml:\"workingDir,omitempty\"`\n\n\t// +optional\n\t// Whether the command is capable to reload itself when source code changes.\n\t// If set to `true` the command won't be restarted and it is expected to handle file changes on its own.\n\t//\n\t// Default value is `false`\n\tHotReloadCapable bool `json:\"hotReloadCapable,omitempty\" yaml:\"hotReloadCapable,omitempty\"`\n}\n```\nExec CLI Command executed in a component container\n\n```go\ntype Git struct {\n\n\t// The branch to check\n\tBranch string `json:\"branch,omitempty\" yaml:\"branch,omitempty\"`\n\n\t// Project's source location address. Should be URL for git and github located projects, or; file:// for zip\n\tLocation string `json:\"location,omitempty\" yaml:\"location,omitempty\"`\n\n\t// Part of project to populate in the working directory.\n\tSparseCheckoutDir string `json:\"sparseCheckoutDir,omitempty\" yaml:\"sparseCheckoutDir,omitempty\"`\n\n\t// The tag or commit id to reset the checked out branch to\n\tStartPoint string `json:\"startPoint,omitempty\" yaml:\"startPoint,omitempty\"`\n}\n```\nGit Project's Git source\n\n```go\ntype Github struct {\n\n\t// The branch to check\n\tBranch string `json:\"branch,omitempty\" yaml:\"branch,omitempty\"`\n\n\t// Project's source location address. Should be URL for git and github located projects, or; file:// for zip\n\tLocation string `json:\"location,omitempty\" yaml:\"location,omitempty\"`\n\n\t// Part of project to populate in the working directory.\n\tSparseCheckoutDir string `json:\"sparseCheckoutDir,omitempty\" yaml:\"sparseCheckoutDir,omitempty\"`\n\n\t// The tag or commit id to reset the checked out branch to\n\tStartPoint string `json:\"startPoint,omitempty\" yaml:\"startPoint,omitempty\"`\n}\n```\nGithub Project's GitHub source\n\n```go\ntype Group struct {\n\n\t// Identifies the default command for a given group kind\n\tIsDefault bool `json:\"isDefault,omitempty\" yaml:\"isDefault,omitempty\"`\n\n\t// Kind of group the command is part of\n\tKind DevfileCommandGroupType `json:\"kind\" yaml:\"kind\"`\n}\n```\nGroup Defines the group this command is part of\n\n```go\ntype Kubernetes struct {\n\n\t// Inlined manifest\n\tInlined string `json:\"inlined,omitempty\" yaml:\"inlined,omitempty\"`\n\n\t// Mandatory name that allows referencing the component in commands, or inside a parent\n\tName string `json:\"name\" yaml:\"name\"`\n\n\t// Location in a file fetched from a uri.\n\tUri string `json:\"uri,omitempty\" yaml:\"uri,omitempty\"`\n}\n```\nKubernetes Allows importing into the workspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy some runtime components in production.\n\n```go\ntype NotFoundError struct {\n\t// field which doesn't exist\n\tField string\n\t// field name\n\tName string\n}\n```\nNotFoundError error returned if the field with the name is not found\n\n```go\nfunc (e *NotFoundError) Error() string\n```\n\n```go\ntype Openshift struct {\n\n\t// Inlined manifest\n\tInlined string `json:\"inlined,omitempty\" yaml:\"inlined,omitempty\"`\n\n\t// Mandatory name that allows referencing the component in commands, or inside a parent\n\tName string `json:\"name\" yaml:\"name\"`\n\n\t// Location in a file fetched from a uri.\n\tUri string `json:\"uri,omitempty\" yaml:\"uri,omitempty\"`\n}\n```\nOpenshift Configuration overriding for an OpenShift component\n\n```go\ntype Plugin struct {\n\n\t// Overrides of commands encapsulated in a plugin. Overriding is done using a strategic merge\n\tCommands []*DevfileCommand `json:\"commands,omitempty\" yaml:\"commands,omitempty\"`\n\n\t// Overrides of components encapsulated in a plugin. Overriding is done using a strategic merge\n\tComponents []*DevfileComponent `json:\"components,omitempty\" yaml:\"components,omitempty\"`\n\n\t// Id in a registry that contains a Devfile yaml file\n\tId string `json:\"id,omitempty\" yaml:\"id,omitempty\"`\n\n\t// Reference to a Kubernetes CRD of type DevWorkspaceTemplate\n\tKubernetes *Kubernetes `json:\"kubernetes,omitempty\" yaml:\"kubernetes,omitempty\"`\n\n\t// Optional name that allows referencing the component in commands, or inside a parent If omitted it will be infered from the location (uri or registryEntry)\n\tName        string `json:\"name,omitempty\" yaml:\"name,omitempty\"`\n\tRegistryUrl string `json:\"registryUrl,omitempty\" yaml:\"registryUrl,omitempty\"`\n\n\t// Uri of a Devfile yaml file\n\tUri string `json:\"uri,omitempty\" yaml:\"uri,omitempty\"`\n}\n```\nPlugin Allows importing a plugin. Plugins are mainly imported devfiles that contribute components, commands and events as a consistent single unit. They are defined in either YAML files following the devfile syntax, or as \\`DevWorkspaceTemplate\\` Kubernetes Custom Resources\n\n```go\ntype Volume struct {\n\n\t// Mandatory name that allows referencing the Volume component in Container volume mounts or inside a parent\n\tName string `json:\"name\" yaml:\"name\"`\n\n\t// Size of the volume\n\tSize string `json:\"size,omitempty\" yaml:\"size,omitempty\"`\n}\n```\nVolume Allows specifying the definition of a volume shared by several other components\n\n```go\ntype VolumeMount struct {\n\n\t// The volume mount name is the name of an existing `Volume` component. If several containers mount the same volume name then they will reuse the same volume and will be able to access to the same files.\n\tName string `json:\"name\" yaml:\"name\"`\n\n\t// The path in the component container where the volume should be mounted. If not path is mentioned, default path is the is `/\u003cname\u003e`.\n\tPath string `json:\"path,omitempty\" yaml:\"path,omitempty\"`\n}\n```\nVolumeMount describes a path where a volume should be mounted to a component container\n\n```go\ntype Zip struct {\n\n\t// Project's source location address. Should be URL for git and github located projects, or; file:// for zip\n\tLocation string `json:\"location,omitempty\" yaml:\"location,omitempty\"`\n\n\t// Part of project to populate in the working directory.\n\tSparseCheckoutDir string `json:\"sparseCheckoutDir,omitempty\" yaml:\"sparseCheckoutDir,omitempty\"`\n}\n```\nZip Project's Zip source\n\n","path":"github.com/redhat-developer/ODO/pkg/devfile/parser/data/common","name":"common","synopsis":"","isRedistributable":true}
