日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

gogo protobuf

發布時間:2023/12/16 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 gogo protobuf 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

gogoprotobuf使用(上)
來自 <https://my.oschina.net/alexstocks/blog/387031>?


gogoprotobuf使用(下)
來自 <https://studygolang.com/articles/2575>?




./protoc --gogofast_out=plugins=grpc:../src/github.com/Gauss100_OLTP_DB/consistency/raft/raftpb/ -I../src/github.com/Gauss100_OLTP_DB/consistency/raft/raftpb/ -I ../ -I ../src/github.com/gogo/protobuf/protobuf/? ../src/github.com/Gauss100_OLTP_DB/consistency/raft/raftpb/raft.proto




protoc --gofast_out=. -I/root/Gauss100_OLTP_V1R5_PINETREE/src/github.com/gogo/protobuf/protobuf/ -I/root/Gauss100_OLTP_V1R5_PINETREE/src/? -I. raft.proto
Compiler Invocation
The protocol buffer compiler requires a plugin to generate Go code. Installing it with
$ go get github.com/golang/protobuf/protoc-gen-go
provides a protoc-gen-go binary which protoc uses when invoked with the --go_out command-line flag. The --go_out flag tells the compiler where to write the Go source files. The compiler creates a single source file for each .proto file input.
The names of the output files are computed by taking the name of the .proto file and making two changes:
? The extension (.proto) is replaced with .pb.go. For example, a file called player_record.proto results in an output file called player_record.pb.go.
? The proto path (specified with the --proto_path or -I command-line flag) is replaced with the output path (specified with the --go_out flag).
When you run the proto compiler like this:
protoc --proto_path=src --go_out=build/gen src/foo.proto src/bar/baz.proto
the compiler will read the files src/foo.proto and src/bar/baz.proto. It produces two output files:build/gen/foo.pb.go and build/gen/bar/baz.pb.go.
The compiler automatically creates the directory build/gen/bar if necessary, but it will not create build orbuild/gen; they must already exist.


來自 <https://developers.google.com/protocol-buffers/docs/reference/go-generated#repeated>?

總結

以上是生活随笔為你收集整理的gogo protobuf的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。