Skip to content

cute-angelia/gogo-protobuf

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

修改版 支持 gorm

update:2022-06-27

安装

# 一、安装 protoc
# linux:
apt install -y protobuf-compiler
protoc --version

# macos:
brew install protobuf
protoc --version

# 二、安装 protoc-gen-gofast

git clone https://github.com/cute-angelia/gogo-protobuf.git --depth 1

cd gogo-protobuf
cd protoc-gen-gofast && go install
cd ../protoc-gen-gogo && go install

其他说明

工具(cute-angelia/mysql-protobuf)可以快速将 sql struct 生成 proto3

说明

虽然有 protoc-gen-gorm 这个插件, 但是配置很烦,需要修改每个 proto 文件

之前也魔改过一个protobuf

这次选型 gogo ,也是项目需要, 这次打算接入斗鱼的 jupiter, jupiter 使用的是 gogo-protobuf

jupiter 里面 gorm 用法还很原始, 需要自己定义 model, 这里直接集成到工具里面

几行代码能搞定的事情,就不去花大力气(兼容grpc和gorm)写插件了

About

Protocol Buffers for Go with Gadgets

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 93.1%
  • Makefile 6.8%
  • Shell 0.1%