Skip to content

Commit

Permalink
Merge pull request #33 from jzelinskie/rest
Browse files Browse the repository at this point in the history
generate openapi and add an embed fs for it
  • Loading branch information
jzelinskie committed Oct 21, 2021
2 parents b57087b + f724c70 commit 08f0dd3
Show file tree
Hide file tree
Showing 25 changed files with 3,265 additions and 413 deletions.
1 change: 1 addition & 0 deletions .gitattributes
@@ -1,2 +1,3 @@
*.pb.go -diff linguist-generated=true
*.pb.*.go -diff linguist-generated=true
go.sum -diff linguist-generated=true
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Expand Up @@ -26,14 +26,14 @@ jobs:
run: "go mod tidy && bash -c '[ $(git status --porcelain | tee /dev/fd/2 | wc -c) -eq 0 ]'"
- name: "Formatting (gofumpt)"
run: |
GOFUMPT_OUTPUT="$(find . -iname '*.go' -type f | grep -v pb.validate.go | grep -v pb.go | grep -v pb.fix.go | xargs gofumports -d)"
GOFUMPT_OUTPUT="$(find . -iname '*.go' -type f | grep -v pb.go | grep -v 'pb.*.go' | xargs gofumports -d)"
if [ -n "$GOFUMPT_OUTPUT" ]; then
echo "All the following files are not correctly formatted"
echo "${GOFUMPT_OUTPUT}"
exit 1
fi
- name: "Linting (revive)"
run: "bash -c '[ $(find . -iname '*.go' -type f | grep -v pb.fix.go | xargs revive | tee /dev/fd/2 | wc -c) -eq 0 ]'"
run: "bash -c '[ $(find . -iname '*.go' -type f | grep -v 'pb.*.go' | xargs revive | tee /dev/fd/2 | wc -c) -eq 0 ]'"

test:
name: "Test"
Expand Down
14 changes: 10 additions & 4 deletions buf.gen.yaml
@@ -1,12 +1,18 @@
#!/usr/bin/env -S buf generate buf.build/authzed/api:7a18d413329a4f4fb0c4237afb640e8e --template
version: "v1beta1"
#!/usr/bin/env -S buf generate buf.build/authzed/api:67357f5a752f8e985833adc0944b46a2c1e2083b --template
version: "v1"
plugins:
- name: "go"
- remote: "buf.build/library/plugins/go:v1.27.1-1"
out: "proto"
opt: "paths=source_relative"
- name: "go-grpc"
- remote: "buf.build/library/plugins/go-grpc:v1.1.0-2"
out: "proto"
opt: "paths=source_relative"
- name: "validate"
out: "proto"
opt: "paths=source_relative,lang=go"
- remote: "buf.build/grpc-ecosystem/plugins/grpc-gateway:v2.6.0-1"
out: "proto"
opt: "paths=source_relative"
- remote: "buf.build/grpc-ecosystem/plugins/openapiv2:v2.6.0-1"
out: "proto"
opt: "allow_merge=true"
3 changes: 2 additions & 1 deletion go.mod
Expand Up @@ -5,13 +5,14 @@ go 1.16
require (
github.com/authzed/grpcutil v0.0.0-20210913124023-cad23ae5a9e8
github.com/envoyproxy/protoc-gen-validate v0.6.1
github.com/grpc-ecosystem/grpc-gateway/v2 v2.6.0
github.com/jzelinskie/stringz v0.0.0-20210414224931-d6a8ce844a70
github.com/stretchr/testify v1.7.0
golang.org/x/net v0.0.0-20210913180222-943fd674d43e // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys v0.0.0-20210910150752-751e447fb3d0 // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af // indirect
google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af
google.golang.org/grpc v1.40.0
google.golang.org/protobuf v1.27.1
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
Expand Down
273 changes: 268 additions & 5 deletions go.sum

Large diffs are not rendered by default.

0 comments on commit 08f0dd3

Please sign in to comment.