Skip to content
Permalink
Browse files

feat: switch to Apiary for real-time API documentation

  • Loading branch information...
moul committed Apr 25, 2019
1 parent 2f698de commit 4e756073da28a9e4f71b0cd0e2ba5bc24a86a664
Showing with 1,412 additions and 2,008 deletions.
  1. +2 −0 .gitignore
  2. +11 −3 Makefile
  3. +2 −1 build/docker/protoc/Dockerfile
  4. +924 −357 entity/entity.pb.go
  5. +0 −19 entity/entity.swagger.json
  6. +2 −2 go.mod
  7. +31 −7 server/server.pb.go
  8. +1 −1 server/server.pb.gw.go
  9. +0 −1,179 server/server.swagger.json
  10. +439 −439 swagger.yaml
@@ -3,6 +3,8 @@ vendor/
*#
.#*

*.swagger.json

/.generated
/.*.generated

@@ -22,7 +22,8 @@ PWCTL_OUT_FILES = \
./pwctl/out/pwctl-linux-amd64
GENERATED_FILES = \
$(GENERATED_PB_FILES) \
$(PWCTL_OUT_FILES)
$(PWCTL_OUT_FILES) \
swagger.yaml
PROTOC_OPTS = -I/protobuf:vendor:.
RUN_OPTS ?=

@@ -94,7 +95,7 @@ generate: .proto.generated
touch $@

.PHONY: _generate
_proto_generate: $(GENERATED_PB_FILES)
_proto_generate: $(GENERATED_PB_FILES) swagger.yaml

$(PWCTL_OUT_FILES): $(PWCTL_SOURCES)
mkdir -p ./pwctl/out
@@ -109,9 +110,16 @@ test: .proto.generated
$(PROTOC_OPTS) \
--grpc-gateway_out=logtostderr=true:"$(GOPATH)/src" \
--gogofaster_out=plugins=grpc:"$(GOPATH)/src" \
--swagger_out=logtostderr=true:. \
"$(dir $<)"/*.proto

swagger.yaml: $(PROTOS)
protoc \
$(PROTOC_OPTS) \
--swagger_out=logtostderr=true:. \
./server/*.proto
cat server/server.swagger.json | json2yaml > swagger.yaml
rm -f server/server.swagger.json

.PHONY: docker.build
docker.build:
docker build -t pathwar/pathwar:latest .
@@ -5,7 +5,8 @@ RUN apk --no-cache add make git go rsync libc-dev openssh docker
RUN go get -u \
github.com/gogo/protobuf/protoc-gen-gogofaster \
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway \
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger \
github.com/simplealpine/json2yaml

FROM golang:1.11-alpine
RUN apk --no-cache add git make protobuf gcc libc-dev && \
Oops, something went wrong.

0 comments on commit 4e75607

Please sign in to comment.
You can’t perform that action at this time.