- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
即使每个 python grpc 快速入门引用都使用 grpc_tools.protoc
生成实现proto文件的python类,the closest thing to documentation that I can find简单地说
Given protobuf include directories $INCLUDE, an output directory $OUTPUT, and proto files $PROTO_FILES, invoke as:
$ python -m grpc.tools.protoc -I$INCLUDE --python_out=$OUTPUT --grpc_python_out=$OUTPUT $PROTO_FILES
$OUTPUT
的
..
只是默默地失败。
最佳答案
我以为你在问 Python 插件。你试了吗-h
?
$ python -m grpc.tools.protoc -h
Usage: /usr/local/google/home/lidiz/.local/lib/python2.7/site-packages/grpc_tools/protoc.py [OPTION] PROTO_FILES
Parse PROTO_FILES and generate output based on the options given:
-IPATH, --proto_path=PATH Specify the directory in which to search for
imports. May be specified multiple times;
directories will be searched in order. If not
given, the current working directory is used.
--version Show version info and exit.
-h, --help Show this text and exit.
--encode=MESSAGE_TYPE Read a text-format message of the given type
from standard input and write it in binary
to standard output. The message type must
be defined in PROTO_FILES or their imports.
--decode=MESSAGE_TYPE Read a binary message of the given type from
standard input and write it in text format
to standard output. The message type must
be defined in PROTO_FILES or their imports.
--decode_raw Read an arbitrary protocol message from
standard input and write the raw tag/value
pairs in text format to standard output. No
PROTO_FILES should be given when using this
flag.
--descriptor_set_in=FILES Specifies a delimited list of FILES
each containing a FileDescriptorSet (a
protocol buffer defined in descriptor.proto).
The FileDescriptor for each of the PROTO_FILES
provided will be loaded from these
FileDescriptorSets. If a FileDescriptor
appears multiple times, the first occurrence
will be used.
-oFILE, Writes a FileDescriptorSet (a protocol buffer,
--descriptor_set_out=FILE defined in descriptor.proto) containing all of
the input files to FILE.
--include_imports When using --descriptor_set_out, also include
all dependencies of the input files in the
set, so that the set is self-contained.
--include_source_info When using --descriptor_set_out, do not strip
SourceCodeInfo from the FileDescriptorProto.
This results in vastly larger descriptors that
include information about the original
location of each decl in the source file as
well as surrounding comments.
--dependency_out=FILE Write a dependency output file in the format
expected by make. This writes the transitive
set of input file paths to FILE
--error_format=FORMAT Set the format in which to print errors.
FORMAT may be 'gcc' (the default) or 'msvs'
(Microsoft Visual Studio format).
--print_free_field_numbers Print the free field numbers of the messages
defined in the given proto files. Groups share
the same field number space with the parent
message. Extension ranges are counted as
occupied fields numbers.
--plugin=EXECUTABLE Specifies a plugin executable to use.
Normally, protoc searches the PATH for
plugins, but you may specify additional
executables not in the path using this flag.
Additionally, EXECUTABLE may be of the form
NAME=PATH, in which case the given plugin name
is mapped to the given executable even if
the executable's own name differs.
--grpc_python_out=OUT_DIR Generate Python source file.
--python_out=OUT_DIR Generate Python source file.
@<filename> Read options and filenames from file. If a
relative file path is specified, the file
will be searched in the working directory.
The --proto_path option will not affect how
this argument file is searched. Content of
the file will be expanded in the position of
@<filename> as in the argument list. Note
that shell expansion is not applied to the
content of the file (i.e., you cannot use
quotes, wildcards, escapes, commands, etc.).
Each line corresponds to a single argument,
even if it contains spaces.
关于python - 传递给 grpc_tools.protoc 的命令行参数是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57909401/
我一直在尝试使用 protoc cli 实用程序对字符串进行编码。 注意到输出仍然包含纯文本。 我究竟做错了什么? osboxes@osboxes:~/proto/bin$ cat ./teststr
要为 Python 编译 proto 文件,我可以 protoc -I=.--python_out=$DST_DIR sommem.proto 基于 https://developers.google
如何查看protoc-gen-go和protoc-gen-validate的版本? protoc-gen-go --version protoc-gen-validate --version 我试过上
我们使用的是 protoc-gen-go v2(v2 是 google.golang.org/protobuf,v1 是 github.com/golang/protobuf) 当我们尝试编译 gRP
我正在尝试用 C++ 生成 Google Assistant 库。 我已经使用 protoc 编译器编译了 embedded_assistant.proto 文件,并获得了用于库的 embedded_
我想使用来自 protoc-gen-grpc-kotlin 的 protoc-gen-grpc-kotlin-1.0.0我得到了 Execution failed for task ':generat
我想使用来自 protoc-gen-grpc-kotlin 的 protoc-gen-grpc-kotlin-1.0.0我得到了 Execution failed for task ':generat
我只是想使用 Protocol Buffer 为 golang 生成代码。但是无法使用 protoc 命令生成服务。 syntax = "proto3"; package greet; option
我正在尝试构建一个自定义协议(protocol)插件来从 .proto 文件生成自定义输出。我从 protoc custom plugin 复制了包含 CodeGenerator 的 java 文件作
protoc-gen-doc 自定义模板规则详解 配套演示工程 此项目中所用 proto 文件位于 ./proto 目录下,来源于 官方proto示例 此项目中所列所有
我正在尝试运行: protoc *.proto -python_out=. 在 tensorflow > models > research > object_detection > protos 内
我想使用 protoc生成java文件的命令 我一直在遵循来自 github https://github.com/protocolbuffers/protobuf 的自述文件中的说明但它只是告诉您下
我想实现dart-protobuf,但是dart-protoc-plugin(从proto定义生成Dart protobuf库的项目)当前不支持Windows。我找不到该插件的替代品。没有其他方法可以
问题: 我在根目录中有 2 个文件。 我使用 Makefile 从 .proto 文件生成 Go 代码。 但是 Video 结构中的语言字段是一个值,而不是指向该值的指针。 Video 结构中的 su
我正在尝试在 How to write a custom Protobuf CodeGenerator in Java 制作工作示例。当我尝试使用编译文件时 import com.google.pro
当我运行这个时: protoc --python_out=. .\object_detection\protos\anchor_generator.proto 在命令行上的 tensorflow 对象
我正在尝试开发一个插件,以便自动生成特定于我的应用程序的代码。虽然一个可能更简单的策略是让我的代码使用由 c++ 插件生成的文件,但我正在尝试从头开始编写插件。 正如我添加到我的包中的文档中所解释的那
描述 我想用java调用golang grpc,我用老golang的consumer_proto.proto来生成java代码 过程 protoc --java_out=/home/xxx/src/
我正在开发一个应用程序,该应用程序必须针对使用 google protocol buffers 3.0.0 版的目标进行交叉编译。有没有办法在 protoc 命令(或 .proto 文件)中指定生成的
即使每个 python grpc 快速入门引用都使用 grpc_tools.protoc生成实现proto文件的python类,the closest thing to documentation t
我是一名优秀的程序员,十分优秀!