nodeflux API。
nodefluxapis的Python项目详细描述
nodeflux api
此存储库包含公共nodeflux分析api。它使用协议缓冲区版本3来定义api接口和有效负载消息的结构。
通过使用此存储库生成的代码,可以使用nodefluxapi。我们还构建了几个客户端库,这是调用nodefluxapi的推荐方法:
生成源核心
要从这个存储库生成特定于语言的源代码,您需要在计算机中安装协议缓冲区、grpc和一些特定于语言的插件。然后可以使用make
生成源代码。
tl;dr
本指南假定已安装所有依赖项。要安装依赖项,请参阅下面的语言特定指南。
git clone https://github.com/googleapis/googleapis.git
export GOOGLEAPIS_PATH=$(pwd)/googleapis
make all # Run linter and build all
make CPP_OUT_DIR=/path/to/genfiles cpp # Build c++ sources
make PYTHON_OUT_DIR=/path/to/genfiles python # Build python sources
make GO_OUT_DIR=/path/to/genfiles go # Build go sources
make docs # Build documentation
make lint # Run linter
C++< EH3>< >构建C++源代码,需要具有以下依赖关系:- Protocol Buffer(Installation Guide)
< gRPC Plugin(C++)
- googleapis
通过运行以下命令生成源代码:
git clone https://github.com/googleapis/googleapis.git
export GOOGLEAPIS_PATH=$(pwd)/googleapis
make CPP_OUT_DIR=/path/to/genfiles cpp
Python
要构建python源代码,您需要具有以下依赖项:
- Protocol Buffer
- 用于python的grpc插件
- mypy-protobuf
- googleapis
上面的依赖项可以通过运行以下命令来安装:
pip3 install grpcio-tools mypy-protobuf
git clone https://github.com/googleapis/googleapis.git
export GOOGLEAPIS_PATH=$(pwd)/googleapis
然后您可以构建python源代码:
然后您可以构建和安装python源代码:
make python
pip install .
如果要将python源代码构建到不同的目录,请使用PYTHON_OUT_DIR
参数。
make PYTHON_OUT_DIR=/path/to/genfiles python
开始
要构建python源代码,您需要具有以下依赖项:
上面的依赖项可以通过运行以下命令来安装:
go get -u github.com/golang/protobuf/protoc-gen-go
go get -u google.golang.org/grpc
git clone https://github.com/googleapis/googleapis.git
export GOOGLEAPIS_PATH=$(pwd)/googleapis
然后您可以构建go源代码:
make GO_OUT_DIR=/path/to/genfiles go