Grpc-go using Notes

Source: Internet
Author: User

 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.