Skip to content

tradingAI/nebula-go

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nebula-go

build status

Official Nebula Go client which communicates with the server using fbthrift.

Please be careful do not to modify the files in the graph directory, these codes were all generated by fbthrift.

Install

$ go get -u -v github.com/vesoft-inc/nebula-go

Usage example

package main

import (
  "log"

  nebula "github.com/vesoft-inc/nebula-go"
  graph "github.com/vesoft-inc/nebula-go/nebula/graph"
)

func main() {
  client, err := nebula.NewClient("127.0.0.1:3699")
  if err != nil {
    log.Fatal(err)
  }

  if err = client.Connect("username", "password"); err != nil {
    log.Fatal(err)
  }
  defer client.Disconnect()

  resp, err := client.Execute("SHOW HOSTS;")
  if err != nil {
    log.Fatal(err)
  }
  
  if resp.GetErrorCode() != graph.ErrorCode_SUCCEEDED {
    log.Printf("ErrorCode: %v, ErrorMsg: %s", resp.GetErrorCode(), resp.GetErrorMsg())
  }
  
}

About

Nebula client in Golang

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Go 100.0%