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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > php >内容正文

php

php把proto解析为文档,Protobuf 文件生成工具 Prototool 命令详解

發布時間:2025/4/5 php 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 php把proto解析为文档,Protobuf 文件生成工具 Prototool 命令详解 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Protobuf 文件生成工具 Prototool 命令詳解

簡介

Prototool 是 Protobuf 文件的生成工具, 目前支持go, php, java, c#, object c 五種語言包的生成.

詳情參考Github: https://github.com/uber/prototool

docker 方式使用 prototool 工具

使用方式

// prototool 的使用

docker run --rm -v $(pwd):/work "uber/prototool" prototool

// 格式化 proto 文件

docker run --rm -v $(pwd):/work "uber/prototool" prototool format -l proto

// 編譯, 格式化, 覆蓋 proto 文件

docker run --rm -v $(pwd):/work "uber/prototool" prototool all proto

docker 方式創建 proto 文件

docker run --rm -v $(pwd):/work "uber/prototool" prototool create test.proto

Prototool 部分命令參數簡單介紹

prototool lint [目錄]

遞歸的查找所有后綴為 .proto 的文件, 但是不包括 prototool.yaml 和 prototool.json 文件.

prototool lint testdir

注: 不設置目錄, 則默認為當前目錄. eg: prototool lint .

prototool create [test.proto]

創建一個 proto 的模板文件

$ prototool create test.proto

prototool files [目錄]

列出要被使用的所有 proto 文件

$ prototool files testdir

prototool compile [目錄]

編譯目錄下所有的 proto 文件

$ prototool compile testdir

prototool generate [目錄]

生成 stubs 文件

$ prototool generate testdir

prototool 幫助文檔

查看幫助文檔, 這里詳細介紹了命令的使用方式.

$ prototool -h

總結

以上是生活随笔為你收集整理的php把proto解析为文档,Protobuf 文件生成工具 Prototool 命令详解的全部內容,希望文章能夠幫你解決所遇到的問題。

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