Skip to content

Commit

Permalink
Hello gRPC-Gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
minhoryang committed Dec 5, 2019
1 parent 77ec4ce commit ed765cc
Show file tree
Hide file tree
Showing 29 changed files with 4,812 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ python -m pytest --konlpy-repo=../konlpy
- [P1] gRPC retry/timeout/error_handling logic <!-- google.api_core.* or grpc-retry-py -->
- [x] [P1] gRPC reflection
- [P1] gRPC heartbeat
- [x] [P1] gRPC Gateway (gRPC to JSON)
- [P2] Dockerize / Register
- k8s and istio?
- [P2] CI
Expand Down
26 changes: 26 additions & 0 deletions konlpy_grpc_gateway/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
!lib/
# Created by https://www.gitignore.io/api/go
# Edit at https://www.gitignore.io/?templates=go

### Go ###
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

### Go Patch ###
/vendor/
/Godeps/

# End of https://www.gitignore.io/api/go
18 changes: 18 additions & 0 deletions konlpy_grpc_gateway/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# KoNLPy-gRPC-Gateway

## Generate
```bash
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
protoc -I ../protos/ -I $GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --grpc-gateway_out=logtostderr=true,grpc_api_configuration=gateway.yaml:_generated --go_out=plugins=grpc:_generated --swagger_out=logtostderr=true,grpc_api_configuration=gateway.yaml:_generated ../protos/*.proto
```

## Run
```bash
go get -u github.com/minhoryang/KoNLPy-gRPC/konlpy_grpc_gateway
go install github.com/minhoryang/KoNLPy-gRPC/konlpy_grpc_gateway
$GOPATH/bin/konlpy_grpc_gateway -endpoint "[::]:50051" -swagger_dir _generated
```
It will run at http://localhost:8080

## Thanks
https://github.com/grpc-ecosystem/grpc-gateway
3 changes: 3 additions & 0 deletions konlpy_grpc_gateway/_generated/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.gw.go
*.pb.go
*.swagger.json
286 changes: 286 additions & 0 deletions konlpy_grpc_gateway/_generated/global.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions konlpy_grpc_gateway/_generated/global.swagger.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"swagger": "2.0",
"info": {
"title": "global.proto",
"version": "version not set"
},
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {},
"definitions": {}
}
Loading

0 comments on commit ed765cc

Please sign in to comment.