You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by GitBox <gi...@apache.org> on 2022/09/14 01:35:24 UTC

[GitHub] [incubator-eventmesh] walterlife commented on a diff in pull request #1255: Eventmesh server go

walterlife commented on code in PR #1255:
URL: https://github.com/apache/incubator-eventmesh/pull/1255#discussion_r969065254


##########
eventmesh-server-go/runtime/core/protocol/grpc/processor/subscribe.go:
##########
@@ -0,0 +1,42 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements.  See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package processor
+
+import (
+	"github.com/apache/incubator-eventmesh/eventmesh-server-go/runtime/core/protocol/grpc/utils"
+	"github.com/apache/incubator-eventmesh/eventmesh-server-go/runtime/proto/pb"
+)
+
+// SubscribeWebHook process the subscribe request
+type SubscribeWebHook struct {
+	*Processor
+}
+
+// Do process the webhook subscription
+func (s *SubscribeWebHook) Do(sub *pb.Subscription) error {
+	hdr := sub.Header
+	if err := utils.ValidateHeader(hdr); err != nil {
+		return err
+	}
+	if err := utils.ValidateSubscription(true, sub); err != nil {
+		return err
+	}
+	if err := s.Interceptor(sub); err != nil {

Review Comment:
   Is it possible to combine this into one line?
   eg: return  s.Interceptor(sub)



##########
eventmesh-server-go/runtime/consts/env.go:
##########
@@ -0,0 +1,30 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements.  See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package consts
+
+var (
+	// EVENT_STORE_ENV evn for store plugin
+	// default to defibus
+	EVENT_STORE_ENV = "EVENT_STORE"

Review Comment:
   variable format follows camel case



##########
eventmesh-server-go/runtime/consts/state.go:
##########
@@ -0,0 +1,25 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements.  See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package consts
+
+type ServiceState string
+
+const (
+	INITED  ServiceState = "INITED"

Review Comment:
   variable format follows camel case



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org