javeme commented on code in PR #514:
URL: 
https://github.com/apache/incubator-hugegraph-toolchain/pull/514#discussion_r1366454830


##########
.github/workflows/client-go-ci.yml:
##########
@@ -0,0 +1,66 @@
+name: "hugegraph-client-go-ci"
+
+on:
+  push:
+    branches:
+      - master
+      - feature-go-client
+      - /^release-.*$/
+      - /^feature-.*$/
+    paths:
+      - hugegraph-client-go/**
+      - hugegraph-dist/**
+      - .github/workflows/**
+      - pom.xml
+  pull_request:
+    paths:
+      - hugegraph-client-go/**
+      - hugegraph-dist/**
+      - .github/workflows/**
+      - pom.xml
+
+jobs:
+  client-go-ci:
+    runs-on: ubuntu-20.04
+    env:
+      TRAVIS_DIR: hugegraph-client/assembly/travis
+      COMMIT_ID: be6ee386b9939dc6bd6fcbdf2274b8acc3a0a314
+    strategy:
+      fail-fast: false
+      matrix:
+        JAVA_VERSION: ['8']
+    steps:
+      - name: Install JDK 8
+        uses: actions/setup-java@v3
+        with:
+          java-version: ${{ matrix.JAVA_VERSION }}
+          distribution: 'zulu'
+
+      - name: Cache Maven packages
+        uses: actions/cache@v3
+        with:
+          path: ~/.m2
+          key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
+          restore-keys: ${{ runner.os }}-m2
+
+      - name: Checkout
+        uses: actions/checkout@v3
+        with:
+          fetch-depth: 2
+
+      - name: Prepare env and service
+        run: |
+          $TRAVIS_DIR/install-hugegraph-from-source.sh $COMMIT_ID
+
+      - name: Init Go env
+        uses: actions/[email protected]
+        with: { go-version: '1.x' }
+
+      - name: Go test
+        run: |
+          go version  
+          sudo swapoff -a
+          sudo sysctl -w vm.swappiness=1
+          sudo sysctl -w fs.file-max=262144
+          sudo sysctl -w vm.max_map_count=262144
+          cd hugegraph-client-go && make test

Review Comment:
   expect a blank line here



##########
hugegraph-client-go/internal/model/model.go:
##########
@@ -0,0 +1,21 @@
+/*
+ * 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 model
+
+// UrlPrefix 用于增加对商业版的支持

Review Comment:
   ditto



##########
hugegraph-client-go/README.md:
##########
@@ -0,0 +1,85 @@
+# go-hugegraph
+
+#### 介绍
+
+基于 Go 语言的 hugegraph client SDK 工具
+
+#### 软件架构
+
+软件架构说明
+
+#### 安装教程
+
+```shell
+go get github.com/go-hugegraph
+```
+
+#### 实现 API
+
+| API     | 说明          |
+|---------|-------------|
+| schema  | 获取模型 schema |
+| version | 获取版本信息      |
+
+#### 使用说明
+
+##### 1.初始化客户端
+
+```go
+package main
+
+import "hugegraph.apache.org/client-go"
+import "hugegraph.apache.org/client-go/hgtransport"
+
+func main() {
+       
+       clinet,err := hugegraph.NewClient(hugegraph.Config{
+               Host:  "127.0.0.1",
+               Port:  8888,
+               Graph: "hugegraph",
+               Logger: &hgtransport.ColorLogger{
+                       Output:             os.Stdout,
+                       EnableRequestBody:  true,
+                       EnableResponseBody: true,
+               },
+       })
+       
+       if err != nil {
+               log.Fatalf("Error creating the client: %s\n", err)
+       }
+}
+```
+
+##### 2.获取 hugegraph 版本
+
+- 1.使用 SDK 获取版本信息
+
+```go
+func getVersion() {
+    
+    client := initClient()
+    
+    res, err := client.Version()
+    if err != nil {
+    log.Fatalf("Error getting the response: %s\n", err)

Review Comment:
   note indentation



##########
hugegraph-client-go/README.md:
##########
@@ -0,0 +1,85 @@
+# go-hugegraph
+
+#### 介绍
+
+基于 Go 语言的 hugegraph client SDK 工具
+
+#### 软件架构
+
+软件架构说明
+
+#### 安装教程
+
+```shell
+go get github.com/go-hugegraph
+```
+
+#### 实现 API
+
+| API     | 说明          |
+|---------|-------------|
+| schema  | 获取模型 schema |
+| version | 获取版本信息      |
+
+#### 使用说明
+
+##### 1.初始化客户端
+
+```go
+package main
+
+import "hugegraph.apache.org/client-go"
+import "hugegraph.apache.org/client-go/hgtransport"
+
+func main() {
+       
+       clinet,err := hugegraph.NewClient(hugegraph.Config{
+               Host:  "127.0.0.1",
+               Port:  8888,
+               Graph: "hugegraph",
+               Logger: &hgtransport.ColorLogger{
+                       Output:             os.Stdout,
+                       EnableRequestBody:  true,
+                       EnableResponseBody: true,
+               },
+       })
+       
+       if err != nil {
+               log.Fatalf("Error creating the client: %s\n", err)
+       }
+}
+```
+
+##### 2.获取 hugegraph 版本
+
+- 1.使用 SDK 获取版本信息
+
+```go
+func getVersion() {
+    
+    client := initClient()
+    
+    res, err := client.Version()
+    if err != nil {
+    log.Fatalf("Error getting the response: %s\n", err)
+    }
+    defer res.Body.Close()
+    
+    fmt.Println(res.Versions)
+    
+    fmt.Println(res.Versions.Version)
+}
+```
+
+- 2.结果集响应体
+
+```go
+type VersionResponse struct {
+       Versions   struct {
+               Version string `json:"version"`
+               Core    string `json:"core"`
+               Gremlin string `json:"gremlin"`
+               API     string `json:"api"`
+       } `json:"versions"`
+}
+```

Review Comment:
   能否简略的说明下版本信息的内容?比如`返回结果包括了各个子模块的版本号`



##########
hugegraph-client-go/README.md:
##########
@@ -0,0 +1,85 @@
+# go-hugegraph
+
+#### 介绍
+
+基于 Go 语言的 hugegraph client SDK 工具
+
+#### 软件架构
+
+软件架构说明
+
+#### 安装教程
+
+```shell
+go get github.com/go-hugegraph
+```
+
+#### 实现 API
+
+| API     | 说明          |
+|---------|-------------|
+| schema  | 获取模型 schema |
+| version | 获取版本信息      |
+
+#### 使用说明
+
+##### 1.初始化客户端
+
+```go
+package main
+
+import "hugegraph.apache.org/client-go"
+import "hugegraph.apache.org/client-go/hgtransport"
+
+func main() {
+       
+       clinet,err := hugegraph.NewClient(hugegraph.Config{
+               Host:  "127.0.0.1",
+               Port:  8888,
+               Graph: "hugegraph",
+               Logger: &hgtransport.ColorLogger{
+                       Output:             os.Stdout,
+                       EnableRequestBody:  true,
+                       EnableResponseBody: true,
+               },
+       })
+       
+       if err != nil {
+               log.Fatalf("Error creating the client: %s\n", err)
+       }
+}
+```
+
+##### 2.获取 hugegraph 版本
+
+- 1.使用 SDK 获取版本信息
+
+```go
+func getVersion() {
+    
+    client := initClient()
+    
+    res, err := client.Version()
+    if err != nil {
+    log.Fatalf("Error getting the response: %s\n", err)
+    }
+    defer res.Body.Close()
+    
+    fmt.Println(res.Versions)
+    
+    fmt.Println(res.Versions.Version)
+}
+```
+
+- 2.结果集响应体
+
+```go
+type VersionResponse struct {
+       Versions   struct {
+               Version string `json:"version"`
+               Core    string `json:"core"`
+               Gremlin string `json:"gremlin"`
+               API     string `json:"api"`
+       } `json:"versions"`
+}
+```

Review Comment:
   能否简略的说明下版本信息的内容?比如`返回结果包括了各个子模块的版本号`



##########
hugegraph-client-go/hugegraph.go:
##########
@@ -0,0 +1,109 @@
+/*
+ * 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 hugegraph
+
+import (
+       "errors"
+       "fmt"
+       "net"
+       "net/http"
+       "net/url"
+       "os"
+
+       v1 "hugegraph.apache.org/client-go/api/v1"
+       "hugegraph.apache.org/client-go/hgtransport"
+)
+
+// ClientTypeEnum 客户端类型枚举

Review Comment:
   ditto



##########
pom.xml:
##########
@@ -28,7 +28,8 @@
     <name>${project.artifactId}</name>
     <url>https://github.com/apache/incubator-hugegraph-toolchain</url>
     <description>
-        hugegraph-toolchain is the integration project of a series of 
utilities for HugeGraph, it includes 4 main modules (loader/hubble/tools/client)
+        hugegraph-toolchain is the integration project of a series of 
utilities for HugeGraph, it
+        includes 4 main modules (loader/hubble/tools/client)

Review Comment:
   seems don't need to wrap line



##########
hugegraph-client-go/README.md:
##########
@@ -0,0 +1,85 @@
+# go-hugegraph
+
+#### 介绍
+
+基于 Go 语言的 hugegraph client SDK 工具
+
+#### 软件架构
+
+软件架构说明
+
+#### 安装教程
+
+```shell
+go get github.com/go-hugegraph
+```
+
+#### 实现 API
+
+| API     | 说明          |
+|---------|-------------|
+| schema  | 获取模型 schema |
+| version | 获取版本信息      |
+
+#### 使用说明
+
+##### 1.初始化客户端
+
+```go
+package main
+
+import "hugegraph.apache.org/client-go"
+import "hugegraph.apache.org/client-go/hgtransport"
+
+func main() {
+       
+       clinet,err := hugegraph.NewClient(hugegraph.Config{
+               Host:  "127.0.0.1",

Review Comment:
   can we replace all the TAB to spaces?



##########
hugegraph-client-go/README.md:
##########
@@ -0,0 +1,85 @@
+# go-hugegraph
+
+#### 介绍
+
+基于 Go 语言的 hugegraph client SDK 工具
+
+#### 软件架构
+
+软件架构说明
+
+#### 安装教程
+
+```shell
+go get github.com/go-hugegraph
+```
+
+#### 实现 API
+
+| API     | 说明          |
+|---------|-------------|
+| schema  | 获取模型 schema |
+| version | 获取版本信息      |
+
+#### 使用说明
+
+##### 1.初始化客户端
+
+```go
+package main
+
+import "hugegraph.apache.org/client-go"
+import "hugegraph.apache.org/client-go/hgtransport"
+
+func main() {
+       

Review Comment:
   unused blank line?



##########
hugegraph-client-go/api/v1/api.version.go:
##########
@@ -0,0 +1,92 @@
+/*
+ * 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 v1
+
+import (
+       "context"
+       "encoding/json"
+       "io"
+       "io/ioutil"
+       "net/http"
+
+       "hugegraph.apache.org/client-go/api"
+)
+
+// ----- API Definition -------------------------------------------------------
+
+// 查看HugeGraph的版本信息

Review Comment:
   ditto



##########
hugegraph-client-go/README.md:
##########
@@ -0,0 +1,85 @@
+# go-hugegraph
+
+#### 介绍
+
+基于 Go 语言的 hugegraph client SDK 工具
+
+#### 软件架构
+
+软件架构说明
+
+#### 安装教程
+
+```shell
+go get github.com/go-hugegraph
+```
+
+#### 实现 API
+
+| API     | 说明          |
+|---------|-------------|
+| schema  | 获取模型 schema |
+| version | 获取版本信息      |
+
+#### 使用说明
+
+##### 1.初始化客户端
+
+```go
+package main
+
+import "hugegraph.apache.org/client-go"
+import "hugegraph.apache.org/client-go/hgtransport"
+
+func main() {
+       
+       clinet,err := hugegraph.NewClient(hugegraph.Config{
+               Host:  "127.0.0.1",
+               Port:  8888,
+               Graph: "hugegraph",
+               Logger: &hgtransport.ColorLogger{
+                       Output:             os.Stdout,
+                       EnableRequestBody:  true,
+                       EnableResponseBody: true,
+               },
+       })
+       
+       if err != nil {
+               log.Fatalf("Error creating the client: %s\n", err)
+       }
+}
+```
+
+##### 2.获取 hugegraph 版本
+
+- 1.使用 SDK 获取版本信息
+
+```go
+func getVersion() {
+    
+    client := initClient()
+    
+    res, err := client.Version()
+    if err != nil {
+    log.Fatalf("Error getting the response: %s\n", err)
+    }
+    defer res.Body.Close()
+    
+    fmt.Println(res.Versions)
+    
+    fmt.Println(res.Versions.Version)
+}
+```
+
+- 2.结果集响应体

Review Comment:
   `返回值的结构`更好理解一些



##########
hugegraph-client-go/README.md:
##########
@@ -0,0 +1,85 @@
+# go-hugegraph
+
+#### 介绍
+
+基于 Go 语言的 hugegraph client SDK 工具
+
+#### 软件架构
+
+软件架构说明
+
+#### 安装教程
+
+```shell
+go get github.com/go-hugegraph
+```
+
+#### 实现 API
+
+| API     | 说明          |
+|---------|-------------|
+| schema  | 获取模型 schema |
+| version | 获取版本信息      |
+
+#### 使用说明
+
+##### 1.初始化客户端
+
+```go
+package main
+
+import "hugegraph.apache.org/client-go"
+import "hugegraph.apache.org/client-go/hgtransport"
+
+func main() {
+       
+       clinet,err := hugegraph.NewClient(hugegraph.Config{
+               Host:  "127.0.0.1",
+               Port:  8888,
+               Graph: "hugegraph",
+               Logger: &hgtransport.ColorLogger{
+                       Output:             os.Stdout,
+                       EnableRequestBody:  true,
+                       EnableResponseBody: true,
+               },
+       })
+       
+       if err != nil {
+               log.Fatalf("Error creating the client: %s\n", err)
+       }
+}
+```
+
+##### 2.获取 hugegraph 版本
+
+- 1.使用 SDK 获取版本信息
+
+```go
+func getVersion() {
+    
+    client := initClient()
+    
+    res, err := client.Version()
+    if err != nil {
+    log.Fatalf("Error getting the response: %s\n", err)
+    }
+    defer res.Body.Close()
+    
+    fmt.Println(res.Versions)
+    
+    fmt.Println(res.Versions.Version)
+}
+```
+
+- 2.结果集响应体

Review Comment:
   `返回值的结构`更好理解一些



##########
hugegraph-client-go/Makefile:
##########
@@ -0,0 +1,75 @@
+#
+# 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.
+#
+
+# init project path
+HOMEDIR := $(shell pwd)
+OUTDIR  := $(HOMEDIR)/output
+
+# 设置编译时所需要的 go 环境

Review Comment:
   can we translate it to english?



-- 
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