feat: add buf cmd
This commit is contained in:
29
templates/project/buf.gen.yaml.tpl
Normal file
29
templates/project/buf.gen.yaml.tpl
Normal file
@@ -0,0 +1,29 @@
|
||||
version: v2
|
||||
managed:
|
||||
enabled: true
|
||||
override:
|
||||
- file_option: go_package_prefix
|
||||
value: {{.ModuleName}}/pkg/proto
|
||||
|
||||
plugins:
|
||||
- remote: buf.build/protocolbuffers/go
|
||||
out: gen/go
|
||||
opt: paths=source_relative
|
||||
- remote: buf.build/grpc/go
|
||||
out: gen/go
|
||||
opt: paths=source_relative,require_unimplemented_servers=false
|
||||
- remote: buf.build/grpc-ecosystem/gateway
|
||||
out: gen/go
|
||||
opt: paths=source_relative
|
||||
# languages
|
||||
- remote: buf.build/protocolbuffers/js
|
||||
out: gen/js
|
||||
- remote: buf.build/protocolbuffers/php
|
||||
out: gen/php
|
||||
# generate openapi documentation for api
|
||||
- remote: buf.build/grpc-ecosystem/openapiv2
|
||||
out: gen/openapiv2
|
||||
opt: allow_merge=true,merge_file_name=services
|
||||
|
||||
inputs:
|
||||
- directory: proto
|
||||
10
templates/project/buf.yaml.tpl
Normal file
10
templates/project/buf.yaml.tpl
Normal file
@@ -0,0 +1,10 @@
|
||||
# For details on buf.yaml configuration, visit https://buf.build/docs/configuration/v2/buf-yaml
|
||||
version: v2
|
||||
modules:
|
||||
- path: proto
|
||||
lint:
|
||||
use:
|
||||
- STANDARD
|
||||
breaking:
|
||||
use:
|
||||
- FILE
|
||||
Reference in New Issue
Block a user