草庐IT

Protobuf3

全部标签

go - 扫描 github.com/golang/protobuf/proto/testdata : cannot find package "." 时出错

在我的项目上运行glideinstall时,出现以下错误:[ERROR]Errorscanninggithub.com/golang/protobuf/proto/testdata:cannotfindpackage"."in:/Users/bevernie/.glide/cache/src/https-github.com-golang-protobuf/proto/testdata[ERROR]Failedtoretrievealistofdependencies:Errorresolvingimports在查看protobuf的源码时,发现其实并没有这个包。但是我不直接使用pro

go - 使用 golang/protobuf 时在数据存储中构建错误

我有一个同时使用bigquery和云数据存储API的应用程序。我使用glide进行包管理。根据我使用的golang/protobuf版本,我不断看到bigquery或数据存储的构建错误。我找不到与bigquery和数据存储兼容的版本。任何一个包都无法构建。使用golang/protobuf版本7cc19b78d562895b13596ddce7aafb59dd789318时在数据存储中构建错误:../../vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go:33:undefined

go - 使用 golang/protobuf 时在数据存储中构建错误

我有一个同时使用bigquery和云数据存储API的应用程序。我使用glide进行包管理。根据我使用的golang/protobuf版本,我不断看到bigquery或数据存储的构建错误。我找不到与bigquery和数据存储兼容的版本。任何一个包都无法构建。使用golang/protobuf版本7cc19b78d562895b13596ddce7aafb59dd789318时在数据存储中构建错误:../../vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go:33:undefined

json - 无法将 json 解码为 protobuf 结构字段

我有一个与此类似的原型(prototype)文件。syntax="proto3";packageproto;import"github.com/gogo/protobuf/gogoproto/gogo.proto";import"google/protobuf/struct.proto";messageJobCreateRequest{stringName=1[(gogoproto.jsontag)="name",(gogoproto.moretags)="validate:\"required,max=100\""];stringDescription=2[(gogoproto.js

json - 无法将 json 解码为 protobuf 结构字段

我有一个与此类似的原型(prototype)文件。syntax="proto3";packageproto;import"github.com/gogo/protobuf/gogoproto/gogo.proto";import"google/protobuf/struct.proto";messageJobCreateRequest{stringName=1[(gogoproto.jsontag)="name",(gogoproto.moretags)="validate:\"required,max=100\""];stringDescription=2[(gogoproto.js

go - 如何解码被拦截的gRPC请求/响应以查看golang中已发送/已接收的protobuf消息?

我正在拦截通过UNIX套接字(使用cri-api的容器化套接字,使用eBPF来执行拦截)的原始gRPC请求/响应,并且我想弄清楚正在发送/接收的内容。我可以访问使用.proto生成gRPC接口(interface)的gRPCplugin文件,因此应该可以这样做,但是由于我不属于gRPC连接,因此我不确定如何启动。我该如何在golang中进行此操作? 最佳答案 使用GRPC基本支持https://godoc.org/google.golang.org/grpc#StreamInterceptorhttps://godoc.org/go

go - 如何解码被拦截的gRPC请求/响应以查看golang中已发送/已接收的protobuf消息?

我正在拦截通过UNIX套接字(使用cri-api的容器化套接字,使用eBPF来执行拦截)的原始gRPC请求/响应,并且我想弄清楚正在发送/接收的内容。我可以访问使用.proto生成gRPC接口(interface)的gRPCplugin文件,因此应该可以这样做,但是由于我不属于gRPC连接,因此我不确定如何启动。我该如何在golang中进行此操作? 最佳答案 使用GRPC基本支持https://godoc.org/google.golang.org/grpc#StreamInterceptorhttps://godoc.org/go

go - 如何在 protobuf3 中存储 time.duration

在原型(prototype)文件中...syntax="proto3";import"google/protobuf/duration.proto";messageaaaResponse{google.protobuf.Durationmin=2;}...将自动生成*duration.Duration如何修改proto文件获取time.Duration 最佳答案 试试这个:gogetgithub.com/gogo/protobuf/protoc-gen-gogofasterprotoc--gogofaster_out=./durat

go - 如何在 protobuf3 中存储 time.duration

在原型(prototype)文件中...syntax="proto3";import"google/protobuf/duration.proto";messageaaaResponse{google.protobuf.Durationmin=2;}...将自动生成*duration.Duration如何修改proto文件获取time.Duration 最佳答案 试试这个:gogetgithub.com/gogo/protobuf/protoc-gen-gogofasterprotoc--gogofaster_out=./durat

json - 如何使用 jsonpb 将 JSON 解码为包含一个定义的 protobuf?

我目前无法解码jsonpb生成的JSON片段。也许这只是我的某种误解,但在查看测试时我希望它能以某种方式工作。这是pb.proto的相关片段:syntax="proto3";packagepb;messageParameter{stringname=1;oneofvalue{stringstr_value=2;int32int_value=3;boolbool_value=4;floatfloat_value=5;}}messageParameterSet{bytesraw=1;repeatedParameterparameters=2;}messageParameterSets{ma