Skip to content

Albelt/mxshop_protos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

protoc命令解释

protoc -I /Users/albelt/Gitlab/common/protos -I . \ #依赖的第三方proto路径,待编译的proto路径
    --go_out=xxx \ #protoc-gen-go插件,生成go结构体
    --go-grpc_out=xxx \ #protoc-gen-go-grpc插件,生成grpc方法
    --validate_out="lang=go:albelt/good_srv" \ #protoc-gen-validate插件,生成校验go结构体的方法
    --doc_out=./doc --doc_opt=html,xxx.html \ #protoc-gen-doc插件,生成html文档
    albelt/good_srv/msg.proto albelt/good_srv/svc.proto #proto文件路径

protoc插件:

自定义proroc插件:

protoc-gen-md插件

cd protoc-gen-md && go build
cp protoc-gen-md $GOPATH/bin

protoc -I /Users/albelt/Gitlab/common/protos -I . --md_out=./ hello.proto 

protoc-gen-gin插件

cd protoc-gen-gin && go build
cp protoc-gen-gin $GOPATH/bin

protoc -I /Users/albelt/Gitlab/common/protos -I . --gin_out=./ hello.proto 

About

微店proto定义

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published