linux configuration grpc-golang1, git download Protobuf package 2, extract (/USR/LOCAL/PROTOBUF) unzip PROTOBUF-CPP-3.0.0-ALPHA-3.ZIP3, Enter the unpacked directory CD PROTOBUF/4, compile and install./configuremake && sudo make install5, get the Grpc-golang plugin, go to the bin directory in the Go installation directory, run the following command go get -U github.com/golang/protobuf/protoc-gen-go #golang plug-in to check the location of the Protoc-gen-go executable after running, the bin directory 6, from the GRPC package to find the Protoc executable file, To find linux64 bit version, copy to/usr/local/bin 7, generate Golang proxy class file (need Protoc and protoc-gen-go two executables), execute any one of the following commands: Protoc--go_out= Gen-go Taochees.proto--grpc_out=gen-go--plugin=protoc-gen-grpc=protoc-gen-go or Protoc--go_out=plugins=grpc:./ Gen-go Taochees.proto./gen-go is the saved path to the generated proxy class file Taochees.proto is the proto definition file 8, after the file generation is successful: Taochees.pb.go directly copied to the Go project (or GO/SRC /TAOCHEES/TAOCHEES.PB.GO) You can use the fields of the repeated and map types in the class library generated by 9, C #, the generated properties are only get methods, there is no set method, so other objects cannot be assigned to such properties when used. You can only add or remove values from the Add or remove methods of this property 10, go Project compilation, it is possible that the compilation will not pass due to version inconsistency, update the corresponding package according to the error information, In this commissioning: Download the latest Golang (go1.7.3.linux-amd64.tar.gz) ( TAR-XZVF go1.7.3.linux-amd64.tar.gz) from Google, separately downloading the latest net, HTTP2, google.golang.org, golang.org, VEndor under Package update golang.org
Grpc-go using notes