empiredan commented on code in PR #114:
URL: 
https://github.com/apache/incubator-pegasus-website/pull/114#discussion_r2106852007


##########
_docs/zh/clients/go-client.md:
##########
@@ -0,0 +1,516 @@
+---
+permalink: clients/go-client
+---
+
+# 获取go客户端
+
+下载:
+
+```bash
+go get github.com/apache/incubator-pegasus/go-client@<CommitId>
+# 例如
+go get github.com/apache/incubator-pegasus/go-client@df0eb5a
+```
+
+* 注:
+  * thrift 0.13
+  * Go1.18+
+
+# 客户端配置
+创建go client实例需要配置相关参数,目前仅支持参数传递方式。  
+go client的配置参数非常简单,仅需要指定meta servers。  
+用户如果需要文件配置,需自行将参数从文件从解析,再传入go client。
+```

Review Comment:
   ```suggestion
   ```go
   ```



##########
_docs/zh/clients/go-client.md:
##########
@@ -0,0 +1,516 @@
+---
+permalink: clients/go-client
+---
+
+# 获取go客户端
+
+下载:
+
+```bash
+go get github.com/apache/incubator-pegasus/go-client@<CommitId>
+# 例如
+go get github.com/apache/incubator-pegasus/go-client@df0eb5a
+```
+
+* 注:
+  * thrift 0.13
+  * Go1.18+
+
+# 客户端配置
+创建go client实例需要配置相关参数,目前仅支持参数传递方式。  
+go client的配置参数非常简单,仅需要指定meta servers。  
+用户如果需要文件配置,需自行将参数从文件从解析,再传入go client。
+```
+// 参数配置
+    cfg := &pegasus.Config{
+        MetaServers: []string{"0.0.0.0:34601", "0.0.0.0:34601"},
+    }
+    c := pegasus.NewClient(*cfg)
+
+// 文件配置
+   

Review Comment:
   ```suggestion
   // 文件配置
   ```



##########
_docs/zh/clients/go-client.md:
##########
@@ -0,0 +1,516 @@
+---
+permalink: clients/go-client
+---
+
+# 获取go客户端
+
+下载:
+
+```bash
+go get github.com/apache/incubator-pegasus/go-client@<CommitId>
+# 例如
+go get github.com/apache/incubator-pegasus/go-client@df0eb5a
+```
+
+* 注:
+  * thrift 0.13
+  * Go1.18+
+
+# 客户端配置
+创建go client实例需要配置相关参数,目前仅支持参数传递方式。  
+go client的配置参数非常简单,仅需要指定meta servers。  
+用户如果需要文件配置,需自行将参数从文件从解析,再传入go client。
+```
+// 参数配置
+    cfg := &pegasus.Config{
+        MetaServers: []string{"0.0.0.0:34601", "0.0.0.0:34601"},
+    }
+    c := pegasus.NewClient(*cfg)
+
+// 文件配置
+   
+    cfgPath, _ := filepath.Abs("./example/pegasus-client-config.json")
+       rawCfg, err := ioutil.ReadFile(cfgPath)
+       if err != nil {
+               fmt.Println(err)
+               return
+       }
+    cfg := &pegasus.Config{}
+       json.Unmarshal(rawCfg, cfg)
+       c := pegasus.NewClient(*cfg)
+
+```
+
+# 接口定义
+
+

Review Comment:
   ```suggestion
   
   ```



##########
_docs/zh/clients/go-client.md:
##########
@@ -0,0 +1,516 @@
+---
+permalink: clients/go-client
+---
+
+# 获取go客户端
+
+下载:
+
+```bash
+go get github.com/apache/incubator-pegasus/go-client@<CommitId>
+# 例如
+go get github.com/apache/incubator-pegasus/go-client@df0eb5a
+```
+
+* 注:
+  * thrift 0.13
+  * Go1.18+
+
+# 客户端配置
+创建go client实例需要配置相关参数,目前仅支持参数传递方式。  
+go client的配置参数非常简单,仅需要指定meta servers。  
+用户如果需要文件配置,需自行将参数从文件从解析,再传入go client。
+```
+// 参数配置
+    cfg := &pegasus.Config{
+        MetaServers: []string{"0.0.0.0:34601", "0.0.0.0:34601"},
+    }
+    c := pegasus.NewClient(*cfg)
+
+// 文件配置
+   
+    cfgPath, _ := filepath.Abs("./example/pegasus-client-config.json")
+       rawCfg, err := ioutil.ReadFile(cfgPath)
+       if err != nil {
+               fmt.Println(err)
+               return
+       }
+    cfg := &pegasus.Config{}
+       json.Unmarshal(rawCfg, cfg)
+       c := pegasus.NewClient(*cfg)
+
+```
+
+# 接口定义
+
+
+## 创建Client实例
+
+
+```go
+// NewClient creates a new instance of pegasus client.
+// It panics if the configured addresses are illegal
+func NewClient(cfg Config) Client
+
+
+// Config is the configuration of pegasus client.
+type Config struct {
+       MetaServers []string `json:"meta_servers"`
+}
+
+```
+
+使用完毕后,记得close client以释放资源,譬如:
+
+```go
+c := pegasus.NewClient(*cfg)
+
+... ...
+
+c.Close();
+```
+
+## 创建TableConnector实例
+go client 操作数据的接口都在TableConnector中定义。  
+一个client可以有多个TableConnector实例,每一个TableConnector对应一张表。
+
+```
+    // Open the specific pegasus table. If the table was opened before,
+       // it will reuse the previous connection to the table.
+       OpenTable(ctx context.Context, tableName string) (TableConnector, error)
+
+```
+
+## TableConnector接口
+
+### get  
+读单行数据。
+```go
+    // Get retrieves the entry for `hashKey` + `sortKey`.
+       // Returns nil if no entry matches.
+       // `hashKey` : CAN'T be nil or empty.
+       // `sortKey` : CAN'T be nil but CAN be empty.
+       Get(ctx context.Context, hashKey []byte, sortKey []byte) ([]byte, error)
+```
+* 注:  
+    * 参数:需传入context、hashKey、sortKey。  
+    * 返回值:value、error. 如果返回(nil,nil),表示key对应的数据不存在。  
+    * 异常:如果出现异常,譬如网络错误、超时错误、服务端错误等,可以访问error获取具体错误类型(key对应数据不存在返回nil)。

Review Comment:
   ```suggestion
   注:  
     * 参数:需传入context、hashKey、sortKey。  
     * 返回值:value、error. 如果返回(nil,nil),表示key对应的数据不存在。  
     * 异常:如果出现异常,譬如网络错误、超时错误、服务端错误等,可以访问error获取具体错误类型(key对应数据不存在返回nil)。
   ```



##########
_docs/zh/clients/go-client.md:
##########
@@ -0,0 +1,516 @@
+---
+permalink: clients/go-client
+---
+
+# 获取go客户端
+
+下载:
+
+```bash
+go get github.com/apache/incubator-pegasus/go-client@<CommitId>
+# 例如
+go get github.com/apache/incubator-pegasus/go-client@df0eb5a
+```
+
+* 注:
+  * thrift 0.13
+  * Go1.18+
+
+# 客户端配置
+创建go client实例需要配置相关参数,目前仅支持参数传递方式。  
+go client的配置参数非常简单,仅需要指定meta servers。  
+用户如果需要文件配置,需自行将参数从文件从解析,再传入go client。
+```
+// 参数配置
+    cfg := &pegasus.Config{
+        MetaServers: []string{"0.0.0.0:34601", "0.0.0.0:34601"},
+    }
+    c := pegasus.NewClient(*cfg)
+
+// 文件配置
+   
+    cfgPath, _ := filepath.Abs("./example/pegasus-client-config.json")
+       rawCfg, err := ioutil.ReadFile(cfgPath)
+       if err != nil {
+               fmt.Println(err)
+               return
+       }
+    cfg := &pegasus.Config{}
+       json.Unmarshal(rawCfg, cfg)
+       c := pegasus.NewClient(*cfg)
+

Review Comment:
   ```suggestion
   ```



##########
_docs/zh/clients/go-client.md:
##########
@@ -0,0 +1,516 @@
+---
+permalink: clients/go-client
+---
+
+# 获取go客户端
+
+下载:
+
+```bash
+go get github.com/apache/incubator-pegasus/go-client@<CommitId>
+# 例如
+go get github.com/apache/incubator-pegasus/go-client@df0eb5a
+```
+
+* 注:
+  * thrift 0.13
+  * Go1.18+

Review Comment:
   ```suggestion
   注:
     * thrift 0.13
     * Go1.18+
   ```



##########
_docs/zh/clients/go-client.md:
##########
@@ -0,0 +1,516 @@
+---
+permalink: clients/go-client
+---
+
+# 获取go客户端
+
+下载:
+
+```bash
+go get github.com/apache/incubator-pegasus/go-client@<CommitId>
+# 例如
+go get github.com/apache/incubator-pegasus/go-client@df0eb5a
+```
+
+* 注:
+  * thrift 0.13
+  * Go1.18+
+
+# 客户端配置
+创建go client实例需要配置相关参数,目前仅支持参数传递方式。  
+go client的配置参数非常简单,仅需要指定meta servers。  
+用户如果需要文件配置,需自行将参数从文件从解析,再传入go client。
+```
+// 参数配置
+    cfg := &pegasus.Config{
+        MetaServers: []string{"0.0.0.0:34601", "0.0.0.0:34601"},
+    }
+    c := pegasus.NewClient(*cfg)
+
+// 文件配置
+   
+    cfgPath, _ := filepath.Abs("./example/pegasus-client-config.json")
+       rawCfg, err := ioutil.ReadFile(cfgPath)
+       if err != nil {
+               fmt.Println(err)
+               return
+       }
+    cfg := &pegasus.Config{}
+       json.Unmarshal(rawCfg, cfg)
+       c := pegasus.NewClient(*cfg)
+
+```
+
+# 接口定义
+
+
+## 创建Client实例
+
+
+```go
+// NewClient creates a new instance of pegasus client.
+// It panics if the configured addresses are illegal
+func NewClient(cfg Config) Client
+
+
+// Config is the configuration of pegasus client.
+type Config struct {
+       MetaServers []string `json:"meta_servers"`
+}
+
+```
+
+使用完毕后,记得close client以释放资源,譬如:
+
+```go
+c := pegasus.NewClient(*cfg)
+
+... ...
+
+c.Close();
+```
+
+## 创建TableConnector实例
+go client 操作数据的接口都在TableConnector中定义。  
+一个client可以有多个TableConnector实例,每一个TableConnector对应一张表。
+
+```
+    // Open the specific pegasus table. If the table was opened before,
+       // it will reuse the previous connection to the table.
+       OpenTable(ctx context.Context, tableName string) (TableConnector, error)
+
+```
+
+## TableConnector接口
+
+### get  
+读单行数据。
+```go
+    // Get retrieves the entry for `hashKey` + `sortKey`.
+       // Returns nil if no entry matches.
+       // `hashKey` : CAN'T be nil or empty.
+       // `sortKey` : CAN'T be nil but CAN be empty.
+       Get(ctx context.Context, hashKey []byte, sortKey []byte) ([]byte, error)

Review Comment:
   ```suggestion
       // Get retrieves the entry for `hashKey` + `sortKey`.
       // Returns nil if no entry matches.
       // `hashKey` : CAN'T be nil or empty.
       // `sortKey` : CAN'T be nil but CAN be empty.
       Get(ctx context.Context, hashKey []byte, sortKey []byte) ([]byte, error)
   ```



##########
_docs/zh/clients/go-client.md:
##########
@@ -0,0 +1,516 @@
+---
+permalink: clients/go-client
+---
+
+# 获取go客户端
+
+下载:
+
+```bash
+go get github.com/apache/incubator-pegasus/go-client@<CommitId>
+# 例如
+go get github.com/apache/incubator-pegasus/go-client@df0eb5a
+```
+
+* 注:
+  * thrift 0.13
+  * Go1.18+
+
+# 客户端配置
+创建go client实例需要配置相关参数,目前仅支持参数传递方式。  
+go client的配置参数非常简单,仅需要指定meta servers。  
+用户如果需要文件配置,需自行将参数从文件从解析,再传入go client。
+```
+// 参数配置
+    cfg := &pegasus.Config{
+        MetaServers: []string{"0.0.0.0:34601", "0.0.0.0:34601"},
+    }
+    c := pegasus.NewClient(*cfg)
+
+// 文件配置
+   
+    cfgPath, _ := filepath.Abs("./example/pegasus-client-config.json")
+       rawCfg, err := ioutil.ReadFile(cfgPath)
+       if err != nil {
+               fmt.Println(err)
+               return
+       }
+    cfg := &pegasus.Config{}
+       json.Unmarshal(rawCfg, cfg)
+       c := pegasus.NewClient(*cfg)
+
+```
+
+# 接口定义
+
+
+## 创建Client实例
+
+
+```go
+// NewClient creates a new instance of pegasus client.
+// It panics if the configured addresses are illegal
+func NewClient(cfg Config) Client
+
+
+// Config is the configuration of pegasus client.
+type Config struct {
+       MetaServers []string `json:"meta_servers"`
+}
+

Review Comment:
   ```suggestion
   ```



##########
_docs/zh/clients/go-client.md:
##########
@@ -0,0 +1,516 @@
+---
+permalink: clients/go-client
+---
+
+# 获取go客户端
+
+下载:
+
+```bash
+go get github.com/apache/incubator-pegasus/go-client@<CommitId>
+# 例如
+go get github.com/apache/incubator-pegasus/go-client@df0eb5a
+```
+
+* 注:
+  * thrift 0.13
+  * Go1.18+
+
+# 客户端配置
+创建go client实例需要配置相关参数,目前仅支持参数传递方式。  
+go client的配置参数非常简单,仅需要指定meta servers。  
+用户如果需要文件配置,需自行将参数从文件从解析,再传入go client。
+```
+// 参数配置
+    cfg := &pegasus.Config{
+        MetaServers: []string{"0.0.0.0:34601", "0.0.0.0:34601"},
+    }
+    c := pegasus.NewClient(*cfg)
+
+// 文件配置
+   
+    cfgPath, _ := filepath.Abs("./example/pegasus-client-config.json")
+       rawCfg, err := ioutil.ReadFile(cfgPath)
+       if err != nil {
+               fmt.Println(err)
+               return
+       }
+    cfg := &pegasus.Config{}
+       json.Unmarshal(rawCfg, cfg)
+       c := pegasus.NewClient(*cfg)
+
+```
+
+# 接口定义
+
+
+## 创建Client实例
+
+
+```go
+// NewClient creates a new instance of pegasus client.
+// It panics if the configured addresses are illegal
+func NewClient(cfg Config) Client
+
+

Review Comment:
   ```suggestion
   
   ```



##########
_docs/zh/clients/go-client.md:
##########
@@ -0,0 +1,516 @@
+---
+permalink: clients/go-client
+---
+
+# 获取go客户端
+
+下载:
+
+```bash
+go get github.com/apache/incubator-pegasus/go-client@<CommitId>
+# 例如
+go get github.com/apache/incubator-pegasus/go-client@df0eb5a
+```
+
+* 注:
+  * thrift 0.13
+  * Go1.18+
+
+# 客户端配置
+创建go client实例需要配置相关参数,目前仅支持参数传递方式。  
+go client的配置参数非常简单,仅需要指定meta servers。  
+用户如果需要文件配置,需自行将参数从文件从解析,再传入go client。
+```
+// 参数配置
+    cfg := &pegasus.Config{
+        MetaServers: []string{"0.0.0.0:34601", "0.0.0.0:34601"},
+    }
+    c := pegasus.NewClient(*cfg)
+
+// 文件配置
+   
+    cfgPath, _ := filepath.Abs("./example/pegasus-client-config.json")
+       rawCfg, err := ioutil.ReadFile(cfgPath)
+       if err != nil {
+               fmt.Println(err)
+               return
+       }
+    cfg := &pegasus.Config{}
+       json.Unmarshal(rawCfg, cfg)
+       c := pegasus.NewClient(*cfg)
+
+```
+
+# 接口定义
+
+
+## 创建Client实例
+
+

Review Comment:
   ```suggestion
   
   ```



##########
_docs/zh/clients/go-client.md:
##########
@@ -0,0 +1,516 @@
+---
+permalink: clients/go-client
+---
+
+# 获取go客户端
+
+下载:
+
+```bash
+go get github.com/apache/incubator-pegasus/go-client@<CommitId>
+# 例如
+go get github.com/apache/incubator-pegasus/go-client@df0eb5a
+```
+
+* 注:
+  * thrift 0.13
+  * Go1.18+
+
+# 客户端配置
+创建go client实例需要配置相关参数,目前仅支持参数传递方式。  
+go client的配置参数非常简单,仅需要指定meta servers。  
+用户如果需要文件配置,需自行将参数从文件从解析,再传入go client。
+```
+// 参数配置
+    cfg := &pegasus.Config{
+        MetaServers: []string{"0.0.0.0:34601", "0.0.0.0:34601"},
+    }
+    c := pegasus.NewClient(*cfg)
+
+// 文件配置
+   
+    cfgPath, _ := filepath.Abs("./example/pegasus-client-config.json")
+       rawCfg, err := ioutil.ReadFile(cfgPath)
+       if err != nil {
+               fmt.Println(err)
+               return
+       }
+    cfg := &pegasus.Config{}
+       json.Unmarshal(rawCfg, cfg)
+       c := pegasus.NewClient(*cfg)
+
+```
+
+# 接口定义
+
+
+## 创建Client实例
+
+
+```go
+// NewClient creates a new instance of pegasus client.
+// It panics if the configured addresses are illegal
+func NewClient(cfg Config) Client
+
+
+// Config is the configuration of pegasus client.
+type Config struct {
+       MetaServers []string `json:"meta_servers"`
+}
+
+```
+
+使用完毕后,记得close client以释放资源,譬如:
+
+```go
+c := pegasus.NewClient(*cfg)
+
+... ...
+
+c.Close();
+```
+
+## 创建TableConnector实例
+go client 操作数据的接口都在TableConnector中定义。  
+一个client可以有多个TableConnector实例,每一个TableConnector对应一张表。
+
+```
+    // Open the specific pegasus table. If the table was opened before,
+       // it will reuse the previous connection to the table.
+       OpenTable(ctx context.Context, tableName string) (TableConnector, error)
+
+```

Review Comment:
   ````suggestion
   ```go
       // Open the specific pegasus table. If the table was opened before,
       // it will reuse the previous connection to the table.
       OpenTable(ctx context.Context, tableName string) (TableConnector, error)
   ```
   ````



-- 
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-unsubscr...@pegasus.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pegasus.apache.org
For additional commands, e-mail: dev-h...@pegasus.apache.org

Reply via email to