gRPC: Uptime runtime to v2 (#590)

* Upgrade to gRPC v2 runtime

* Fix tests

* Update docs

* Win/Linus/macOS path friendliness

* Swagger/docs update
This commit is contained in:
Adrian Gallagher
2020-11-09 15:53:23 +11:00
committed by GitHub
parent f050c13daa
commit 7b9b68558c
12 changed files with 3799 additions and 3514 deletions

View File

@@ -33,12 +33,13 @@ manager or by downloading one of the releases from the official repository:
[protoc releases](https://github.com/protocolbuffers/protobuf/releases)
Then use `go get -u` to download the following packages:
Then use `go get` to download the following packages:
```bash
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
go get -u github.com/golang/protobuf/protoc-gen-go
go get github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway
go get github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
go get google.golang.org/protobuf/cmd/protoc-gen-go
go get google.golang.org/grpc/cmd/protoc-gen-go-grpc
```
This will place three binaries in your `$GOBIN`;
@@ -46,6 +47,7 @@ This will place three binaries in your `$GOBIN`;
* `protoc-gen-grpc-gateway`
* `protoc-gen-swagger`
* `protoc-gen-go`
* `protoc-gen-go-grpc`
Make sure that your `$GOBIN` is in your `$PATH`.

View File

@@ -1,5 +1,9 @@
echo "GoCryptoTrader: Generating gRPC, proxy and swagger files."
# You may need to include the go mod package for the annotations file:
# $GOPATH/pkg/mod/github.com/grpc-ecosystem/grpc-gateway/v2@v2.0.1/third_party/googleapis
export GOPATH=$(go env GOPATH)
protoc -I=. -I=$GOPATH/src -I=$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --go_out=plugins=grpc:. rpc.proto
protoc -I=. -I=$GOPATH/src -I=$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --go_out=. rpc.proto
protoc -I=. -I=$GOPATH/src -I=$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --go-grpc_out=. rpc.proto
protoc -I=. -I=$GOPATH/src -I=$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --grpc-gateway_out=logtostderr=true:. rpc.proto
protoc -I=. -I=$GOPATH/src -I=$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --swagger_out=logtostderr=true:. rpc.proto

View File

@@ -1,5 +1,9 @@
@echo off
echo GoCryptoTrader: Generating gRPC, proxy and swagger files.
protoc -I=. -I=%GOPATH%\src -I=%GOPATH%\src\github.com\grpc-ecosystem\grpc-gateway\third_party\googleapis --go_out=plugins=grpc:. rpc.proto
REM You may need to include the go mod package for the annotations file:
REM %GOPATH%\pkg\mod\github.com\grpc-ecosystem\grpc-gateway\v2@v2.0.1\third_party\googleapis
protoc -I=. -I=%GOPATH%\src -I=%GOPATH%\src\github.com\grpc-ecosystem\grpc-gateway\third_party\googleapis --go_out=. rpc.proto
protoc -I=. -I=%GOPATH%\src -I=%GOPATH%\src\github.com\grpc-ecosystem\grpc-gateway\third_party\googleapis --go-grpc_out=. rpc.proto
protoc -I=. -I=%GOPATH%\src -I=%GOPATH%\src\github.com\grpc-ecosystem\grpc-gateway\third_party\googleapis --grpc-gateway_out=logtostderr=true:. rpc.proto
protoc -I=. -I=%GOPATH%\src -I=%GOPATH%\src\github.com\grpc-ecosystem\grpc-gateway\third_party\googleapis --swagger_out=logtostderr=true:. rpc.proto

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@ import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
package gctrpc;
option go_package = ".;gctrpc";
option go_package = "github.com/thrasher-corp/gocryptotrader/gctrpc";
message GetInfoRequest {}
@@ -799,8 +799,8 @@ message WebsocketSetURLRequest {
}
message FindMissingCandlePeriodsRequest {
string exchangeName = 1;
string assetType = 2;
string exchange_name = 1;
string asset_type = 2;
CurrencyPair pair = 3;
int64 interval = 4;
string start = 5;
@@ -808,18 +808,18 @@ message FindMissingCandlePeriodsRequest {
}
message FindMissingTradePeriodsRequest {
string exchangeName = 1;
string assetType = 2;
string exchange_name = 1;
string asset_type = 2;
CurrencyPair pair = 3;
string start = 4;
string end = 5;
}
message FindMissingIntervalsResponse {
string exchangeName = 1;
string assetType = 2;
string exchange_name = 1;
string asset_type = 2;
CurrencyPair pair = 3;
repeated string missingPeriods = 4;
repeated string missing_periods = 4;
string status = 5;
}

File diff suppressed because it is too large Load Diff

2996
gctrpc/rpc_grpc.pb.go Normal file

File diff suppressed because it is too large Load Diff