diff --git a/pkg/api/component.go b/pkg/api/component.go new file mode 100644 index 00000000000..fd05167356a --- /dev/null +++ b/pkg/api/component.go @@ -0,0 +1,24 @@ +package api + +type RunningMode string + +const ( + RunninModeDev = "Dev" + RunninModeDeploy = "Deploy" + RunninModeUnknown = "Unknown" +) + +// Component describes the state of a devfile component +type Component struct { + DevfilePath string `json:"devfilePath"` + DevfileData DevfileData `json:"devfileData"` + ForwardedPorts []ForwardedPort `json:"forwardedPorts"` + RunningIn []RunningMode `json:"runningIn"` + ManagedBy string `json:"managedBy"` +} + +type ForwardedPort struct { + ContainerName string `json:"containerName"` + LocalPort int `json:"localPort"` + ContainerPort int `json:"containerPort"` +} diff --git a/pkg/api/devfile-data.go b/pkg/api/devfile-data.go new file mode 100644 index 00000000000..9e0826889dd --- /dev/null +++ b/pkg/api/devfile-data.go @@ -0,0 +1,16 @@ +package api + +import "github.com/devfile/library/pkg/devfile/parser/data" + +// DevfileData describes a devfile content +type DevfileData struct { + Devfile data.DevfileData + SupportedOdoFeatures SupportedOdoFeatures +} + +// SupportedOdoFeatures indicates the support of high-level (odo) features by a devfile component +type SupportedOdoFeatures struct { + Dev bool + Deploy bool + Debug bool +}