How to communicate with Neo via gRPC in Go
CREATE TAG TABLE IF NOT EXISTS EXAMPLE ( NAME VARCHAR(20) PRIMARY KEY, TIME DATETIME BASETIME, VALUE DOUBLE SUMMARIZED );
gRPC version of wave generator example is also available. Since it doesn’t need to define custom data structures for payload, relatively less lines of code are needed comparing to HTTP.
mkdir grpc_wave && cd grpc_wave
Copy source code and save it as
grpc_wave.go or run script below in the directory.
curl -o grpc_wave.go "https://raw.githubusercontent.com/machbase/neo-docs/main/examples/go/grpc_wave/grpc_wave.go"
Initialize go mod and prepare dependent modules.
go mod init wave && go mod tidy
go run .