博客
关于我
go_package 别名问题记录
阅读量:647 次
发布时间:2019-03-13

本文共 985 字,大约阅读时间需要 3 分钟。

菜单协议定义 Proto3语法

菜单信息定义如下:

message Menu {    int64   id = 1;             //菜单ID    string  name = 2;           //菜单名称    int64   parentId = 3;       //父级菜单ID    string  parentName = 4;     //父级菜单名称    string  url = 5;            //访问路由    int32   sequence = 6;       //自定义排序    string  icon = 7;           //菜单图标    int32   type = 8;           //菜单类型 0 目录 1 菜单 2 按钮    int32   status = 9;         //状态 0 禁用 1 启用    string  description = 10;   //描述    int64   created = 11;        //创建时间    int64   creator = 12;        //创建人    int64   updated = 13;        //更新时间    int64   updator = 14;        //更新人    int64   syncFlag = 15;       //标志    int64   syncVersion = 16;    //版本号}

生成文件指令

从命令行执行以下指令来生成文件:

protoc.exe -I . entity/v5/menu.proto --grpc-gateway_out=logtostderr=true:. --go_out=plugins=grpc:E:\go\src

menu.proto文件位置

菜单协议文件位于}

由于`go_out`输出目录设置为`E:\go\src`,因此生成的文件会保存在该目录下。

关于文件生成的原理

目前尚不清楚`go_out`和`grpc-gateway_out`参数的具体工作原理。建议有机会后去学习ProtoBuf和GRPC gateway的相关文档,以便更好地理解这些工具的工作机制。

转载地址:http://xqboz.baihongyu.com/

你可能感兴趣的文章
Text-to-Image with Diffusion models的巅峰之作:深入解读 DALL·E 2
查看>>
TCP基本入门-简单认识一下什么是TCP
查看>>
tableviewcell 中使用autolayout自适应高度
查看>>
Orcale表被锁
查看>>
svn访问报错500
查看>>
org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned
查看>>
org.apache.ibatis.type.TypeException: Could not resolve type alias 'xxxx'异常
查看>>
org.apache.poi.hssf.util.Region
查看>>
org.apache.xmlbeans.XmlOptions.setEntityExpansionLimit(I)Lorg/apache/xmlbeans/XmlOptions;
查看>>
org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /
查看>>
org.hibernate.HibernateException: Unable to get the default Bean Validation factory
查看>>
org.hibernate.ObjectNotFoundException: No row with the given identifier exists:
查看>>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
查看>>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
查看>>
org.springframework.web.multipart.MaxUploadSizeExceededException: Maximum upload size exceeded
查看>>
org.tinygroup.serviceprocessor-服务处理器
查看>>
org/eclipse/jetty/server/Connector : Unsupported major.minor version 52.0
查看>>
org/hibernate/validator/internal/engine
查看>>
SQL-36 创建一个actor_name表,将actor表中的所有first_name以及last_name导入改表。
查看>>
ORM sqlachemy学习
查看>>