yuluo-yx commented on code in PR #12:
URL: 
https://github.com/apache/hertzbeat-collector-go/pull/12#discussion_r2333798684


##########
internal/collector/common/transport/transport.go:
##########
@@ -1,67 +1,244 @@
-/*
- * 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.
- */
+// 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 transport
 
 import (
        "context"
+       "encoding/json"
+       "fmt"
+       "os"
 
+       config 
"hertzbeat.apache.org/hertzbeat-collector-go/internal/collector/config"
+       configtypes 
"hertzbeat.apache.org/hertzbeat-collector-go/internal/collector/common/types/config"
        clrServer 
"hertzbeat.apache.org/hertzbeat-collector-go/internal/collector/common/server"
        
"hertzbeat.apache.org/hertzbeat-collector-go/internal/collector/common/types/collector"
+       "hertzbeat.apache.org/hertzbeat-collector-go/internal/transport"
+       "hertzbeat.apache.org/hertzbeat-collector-go/internal/util/logger"
+       pb "hertzbeat.apache.org/hertzbeat-collector-go/api/cluster_msg"
 )
 
 type Config struct {
        clrServer.Server
+       // 可扩展更多配置
+       ServerAddr   string // 管理端 server 地址
+       Protocol     string // 通信协议: grpc, netty
+       Identity     string // 采集器标识
+       Mode         string // 运行模式: public, private
 }
 
 type Runner struct {
        Config
+       client     transport.TransportClient
+       cancel     context.CancelFunc

Review Comment:
   context 变量不应该被放在结构体中 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to