You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2018/11/15 15:30:45 UTC

[camel-k] 03/03: Renaming types

This is an automated email from the ASF dual-hosted git repository.

lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 906333d42b54813e00371c29b588fd6bbc4fe471
Author: nferraro <ni...@gmail.com>
AuthorDate: Thu Nov 15 09:33:44 2018 +0100

    Renaming types
---
 pkg/trait/knative.go      | 20 +++++++--------
 pkg/util/knative/types.go | 64 +++++++++++++++++++++++------------------------
 2 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/pkg/trait/knative.go b/pkg/trait/knative.go
index ac5a7d8..2a50e19 100644
--- a/pkg/trait/knative.go
+++ b/pkg/trait/knative.go
@@ -165,31 +165,31 @@ func (t *knativeTrait) getConfigurationSerialized(e *environment) string {
 	return string(res)
 }
 
-func (t *knativeTrait) getConfiguration(e *environment) knativeutil.CamelKnativeEnvironment {
+func (t *knativeTrait) getConfiguration(e *environment) knativeutil.CamelEnvironment {
 	sourceChannels := t.getConfiguredSourceChannels()
-	env := knativeutil.NewCamelKnativeEnvironment()
+	env := knativeutil.NewCamelEnvironment()
 	for _, ch := range sourceChannels {
-		svc := knativeutil.CamelKnativeServiceDefinition{
+		svc := knativeutil.CamelServiceDefinition{
 			Name:        ch,
 			Host:        "0.0.0.0",
 			Port:        8080,
-			Protocol:    knativeutil.CamelKnativeProtocolHTTP,
-			ServiceType: knativeutil.CamelKnativeServiceTypeChannel,
+			Protocol:    knativeutil.CamelProtocolHTTP,
+			ServiceType: knativeutil.CamelServiceTypeChannel,
 			Metadata: map[string]string{
-				knativeutil.CamelKnativeMetaServicePath: "/",
+				knativeutil.CamelMetaServicePath: "/",
 			},
 		}
 		env.Services = append(env.Services, svc)
 	}
 	// Adding default endpoint
-	defSvc := knativeutil.CamelKnativeServiceDefinition{
+	defSvc := knativeutil.CamelServiceDefinition{
 		Name:        "default",
 		Host:        "0.0.0.0",
 		Port:        8080,
-		Protocol:    knativeutil.CamelKnativeProtocolHTTP,
-		ServiceType: knativeutil.CamelKnativeServiceTypeEndpoint,
+		Protocol:    knativeutil.CamelProtocolHTTP,
+		ServiceType: knativeutil.CamelServiceTypeEndpoint,
 		Metadata: map[string]string{
-			knativeutil.CamelKnativeMetaServicePath: "/",
+			knativeutil.CamelMetaServicePath: "/",
 		},
 	}
 	env.Services = append(env.Services, defSvc)
diff --git a/pkg/util/knative/types.go b/pkg/util/knative/types.go
index b36b4fc..5c80e43 100644
--- a/pkg/util/knative/types.go
+++ b/pkg/util/knative/types.go
@@ -17,54 +17,54 @@ limitations under the License.
 
 package knative
 
-// CamelKnativeEnvironment is the top level configuration object expected by the Camel Knative component
-type CamelKnativeEnvironment struct {
-	Services []CamelKnativeServiceDefinition `json:"services"`
+// CamelEnvironment is the top level configuration object expected by the Camel Knative component
+type CamelEnvironment struct {
+	Services []CamelServiceDefinition `json:"services"`
 }
 
-// NewCamelKnativeEnvironment creates a new env
-func NewCamelKnativeEnvironment() CamelKnativeEnvironment {
-	return CamelKnativeEnvironment{
-		Services: make([]CamelKnativeServiceDefinition, 0),
+// NewCamelEnvironment creates a new env
+func NewCamelEnvironment() CamelEnvironment {
+	return CamelEnvironment{
+		Services: make([]CamelServiceDefinition, 0),
 	}
 }
 
-// CamelKnativeServiceDefinition defines the parameters to connect to Knative service. It's also used for exposed services
-type CamelKnativeServiceDefinition struct {
-	ServiceType CamelKnativeServiceType `json:"type"`
-	Protocol    CamelKnativeProtocol    `json:"protocol"`
-	Name        string                  `json:"name"`
-	Host        string                  `json:"host"`
-	Port        int                     `json:"port"`
-	Metadata    map[string]string       `json:"metadata"`
+// CamelServiceDefinition defines the parameters to connect to Knative service. It's also used for exposed services
+type CamelServiceDefinition struct {
+	ServiceType CamelServiceType  `json:"type"`
+	Protocol    CamelProtocol     `json:"protocol"`
+	Name        string            `json:"name"`
+	Host        string            `json:"host"`
+	Port        int               `json:"port"`
+	Metadata    map[string]string `json:"metadata"`
 }
 
-// CamelKnativeServiceType --
-type CamelKnativeServiceType string
+// CamelServiceType --
+type CamelServiceType string
 
 const (
-	// CamelKnativeServiceTypeEndpoint is a callable endpoint
-	CamelKnativeServiceTypeEndpoint CamelKnativeServiceType = "endpoint"
-	// CamelKnativeServiceTypeChannel is a callable endpoint that will be also associated to a subscription
-	CamelKnativeServiceTypeChannel CamelKnativeServiceType = "channel"
+	// CamelServiceTypeEndpoint is a callable endpoint
+	CamelServiceTypeEndpoint CamelServiceType = "endpoint"
+	// CamelServiceTypeChannel is a callable endpoint that will be also associated to a subscription
+	CamelServiceTypeChannel CamelServiceType = "channel"
 )
 
-// CamelKnativeProtocol is the communication protocol to use for the service
-type CamelKnativeProtocol string
+// CamelProtocol is the communication protocol to use for the service
+type CamelProtocol string
 
 // Knative protocols
 const (
-	CamelKnativeProtocolHTTP  CamelKnativeProtocol = "http"
-	CamelKnativeProtocolHTTPS CamelKnativeProtocol = "https"
+	CamelProtocolHTTP  CamelProtocol = "http"
+	CamelProtocolHTTPS CamelProtocol = "https"
 )
 
 // Meta Options
 const (
-	CamelKnativeMetaServicePath     = "service.path"
-	CamelKnativeMetaServiceID       = "service.id"
-	CamelKnativeMetaServiceName     = "service.name"
-	CamelKnativeMetaServiceHost     = "service.host"
-	CamelKnativeMetaServicePort     = "service.port"
-	CamelKnativeMetaServiceZone     = "service.zone"
-	CamelKnativeMetaServiceProtocol = "service.protocol"
+	CamelMetaServicePath     = "service.path"
+	CamelMetaServiceID       = "service.id"
+	CamelMetaServiceName     = "service.name"
+	CamelMetaServiceHost     = "service.host"
+	CamelMetaServicePort     = "service.port"
+	CamelMetaServiceZone     = "service.zone"
+	CamelMetaServiceProtocol = "service.protocol"
 )