From bd77cc6652ec6c62711b1f6746b3ed3dd8652ba1 Mon Sep 17 00:00:00 2001 From: walleliu1016 Date: Tue, 7 Jun 2022 10:38:01 +0800 Subject: [PATCH] update em host in example --- .../body/client/heartbeat_request_body.go | 15 +++++++++++++ .../body/client/subscribe_request_body.go | 15 +++++++++++++ eventmesh-sdk-go/common/seq/num.go | 15 +++++++++++++ eventmesh-sdk-go/go.mod | 15 +++++++++++++ eventmesh-sdk-go/grpc/client_test.go | 15 +++++++++++++ eventmesh-sdk-go/grpc/conf/config_test.go | 21 ++++++++++++++++--- eventmesh-sdk-go/grpc/dispatcher_test.go | 3 ++- eventmesh-sdk-go/grpc/heartbeat_test.go | 18 +++++++++++++++- .../grpc/loadbalancer/loadbalancer_test.go | 15 +++++++++++++ .../grpc/loadbalancer/rule_iphash_test.go | 15 +++++++++++++ .../grpc/loadbalancer/rule_random_test.go | 15 +++++++++++++ .../grpc/loadbalancer/rule_roundrobin_test.go | 15 +++++++++++++ .../grpc/loadbalancer/status_server_test.go | 15 +++++++++++++ .../grpc/proto/eventmesh-client_grpc.pb.go | 15 +++++++++++++ 14 files changed, 202 insertions(+), 5 deletions(-) diff --git a/eventmesh-sdk-go/common/protocol/http/body/client/heartbeat_request_body.go b/eventmesh-sdk-go/common/protocol/http/body/client/heartbeat_request_body.go index 9e14899c80..e7ebe973b7 100644 --- a/eventmesh-sdk-go/common/protocol/http/body/client/heartbeat_request_body.go +++ b/eventmesh-sdk-go/common/protocol/http/body/client/heartbeat_request_body.go @@ -1,3 +1,18 @@ +// 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 client import ( diff --git a/eventmesh-sdk-go/common/protocol/http/body/client/subscribe_request_body.go b/eventmesh-sdk-go/common/protocol/http/body/client/subscribe_request_body.go index 8c2feec071..78dc39cccc 100644 --- a/eventmesh-sdk-go/common/protocol/http/body/client/subscribe_request_body.go +++ b/eventmesh-sdk-go/common/protocol/http/body/client/subscribe_request_body.go @@ -1,3 +1,18 @@ +// 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 client import ( diff --git a/eventmesh-sdk-go/common/seq/num.go b/eventmesh-sdk-go/common/seq/num.go index 78316d0c64..c962ea8731 100644 --- a/eventmesh-sdk-go/common/seq/num.go +++ b/eventmesh-sdk-go/common/seq/num.go @@ -1,3 +1,18 @@ +// 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 seq import ( diff --git a/eventmesh-sdk-go/go.mod b/eventmesh-sdk-go/go.mod index 8e3c720438..2ae6bd6c9a 100644 --- a/eventmesh-sdk-go/go.mod +++ b/eventmesh-sdk-go/go.mod @@ -1,3 +1,18 @@ +// 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. + module github.com/apache/incubator-eventmesh/eventmesh-sdk-go go 1.16 diff --git a/eventmesh-sdk-go/grpc/client_test.go b/eventmesh-sdk-go/grpc/client_test.go index 69eb2a417b..f3ebf3b8ec 100644 --- a/eventmesh-sdk-go/grpc/client_test.go +++ b/eventmesh-sdk-go/grpc/client_test.go @@ -1,3 +1,18 @@ +// 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 grpc import ( diff --git a/eventmesh-sdk-go/grpc/conf/config_test.go b/eventmesh-sdk-go/grpc/conf/config_test.go index 027bbffaf1..6b5b32db6d 100644 --- a/eventmesh-sdk-go/grpc/conf/config_test.go +++ b/eventmesh-sdk-go/grpc/conf/config_test.go @@ -1,3 +1,18 @@ +// 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 conf import "testing" @@ -22,7 +37,7 @@ func TestValidateDefaultConf(t *testing.T) { name: "test default duration", args: args{ cfg: &GRPCConfig{ - Hosts: []string{"1", "2"}, + Host: "1", }, }, wantErr: false, @@ -31,7 +46,7 @@ func TestValidateDefaultConf(t *testing.T) { name: "test consumer enable, but no group", args: args{ cfg: &GRPCConfig{ - Hosts: []string{"1"}, + Host: "1", ConsumerConfig: ConsumerConfig{ Enabled: true, }, @@ -43,7 +58,7 @@ func TestValidateDefaultConf(t *testing.T) { name: "test consumer enable, but no group", args: args{ cfg: &GRPCConfig{ - Hosts: []string{"1"}, + Host: "1", ConsumerConfig: ConsumerConfig{ Enabled: true, ConsumerGroup: "test", diff --git a/eventmesh-sdk-go/grpc/dispatcher_test.go b/eventmesh-sdk-go/grpc/dispatcher_test.go index 1a40b9a628..49392057fb 100644 --- a/eventmesh-sdk-go/grpc/dispatcher_test.go +++ b/eventmesh-sdk-go/grpc/dispatcher_test.go @@ -46,8 +46,9 @@ func Test_messageDispatcher_addHandler(t *testing.T) { }, args: args{ topic: "handler-1", - hdl: func(message *proto.SimpleMessage) { + hdl: func(message *proto.SimpleMessage) interface{} { t.Logf("handle message") + return nil }, }, }, diff --git a/eventmesh-sdk-go/grpc/heartbeat_test.go b/eventmesh-sdk-go/grpc/heartbeat_test.go index 202f3eeab5..45f6ed1610 100644 --- a/eventmesh-sdk-go/grpc/heartbeat_test.go +++ b/eventmesh-sdk-go/grpc/heartbeat_test.go @@ -1,3 +1,18 @@ +// 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 grpc import ( @@ -36,8 +51,9 @@ func Test_eventMeshHeartbeat_sendMsg(t *testing.T) { SubscribeType: 1, SubscribeMode: 1, Topic: topic, - }, func(message *proto.SimpleMessage) { + }, func(message *proto.SimpleMessage) interface{} { t.Logf("receive sub msg:%v", message.String()) + return nil })) rcli := cli.(*eventMeshGRPCClient) beat := rcli.heartbeat diff --git a/eventmesh-sdk-go/grpc/loadbalancer/loadbalancer_test.go b/eventmesh-sdk-go/grpc/loadbalancer/loadbalancer_test.go index 9b0001cc01..b3eb916230 100644 --- a/eventmesh-sdk-go/grpc/loadbalancer/loadbalancer_test.go +++ b/eventmesh-sdk-go/grpc/loadbalancer/loadbalancer_test.go @@ -1,3 +1,18 @@ +// 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 loadbalancer import ( diff --git a/eventmesh-sdk-go/grpc/loadbalancer/rule_iphash_test.go b/eventmesh-sdk-go/grpc/loadbalancer/rule_iphash_test.go index 7c66c7a5c9..7375c78f3e 100644 --- a/eventmesh-sdk-go/grpc/loadbalancer/rule_iphash_test.go +++ b/eventmesh-sdk-go/grpc/loadbalancer/rule_iphash_test.go @@ -1,3 +1,18 @@ +// 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 loadbalancer import ( diff --git a/eventmesh-sdk-go/grpc/loadbalancer/rule_random_test.go b/eventmesh-sdk-go/grpc/loadbalancer/rule_random_test.go index e72f3fa967..9eaec0b6dd 100644 --- a/eventmesh-sdk-go/grpc/loadbalancer/rule_random_test.go +++ b/eventmesh-sdk-go/grpc/loadbalancer/rule_random_test.go @@ -1,3 +1,18 @@ +// 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 loadbalancer import ( diff --git a/eventmesh-sdk-go/grpc/loadbalancer/rule_roundrobin_test.go b/eventmesh-sdk-go/grpc/loadbalancer/rule_roundrobin_test.go index 46ffee1a79..986f163268 100644 --- a/eventmesh-sdk-go/grpc/loadbalancer/rule_roundrobin_test.go +++ b/eventmesh-sdk-go/grpc/loadbalancer/rule_roundrobin_test.go @@ -1,3 +1,18 @@ +// 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 loadbalancer import ( diff --git a/eventmesh-sdk-go/grpc/loadbalancer/status_server_test.go b/eventmesh-sdk-go/grpc/loadbalancer/status_server_test.go index 46110e37e6..fa78212cea 100644 --- a/eventmesh-sdk-go/grpc/loadbalancer/status_server_test.go +++ b/eventmesh-sdk-go/grpc/loadbalancer/status_server_test.go @@ -1,3 +1,18 @@ +// 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 loadbalancer import ( diff --git a/eventmesh-sdk-go/grpc/proto/eventmesh-client_grpc.pb.go b/eventmesh-sdk-go/grpc/proto/eventmesh-client_grpc.pb.go index 9407661b5f..a61a9115eb 100644 --- a/eventmesh-sdk-go/grpc/proto/eventmesh-client_grpc.pb.go +++ b/eventmesh-sdk-go/grpc/proto/eventmesh-client_grpc.pb.go @@ -1,3 +1,18 @@ +// 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. + // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0