基于Go语言的hugegraph client SDK工具
软件架构说明
go get github.com/go-hugegraph
API | 说明 |
---|---|
schema | 获取模型schema |
version | 获取版本信息 |
package main
import "github.com/izliang/hugegraph"
import "github.com/izliang/hugegraph/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)
}
}
- 1.使用SDK获取版本信息
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.结果集响应体
type VersionResponse struct {
Versions struct {
Version string `json:"version"`
Core string `json:"core"`
Gremlin string `json:"gremlin"`
API string `json:"api"`
} `json:"versions"`
}
- xxxx
- xxxx
- Fork 本仓库
- 新建 Feat_xxx 分支
- 提交代码
- 新建 Pull Request