Skip to content

Commit

Permalink
update em host in example
Browse files Browse the repository at this point in the history
  • Loading branch information
walleliu1016 committed Jun 7, 2022
1 parent 5b85819 commit bd77cc6
Show file tree
Hide file tree
Showing 14 changed files with 202 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
15 changes: 15 additions & 0 deletions eventmesh-sdk-go/common/seq/num.go
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
15 changes: 15 additions & 0 deletions eventmesh-sdk-go/go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down
15 changes: 15 additions & 0 deletions eventmesh-sdk-go/grpc/client_test.go
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
21 changes: 18 additions & 3 deletions eventmesh-sdk-go/grpc/conf/config_test.go
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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,
Expand All @@ -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,
},
Expand All @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion eventmesh-sdk-go/grpc/dispatcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
},
},
Expand Down
18 changes: 17 additions & 1 deletion eventmesh-sdk-go/grpc/heartbeat_test.go
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions eventmesh-sdk-go/grpc/loadbalancer/loadbalancer_test.go
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
15 changes: 15 additions & 0 deletions eventmesh-sdk-go/grpc/loadbalancer/rule_iphash_test.go
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
15 changes: 15 additions & 0 deletions eventmesh-sdk-go/grpc/loadbalancer/rule_random_test.go
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
15 changes: 15 additions & 0 deletions eventmesh-sdk-go/grpc/loadbalancer/rule_roundrobin_test.go
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
15 changes: 15 additions & 0 deletions eventmesh-sdk-go/grpc/loadbalancer/status_server_test.go
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
15 changes: 15 additions & 0 deletions eventmesh-sdk-go/grpc/proto/eventmesh-client_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bd77cc6

Please sign in to comment.