{"modulePath":"github.com/redhat-developer/ODO","version":"v1.2.6","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package parser\n\n## Constants\n\n```go\nconst (\n\tName              = \"Name\"\n\tPorts             = \"Ports\"\n\tMemory            = \"Memory\"\n\tPortsDescription  = \"Ports to be opened in all component containers\"\n\tMemoryDescription = \"The Maximum memory all the component containers can consume\"\n\tNameDescription   = \"The name of the component\"\n)\n```\n\n```go\nconst (\n\tOutputDevfileJsonPath = \"devfile.json\"\n\tOutputDevfileYamlPath = \"devfile.yaml\"\n)\n```\nDefault filenames for create devfile\n\n## Functions\n\n```go\nfunc AsDevfileSupportedParameter(param string) (string, bool)\n```\nAsDevfileSupportedParameter returns the parameter in lower case and a boolean indicating if it is a supported parameter\n\n```go\nfunc FormatDevfileSupportedParameters() (result string)\n```\nFormatDevfileSupportedParameters outputs supported parameters and their description\n\n```go\nfunc GetDevfileSupportedParameters() []string\n```\nGetDevfileSupportedParameters returns the name of the supported global parameters\n\n## Types\n\n```go\ntype ConfigurableRepr struct {\n\tName    string          `yaml:\"ComponentName,omitempty\" json:\"ComponentName,omitempty\"`\n\tMemory  string          `yaml:\"Memory,omitempty\" json:\"Memory,omitempty\"`\n\tConfigs []ContainerRepr `yaml:\"Configs,omitempty\" json:\"Configs,omitempty\"`\n}\n```\n\n```go\ntype ContainerRepr struct {\n\tContainerName        string            `yaml:\"ContainerName\" json:\"ContainerName\"`\n\tEnvironmentVariables config.EnvVarList `yaml:\"EnvironmentVariables\" json:\"EnvironmentVariables,omitempty\"`\n\tPorts                []PortRepr        `yaml:\"Ports\" json:\"Ports,omitempty\"`\n}\n```\n\n```go\ntype DevfileObj struct {\n\n\t// Ctx has devfile context info\n\tCtx devfileCtx.DevfileCtx\n\n\t// Data has the devfile data\n\tData data.DevfileData\n}\n```\nDevfileObj is the runtime devfile object\n\n```go\nfunc Parse(path string) (d DevfileObj, err error)\n```\nParse func populates the devfile data, parses and validates the devfile integrity. Creates devfile context and runtime objects\n\n```go\nfunc ParseFromURL(url string) (d DevfileObj, err error)\n```\nParseFromURL func parses and validates the devfile integrity. Creates devfile context and runtime objects\n\n```go\nfunc (d DevfileObj) AddEnvVars(otherList config.EnvVarList) error\n```\nAddEnvVars adds environment variables to all the components in a devfile\n\n```go\nfunc (d DevfileObj) DeleteConfiguration(parameter string) error\n```\nDeleteConfiguration allows deleting  the parameters that are configurable in a devfile\n\n```go\nfunc (d DevfileObj) IsSet(parameter string) bool\n```\nIsSet checks if a parameter is set in the devfile\n\n```go\nfunc (d DevfileObj) OverrideCommands(overridePatch []common.DevfileCommand) error\n```\nOverrideCommands overrides the commands of the parent devfile overridePatch contains the patches to be applied to the parent's commands\n\n```go\nfunc (d DevfileObj) OverrideComponents(overridePatch []common.DevfileComponent) error\n```\nOverrideComponents overrides the components of the parent devfile overridePatch contains the patches to be applied to the parent's components\n\n```go\nfunc (d DevfileObj) OverrideEvents(overridePatch common.DevfileEvents) error\n```\nOverrideEvents overrides the events of the parent devfile overridePatch contains the patches to be applied to the parent's events\n\n```go\nfunc (d DevfileObj) OverrideProjects(overridePatch []common.DevfileProject) error\n```\nOverrideProjects overrides the projects of the parent devfile overridePatch contains the patches to be applied to the parent's projects\n\n```go\nfunc (d DevfileObj) OverrideStarterProjects(overridePatch []common.DevfileStarterProject) error\n```\nOverrideStarterProjects overrides the starter projects of the parent devfile overridePatch contains the patches to be applied to the parent's starter projects\n\n```go\nfunc (d DevfileObj) RemoveEnvVars(keys []string) error\n```\nRemoveEnvVars removes the environment variables which have the keys from all the components in a devfile\n\n```go\nfunc (d DevfileObj) SetConfiguration(parameter string, value interface{}) error\n```\nSetConfiguration allows setting all the parameters that are configurable in a devfile\n\n```go\nfunc (d DevfileObj) ToRepresentation() ConfigurableRepr\n```\n\n```go\nfunc (d DevfileObj) WrapFromJSONOutput(confRepr ConfigurableRepr) JSONConfigRepr\n```\n\n```go\nfunc (d *DevfileObj) WriteJsonDevfile() error\n```\nWriteJsonDevfile creates a devfile.json file\n\n```go\nfunc (d *DevfileObj) WriteYamlDevfile() error\n```\nWriteYamlDevfile creates a devfile.yaml file\n\n```go\ntype JSONConfigRepr struct {\n\tmetav1.TypeMeta   `json:\",inline\"`\n\tmetav1.ObjectMeta `json:\"metadata,omitempty\"`\n\tDevfileConfigSpec ConfigurableRepr `json:\"spec\" yaml:\"spec\"`\n}\n```\n\n```go\ntype PortRepr struct {\n\tName        string `yaml:\"Name\" json:\"Name\"`\n\tExposedPort int32  `yaml:\"ExposedPort\" json:\"ExposedPort\"`\n\tProtocol    string `yaml:\"Protocol\" json:\"Protocol\"`\n}\n```\n\n","path":"github.com/redhat-developer/ODO/pkg/devfile/parser","name":"parser","synopsis":"","isRedistributable":true}
