chore(api): Move shared types to common_types.go
diff --git a/pkg/apis/camel/v1/camelcatalog_types.go b/pkg/apis/camel/v1/camelcatalog_types.go
index 609932b..89bceb9 100644
--- a/pkg/apis/camel/v1/camelcatalog_types.go
+++ b/pkg/apis/camel/v1/camelcatalog_types.go
@@ -95,15 +95,7 @@
Items []CamelCatalog `json:"items"`
}
-// RuntimeProvider --
-type RuntimeProvider string
-
const (
// CamelCatalogKind --
CamelCatalogKind string = "CamelCatalog"
-
- // RuntimeProviderMain --
- RuntimeProviderMain RuntimeProvider = "main"
- // RuntimeProviderQuarkus --
- RuntimeProviderQuarkus RuntimeProvider = "quarkus"
)
diff --git a/pkg/apis/camel/v1/common_types.go b/pkg/apis/camel/v1/common_types.go
index 1a852f0..25eff32 100644
--- a/pkg/apis/camel/v1/common_types.go
+++ b/pkg/apis/camel/v1/common_types.go
@@ -150,3 +150,90 @@
type Flow struct {
json.RawMessage `json:",inline"`
}
+
+// RuntimeProvider --
+type RuntimeProvider string
+
+const (
+ // RuntimeProviderMain --
+ RuntimeProviderMain RuntimeProvider = "main"
+ // RuntimeProviderQuarkus --
+ RuntimeProviderQuarkus RuntimeProvider = "quarkus"
+)
+
+// ResourceType --
+type ResourceType string
+
+// ResourceSpec --
+type ResourceSpec struct {
+ DataSpec `json:",inline"`
+ Type ResourceType `json:"type,omitempty"`
+ MountPath string `json:"mountPath,omitempty"`
+}
+
+const (
+ // ResourceTypeData --
+ ResourceTypeData ResourceType = "data"
+ // ResourceTypeOpenAPI --
+ ResourceTypeOpenAPI ResourceType = "openapi"
+)
+
+// SourceSpec --
+type SourceSpec struct {
+ DataSpec `json:",inline"`
+ Language Language `json:"language,omitempty"`
+ // Loader is an optional id of the org.apache.camel.k.RoutesLoader that will
+ // interpret this source at runtime
+ Loader string `json:"loader,omitempty"`
+ // Interceptors are optional identifiers the org.apache.camel.k.RoutesLoader
+ // uses to pre/post process sources
+ Interceptors []string `json:"interceptors,omitempty"`
+ // Type defines the kind of source described by this object
+ Type SourceType `json:"type,omitempty"`
+ // List of property names defined in the source (e.g. if type is "template")
+ PropertyNames []string `json:"property-names,omitempty"`
+}
+
+type SourceType string
+
+const (
+ SourceTypeDefault SourceType = ""
+ SourceTypeTemplate SourceType = "template"
+)
+
+// DataSpec --
+type DataSpec struct {
+ Name string `json:"name,omitempty"`
+ Content string `json:"content,omitempty"`
+ ContentRef string `json:"contentRef,omitempty"`
+ ContentKey string `json:"contentKey,omitempty"`
+ Compression bool `json:"compression,omitempty"`
+}
+
+// Language --
+type Language string
+
+const (
+ // LanguageJavaSource --
+ LanguageJavaSource Language = "java"
+ // LanguageGroovy --
+ LanguageGroovy Language = "groovy"
+ // LanguageJavaScript --
+ LanguageJavaScript Language = "js"
+ // LanguageXML --
+ LanguageXML Language = "xml"
+ // LanguageKotlin --
+ LanguageKotlin Language = "kts"
+ // LanguageYaml --
+ LanguageYaml Language = "yaml"
+)
+
+// Languages is the list of all supported languages
+var Languages = []Language{
+ LanguageJavaSource,
+ LanguageGroovy,
+ LanguageJavaScript,
+ LanguageXML,
+ LanguageKotlin,
+ LanguageYaml,
+}
diff --git a/pkg/apis/camel/v1/integration_types.go b/pkg/apis/camel/v1/integration_types.go
index d29f93d..3d103d5 100644
--- a/pkg/apis/camel/v1/integration_types.go
+++ b/pkg/apis/camel/v1/integration_types.go
@@ -92,83 +92,6 @@
Items []Integration `json:"items"`
}
-// DataSpec --
-type DataSpec struct {
- Name string `json:"name,omitempty"`
- Content string `json:"content,omitempty"`
- ContentRef string `json:"contentRef,omitempty"`
- ContentKey string `json:"contentKey,omitempty"`
- Compression bool `json:"compression,omitempty"`
-}
-
-// ResourceType --
-type ResourceType string
-
-// ResourceSpec --
-type ResourceSpec struct {
- DataSpec `json:",inline"`
- Type ResourceType `json:"type,omitempty"`
- MountPath string `json:"mountPath,omitempty"`
-}
-
-const (
- // ResourceTypeData --
- ResourceTypeData ResourceType = "data"
- // ResourceTypeOpenAPI --
- ResourceTypeOpenAPI ResourceType = "openapi"
-)
-
-// SourceSpec --
-type SourceSpec struct {
- DataSpec `json:",inline"`
- Language Language `json:"language,omitempty"`
- // Loader is an optional id of the org.apache.camel.k.RoutesLoader that will
- // interpret this source at runtime
- Loader string `json:"loader,omitempty"`
- // Interceptors are optional identifiers the org.apache.camel.k.RoutesLoader
- // uses to pre/post process sources
- Interceptors []string `json:"interceptors,omitempty"`
- // Type defines the kind of source described by this object
- Type SourceType `json:"type,omitempty"`
- // List of property names defined in the source (e.g. if type is "template")
- PropertyNames []string `json:"property-names,omitempty"`
-}
-
-type SourceType string
-
-const (
- SourceTypeDefault SourceType = ""
- SourceTypeTemplate SourceType = "template"
-)
-
-// Language --
-type Language string
-
-const (
- // LanguageJavaSource --
- LanguageJavaSource Language = "java"
- // LanguageGroovy --
- LanguageGroovy Language = "groovy"
- // LanguageJavaScript --
- LanguageJavaScript Language = "js"
- // LanguageXML --
- LanguageXML Language = "xml"
- // LanguageKotlin --
- LanguageKotlin Language = "kts"
- // LanguageYaml --
- LanguageYaml Language = "yaml"
-)
-
-// Languages is the list of all supported languages
-var Languages = []Language{
- LanguageJavaSource,
- LanguageGroovy,
- LanguageJavaScript,
- LanguageXML,
- LanguageKotlin,
- LanguageYaml,
-}
-
// IntegrationPhase --
type IntegrationPhase string