From 8c6230ca205fc1c274c826832fc8824b085bf1d2 Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Sat, 13 Jun 2020 00:23:21 +0100 Subject: [PATCH] Implement a reverse proxy using grpc-gateway --- Dockerfile | 5 +- Makefile | 8 +- cmd/rove-reverse-proxy/main.go | 45 + cmd/rove-server/internal/server.go | 2 +- cmd/rove/main.go | 2 +- docker-compose.yml | 18 +- go.mod | 5 +- go.sum | 19 +- pkg/accounts/accounts.pb.go | 631 +++++++---- pkg/rove/rove.pb.go | 1413 ++++++++++++++---------- pkg/rove/rove.pb.gw.go | 464 ++++++++ {pkg => proto}/accounts/accounts.proto | 0 proto/google/README.grpc-gateway | 23 + proto/google/api/annotations.proto | 31 + proto/google/api/http.proto | 318 ++++++ proto/google/api/httpbody.proto | 78 ++ proto/google/rpc/code.proto | 186 ++++ proto/google/rpc/error_details.proto | 200 ++++ proto/google/rpc/status.proto | 92 ++ {pkg => proto}/rove/rove.proto | 57 +- proto/rove/rove.swagger.json | 318 ++++++ tools/tools.go | 9 + 22 files changed, 3122 insertions(+), 802 deletions(-) create mode 100644 cmd/rove-reverse-proxy/main.go create mode 100644 pkg/rove/rove.pb.gw.go rename {pkg => proto}/accounts/accounts.proto (100%) create mode 100644 proto/google/README.grpc-gateway create mode 100644 proto/google/api/annotations.proto create mode 100644 proto/google/api/http.proto create mode 100644 proto/google/api/httpbody.proto create mode 100644 proto/google/rpc/code.proto create mode 100644 proto/google/rpc/error_details.proto create mode 100644 proto/google/rpc/status.proto rename {pkg => proto}/rove/rove.proto (76%) create mode 100644 proto/rove/rove.swagger.json create mode 100644 tools/tools.go diff --git a/Dockerfile b/Dockerfile index adedc9b..8c8b3c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,9 +8,10 @@ RUN go mod download # For /usr/share/dict/words RUN apt-get -q update && apt-get -qy install wamerican -# Build both executables +# Build the executables RUN go build -o rove-server -ldflags="-X 'github.com/mdiluz/rove/pkg/version.Version=$(git describe --always --long --dirty --tags)'" cmd/rove-server/main.go -RUN go build -o rove-accountant -ldflags="-X 'github.com/mdiluz/rove/pkg/version.Version=$(git describe --always --long --dirty --tags)'" cmd/rove-accountant/main.go +RUN go build -o rove-accountant cmd/rove-accountant/main.go +RUN go build -o rove-reverse-proxy cmd/rove-reverse-proxy/main.go CMD [ "./rove-server" ] diff --git a/Makefile b/Makefile index 9205bd6..953856d 100644 --- a/Makefile +++ b/Makefile @@ -9,8 +9,12 @@ install: go install -ldflags="-X 'github.com/mdiluz/rove/pkg/version.Version=${VERSION}'" ./... gen: - protoc --proto_path pkg/accounts --go_out=plugins=grpc:pkg/accounts/ --go_opt=paths=source_relative pkg/accounts/accounts.proto - protoc --proto_path pkg/rove --go_out=plugins=grpc:pkg/rove/ --go_opt=paths=source_relative pkg/rove/rove.proto + @echo Generating accountant gRPC + protoc --proto_path proto --go_out=plugins=grpc:pkg/ --go_opt=paths=source_relative proto/accounts/accounts.proto + @echo Generating rove server gRPC + protoc --proto_path proto --go_out=plugins=grpc:pkg/ --go_opt=paths=source_relative proto/rove/rove.proto + protoc --proto_path proto --grpc-gateway_out=paths=source_relative:pkg/ proto/rove/rove.proto + protoc --proto_path proto --swagger_out=logtostderr=true:proto/ proto/rove/rove.proto test: @echo Unit tests diff --git a/cmd/rove-reverse-proxy/main.go b/cmd/rove-reverse-proxy/main.go new file mode 100644 index 0000000..63f6ca1 --- /dev/null +++ b/cmd/rove-reverse-proxy/main.go @@ -0,0 +1,45 @@ +package main + +import ( + "context" + "flag" + "fmt" + "net/http" + "os" + + "github.com/golang/glog" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "google.golang.org/grpc" + + "github.com/mdiluz/rove/pkg/rove" +) + +var endpoint = os.Getenv("GRPC_ENDPOINT") +var address = os.Getenv("HOST_ADDRESS") + +func run() error { + ctx := context.Background() + ctx, cancel := context.WithCancel(ctx) + defer cancel() + + // Create a new mux and register it with the gRPC engpoint + fmt.Printf("Hosting reverse-proxy on %s for %s\n", address, endpoint) + mux := runtime.NewServeMux() + opts := []grpc.DialOption{grpc.WithInsecure()} + err := rove.RegisterRoveServerHandlerFromEndpoint(ctx, mux, endpoint, opts) + if err != nil { + return err + } + + // Start the HTTP server and proxy calls to gRPC endpoint when needed + return http.ListenAndServe(address, mux) +} + +func main() { + flag.Parse() + defer glog.Flush() + + if err := run(); err != nil { + glog.Fatal(err) + } +} diff --git a/cmd/rove-server/internal/server.go b/cmd/rove-server/internal/server.go index 920cbf2..3495bbd 100644 --- a/cmd/rove-server/internal/server.go +++ b/cmd/rove-server/internal/server.go @@ -129,7 +129,7 @@ func (s *Server) Initialise(fillWorld bool) (err error) { log.Fatalf("failed to listen: %v", err) } s.grpcServ = grpc.NewServer() - rove.RegisterRoverServerServer(s.grpcServ, s) + rove.RegisterRoveServerServer(s.grpcServ, s) return nil } diff --git a/cmd/rove/main.go b/cmd/rove/main.go index 7e7e418..2ecd94f 100644 --- a/cmd/rove/main.go +++ b/cmd/rove/main.go @@ -98,7 +98,7 @@ func InnerMain(command string) error { if err != nil { return err } - var client = rove.NewRoverServerClient(clientConn) + var client = rove.NewRoveServerClient(clientConn) ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) defer cancel() diff --git a/docker-compose.yml b/docker-compose.yml index 83b3396..0aa33f1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,8 +18,7 @@ services: - persistent-data:/mnt/rove-server:rw command: [ ./rove-accountant ] - rove-server: - depends_on: [ rove-accountant ] + rove-reverse-proxy: build: context: . dockerfile: Dockerfile @@ -28,6 +27,19 @@ services: - "8080:8080" environment: - HOST_ADDRESS=:8080 + - GRPC_ENDPOINT=rove-server:8082 + command: [ ./rove-reverse-proxy ] + + rove-server: + depends_on: [ rove-accountant, rove-reverse-proxy ] + build: + context: . + dockerfile: Dockerfile + image: rove:latest + ports: + - "8082:8082" + environment: + - HOST_ADDRESS=:8082 - DATA_PATH=/mnt/rove-server - ACCOUNTANT_ADDRESS=rove-accountant:8081 volumes: @@ -41,7 +53,7 @@ services: image: rove:latest environment: - ACCOUNTANT_ADDRESS=rove-accountant:8081 - - ROVE_SERVER_ADDRESS=rove-server:8080 + - ROVE_SERVER_ADDRESS=rove-reverse-proxy:8080 command: [ "go", "test", "-v", "./...", "--tags=integration", "-cover", "-coverprofile=/mnt/coverage-data/c.out", "-count", "1" ] volumes: - /tmp/coverage-data:/mnt/coverage-data:rw diff --git a/go.mod b/go.mod index c9465c4..e21de42 100644 --- a/go.mod +++ b/go.mod @@ -3,13 +3,16 @@ module github.com/mdiluz/rove go 1.14 require ( + github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b github.com/golang/protobuf v1.4.2 github.com/google/uuid v1.1.1 - github.com/gorilla/mux v1.7.4 + github.com/grpc-ecosystem/grpc-gateway v1.14.6 github.com/onsi/ginkgo v1.12.3 // indirect github.com/robfig/cron v1.2.0 github.com/stretchr/testify v1.6.0 github.com/tjarratt/babble v0.0.0-20191209142150-eecdf8c2339d golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7 + google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884 google.golang.org/grpc v1.29.1 + google.golang.org/protobuf v1.23.0 ) diff --git a/go.sum b/go.sum index 499b4f0..57044e0 100644 --- a/go.sum +++ b/go.sum @@ -1,16 +1,22 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -30,8 +36,8 @@ github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc= -github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/grpc-ecosystem/grpc-gateway v1.14.6 h1:8ERzHx8aj1Sc47mu9n/AksaKCSWrMchFtkdrS4BIj5o= +github.com/grpc-ecosystem/grpc-gateway v1.14.6/go.mod h1:zdiPV4Yse/1gnckTHtghG4GkDEdKCRJduHpTxT3/jcw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -47,6 +53,7 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ= github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.6.0 h1:jlIyCplCJFULU/01vCkhKuTyc3OorI3bJFuw6obfgho= github.com/stretchr/testify v1.6.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -60,14 +67,18 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7 h1:AeiKBIuRw3UomYXSbLy0Mc2dDLfdtbT/IVn4keq83P0= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -96,9 +107,12 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884 h1:fiNLklpBwWK1mth30Hlwk+fcdBmIALlgF5iy77O37Ig= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.29.1 h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -113,6 +127,7 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/pkg/accounts/accounts.pb.go b/pkg/accounts/accounts.pb.go index aa6fcd2..ad19fae 100644 --- a/pkg/accounts/accounts.pb.go +++ b/pkg/accounts/accounts.pb.go @@ -1,316 +1,505 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// source: accounts.proto +// versions: +// protoc-gen-go v1.23.0 +// protoc v3.6.1 +// source: accounts/accounts.proto package accounts import ( context "context" - fmt "fmt" proto "github.com/golang/protobuf/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - math "math" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 // RegisterInfo contains the information needed to register an account type RegisterInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // The name for the account, must be unique - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } -func (m *RegisterInfo) Reset() { *m = RegisterInfo{} } -func (m *RegisterInfo) String() string { return proto.CompactTextString(m) } -func (*RegisterInfo) ProtoMessage() {} +func (x *RegisterInfo) Reset() { + *x = RegisterInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_accounts_accounts_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegisterInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterInfo) ProtoMessage() {} + +func (x *RegisterInfo) ProtoReflect() protoreflect.Message { + mi := &file_accounts_accounts_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RegisterInfo.ProtoReflect.Descriptor instead. func (*RegisterInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_e1e7723af4c007b7, []int{0} + return file_accounts_accounts_proto_rawDescGZIP(), []int{0} } -func (m *RegisterInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RegisterInfo.Unmarshal(m, b) -} -func (m *RegisterInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RegisterInfo.Marshal(b, m, deterministic) -} -func (m *RegisterInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_RegisterInfo.Merge(m, src) -} -func (m *RegisterInfo) XXX_Size() int { - return xxx_messageInfo_RegisterInfo.Size(m) -} -func (m *RegisterInfo) XXX_DiscardUnknown() { - xxx_messageInfo_RegisterInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_RegisterInfo proto.InternalMessageInfo - -func (m *RegisterInfo) GetName() string { - if m != nil { - return m.Name +func (x *RegisterInfo) GetName() string { + if x != nil { + return x.Name } return "" } // RegisterResponse is the response information from registering an account type RegisterResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -func (m *RegisterResponse) Reset() { *m = RegisterResponse{} } -func (m *RegisterResponse) String() string { return proto.CompactTextString(m) } -func (*RegisterResponse) ProtoMessage() {} +func (x *RegisterResponse) Reset() { + *x = RegisterResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_accounts_accounts_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegisterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterResponse) ProtoMessage() {} + +func (x *RegisterResponse) ProtoReflect() protoreflect.Message { + mi := &file_accounts_accounts_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RegisterResponse.ProtoReflect.Descriptor instead. func (*RegisterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e1e7723af4c007b7, []int{1} + return file_accounts_accounts_proto_rawDescGZIP(), []int{1} } -func (m *RegisterResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RegisterResponse.Unmarshal(m, b) -} -func (m *RegisterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RegisterResponse.Marshal(b, m, deterministic) -} -func (m *RegisterResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RegisterResponse.Merge(m, src) -} -func (m *RegisterResponse) XXX_Size() int { - return xxx_messageInfo_RegisterResponse.Size(m) -} -func (m *RegisterResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RegisterResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RegisterResponse proto.InternalMessageInfo - // DataKeyValue represents a simple key value pair to assign to an account type DataKeyValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // The account to assign the new key value pair to Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` // The key value pair to assign - Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` + Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` } -func (m *DataKeyValue) Reset() { *m = DataKeyValue{} } -func (m *DataKeyValue) String() string { return proto.CompactTextString(m) } -func (*DataKeyValue) ProtoMessage() {} +func (x *DataKeyValue) Reset() { + *x = DataKeyValue{} + if protoimpl.UnsafeEnabled { + mi := &file_accounts_accounts_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataKeyValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataKeyValue) ProtoMessage() {} + +func (x *DataKeyValue) ProtoReflect() protoreflect.Message { + mi := &file_accounts_accounts_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DataKeyValue.ProtoReflect.Descriptor instead. func (*DataKeyValue) Descriptor() ([]byte, []int) { - return fileDescriptor_e1e7723af4c007b7, []int{2} + return file_accounts_accounts_proto_rawDescGZIP(), []int{2} } -func (m *DataKeyValue) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DataKeyValue.Unmarshal(m, b) -} -func (m *DataKeyValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DataKeyValue.Marshal(b, m, deterministic) -} -func (m *DataKeyValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_DataKeyValue.Merge(m, src) -} -func (m *DataKeyValue) XXX_Size() int { - return xxx_messageInfo_DataKeyValue.Size(m) -} -func (m *DataKeyValue) XXX_DiscardUnknown() { - xxx_messageInfo_DataKeyValue.DiscardUnknown(m) -} - -var xxx_messageInfo_DataKeyValue proto.InternalMessageInfo - -func (m *DataKeyValue) GetAccount() string { - if m != nil { - return m.Account +func (x *DataKeyValue) GetAccount() string { + if x != nil { + return x.Account } return "" } -func (m *DataKeyValue) GetKey() string { - if m != nil { - return m.Key +func (x *DataKeyValue) GetKey() string { + if x != nil { + return x.Key } return "" } -func (m *DataKeyValue) GetValue() string { - if m != nil { - return m.Value +func (x *DataKeyValue) GetValue() string { + if x != nil { + return x.Value } return "" } // DataKeyResponse is a simple response type DataKeyResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -func (m *DataKeyResponse) Reset() { *m = DataKeyResponse{} } -func (m *DataKeyResponse) String() string { return proto.CompactTextString(m) } -func (*DataKeyResponse) ProtoMessage() {} +func (x *DataKeyResponse) Reset() { + *x = DataKeyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_accounts_accounts_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataKeyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataKeyResponse) ProtoMessage() {} + +func (x *DataKeyResponse) ProtoReflect() protoreflect.Message { + mi := &file_accounts_accounts_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DataKeyResponse.ProtoReflect.Descriptor instead. func (*DataKeyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e1e7723af4c007b7, []int{3} + return file_accounts_accounts_proto_rawDescGZIP(), []int{3} } -func (m *DataKeyResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DataKeyResponse.Unmarshal(m, b) -} -func (m *DataKeyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DataKeyResponse.Marshal(b, m, deterministic) -} -func (m *DataKeyResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DataKeyResponse.Merge(m, src) -} -func (m *DataKeyResponse) XXX_Size() int { - return xxx_messageInfo_DataKeyResponse.Size(m) -} -func (m *DataKeyResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DataKeyResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DataKeyResponse proto.InternalMessageInfo - // DataKey describes a simple key value with an account, for fetching type DataKey struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // The account to fetch data for Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` // The key to fetch - Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` } -func (m *DataKey) Reset() { *m = DataKey{} } -func (m *DataKey) String() string { return proto.CompactTextString(m) } -func (*DataKey) ProtoMessage() {} +func (x *DataKey) Reset() { + *x = DataKey{} + if protoimpl.UnsafeEnabled { + mi := &file_accounts_accounts_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataKey) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataKey) ProtoMessage() {} + +func (x *DataKey) ProtoReflect() protoreflect.Message { + mi := &file_accounts_accounts_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DataKey.ProtoReflect.Descriptor instead. func (*DataKey) Descriptor() ([]byte, []int) { - return fileDescriptor_e1e7723af4c007b7, []int{4} + return file_accounts_accounts_proto_rawDescGZIP(), []int{4} } -func (m *DataKey) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DataKey.Unmarshal(m, b) -} -func (m *DataKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DataKey.Marshal(b, m, deterministic) -} -func (m *DataKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_DataKey.Merge(m, src) -} -func (m *DataKey) XXX_Size() int { - return xxx_messageInfo_DataKey.Size(m) -} -func (m *DataKey) XXX_DiscardUnknown() { - xxx_messageInfo_DataKey.DiscardUnknown(m) -} - -var xxx_messageInfo_DataKey proto.InternalMessageInfo - -func (m *DataKey) GetAccount() string { - if m != nil { - return m.Account +func (x *DataKey) GetAccount() string { + if x != nil { + return x.Account } return "" } -func (m *DataKey) GetKey() string { - if m != nil { - return m.Key +func (x *DataKey) GetKey() string { + if x != nil { + return x.Key } return "" } // DataResponse describes a data fetch response type DataResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // The value of the key - Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` } -func (m *DataResponse) Reset() { *m = DataResponse{} } -func (m *DataResponse) String() string { return proto.CompactTextString(m) } -func (*DataResponse) ProtoMessage() {} +func (x *DataResponse) Reset() { + *x = DataResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_accounts_accounts_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataResponse) ProtoMessage() {} + +func (x *DataResponse) ProtoReflect() protoreflect.Message { + mi := &file_accounts_accounts_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DataResponse.ProtoReflect.Descriptor instead. func (*DataResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e1e7723af4c007b7, []int{5} + return file_accounts_accounts_proto_rawDescGZIP(), []int{5} } -func (m *DataResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DataResponse.Unmarshal(m, b) -} -func (m *DataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DataResponse.Marshal(b, m, deterministic) -} -func (m *DataResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DataResponse.Merge(m, src) -} -func (m *DataResponse) XXX_Size() int { - return xxx_messageInfo_DataResponse.Size(m) -} -func (m *DataResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DataResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DataResponse proto.InternalMessageInfo - -func (m *DataResponse) GetValue() string { - if m != nil { - return m.Value +func (x *DataResponse) GetValue() string { + if x != nil { + return x.Value } return "" } -func init() { - proto.RegisterType((*RegisterInfo)(nil), "accounts.RegisterInfo") - proto.RegisterType((*RegisterResponse)(nil), "accounts.RegisterResponse") - proto.RegisterType((*DataKeyValue)(nil), "accounts.DataKeyValue") - proto.RegisterType((*DataKeyResponse)(nil), "accounts.DataKeyResponse") - proto.RegisterType((*DataKey)(nil), "accounts.DataKey") - proto.RegisterType((*DataResponse)(nil), "accounts.DataResponse") +var File_accounts_accounts_proto protoreflect.FileDescriptor + +var file_accounts_accounts_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x22, 0x22, 0x0a, 0x0c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, + 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x12, 0x0a, 0x10, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x50, 0x0a, 0x0c, 0x44, + 0x61, 0x74, 0x61, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x11, 0x0a, + 0x0f, 0x44, 0x61, 0x74, 0x61, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x35, 0x0a, 0x07, 0x44, 0x61, 0x74, 0x61, 0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x24, 0x0a, 0x0c, 0x44, 0x61, 0x74, 0x61, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x32, 0xcb, 0x01, + 0x0a, 0x0a, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x61, 0x6e, 0x74, 0x12, 0x40, 0x0a, 0x08, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x16, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, + 0x1a, 0x1a, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x52, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x42, + 0x0a, 0x0b, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x16, 0x2e, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4b, 0x65, 0x79, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x19, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, + 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x37, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x11, + 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4b, 0x65, + 0x79, 0x1a, 0x16, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x44, 0x61, 0x74, + 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x25, 0x5a, 0x23, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x64, 0x69, 0x6c, 0x75, 0x7a, + 0x2f, 0x72, 0x6f, 0x76, 0x65, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -func init() { - proto.RegisterFile("accounts.proto", fileDescriptor_e1e7723af4c007b7) +var ( + file_accounts_accounts_proto_rawDescOnce sync.Once + file_accounts_accounts_proto_rawDescData = file_accounts_accounts_proto_rawDesc +) + +func file_accounts_accounts_proto_rawDescGZIP() []byte { + file_accounts_accounts_proto_rawDescOnce.Do(func() { + file_accounts_accounts_proto_rawDescData = protoimpl.X.CompressGZIP(file_accounts_accounts_proto_rawDescData) + }) + return file_accounts_accounts_proto_rawDescData } -var fileDescriptor_e1e7723af4c007b7 = []byte{ - // 276 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x91, 0x41, 0x4b, 0xc3, 0x40, - 0x10, 0x85, 0x8d, 0x55, 0x1b, 0xc7, 0xa2, 0xed, 0x20, 0x12, 0x73, 0x92, 0x55, 0xc1, 0x53, 0x02, - 0x8a, 0x78, 0xb5, 0x45, 0x10, 0xf1, 0x22, 0x39, 0x78, 0xf0, 0xb6, 0x8d, 0x63, 0x0c, 0x6d, 0x76, - 0x43, 0x76, 0x53, 0xa8, 0x7f, 0xd1, 0x3f, 0x25, 0xc9, 0x66, 0x63, 0x30, 0x5e, 0x7a, 0x9b, 0x79, - 0xcc, 0xfb, 0x66, 0xf6, 0x2d, 0x1c, 0xf2, 0x38, 0x96, 0xa5, 0xd0, 0x2a, 0xc8, 0x0b, 0xa9, 0x25, - 0xba, 0xb6, 0x67, 0x0c, 0x46, 0x11, 0x25, 0xa9, 0xd2, 0x54, 0x3c, 0x89, 0x0f, 0x89, 0x08, 0x3b, - 0x82, 0x67, 0xe4, 0x39, 0x67, 0xce, 0xd5, 0x7e, 0x54, 0xd7, 0x0c, 0x61, 0x6c, 0x67, 0x22, 0x52, - 0xb9, 0x14, 0x8a, 0xd8, 0x0b, 0x8c, 0x1e, 0xb8, 0xe6, 0xcf, 0xb4, 0x7e, 0xe5, 0xcb, 0x92, 0xd0, - 0x83, 0x61, 0xc3, 0x6c, 0xac, 0xb6, 0xc5, 0x31, 0x0c, 0x16, 0xb4, 0xf6, 0xb6, 0x6b, 0xb5, 0x2a, - 0xf1, 0x18, 0x76, 0x57, 0x95, 0xc9, 0x1b, 0xd4, 0x9a, 0x69, 0xd8, 0x04, 0x8e, 0x1a, 0x62, 0xbb, - 0xe4, 0x16, 0x86, 0x8d, 0xb4, 0x09, 0x9f, 0x5d, 0x98, 0xdb, 0x2c, 0xe6, 0xff, 0x7d, 0xd7, 0xdf, - 0x0e, 0xc0, 0xd4, 0x30, 0xb8, 0xd0, 0x78, 0x0f, 0xae, 0x7d, 0x24, 0x9e, 0x04, 0x6d, 0x5e, 0xdd, - 0x70, 0x7c, 0xbf, 0xaf, 0xb7, 0xb7, 0x6e, 0xe1, 0x0c, 0x0e, 0xa6, 0x4a, 0xa5, 0x89, 0x30, 0x89, - 0x74, 0x20, 0xdd, 0xa4, 0xfc, 0xd3, 0x9e, 0xde, 0x61, 0xdc, 0x81, 0xfb, 0x48, 0xda, 0x00, 0x26, - 0xbd, 0x41, 0xff, 0x0f, 0xf3, 0xd7, 0x38, 0xbb, 0x7c, 0x3b, 0x4f, 0x52, 0xfd, 0x59, 0xce, 0x83, - 0x58, 0x66, 0x61, 0xf6, 0x9e, 0x2e, 0xcb, 0xaf, 0xb0, 0x90, 0x2b, 0x0a, 0xf3, 0x45, 0x12, 0x5a, - 0xd7, 0x7c, 0xaf, 0xfe, 0xff, 0x9b, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x22, 0x35, 0x31, 0x6f, - 0x11, 0x02, 0x00, 0x00, +var file_accounts_accounts_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_accounts_accounts_proto_goTypes = []interface{}{ + (*RegisterInfo)(nil), // 0: accounts.RegisterInfo + (*RegisterResponse)(nil), // 1: accounts.RegisterResponse + (*DataKeyValue)(nil), // 2: accounts.DataKeyValue + (*DataKeyResponse)(nil), // 3: accounts.DataKeyResponse + (*DataKey)(nil), // 4: accounts.DataKey + (*DataResponse)(nil), // 5: accounts.DataResponse +} +var file_accounts_accounts_proto_depIdxs = []int32{ + 0, // 0: accounts.Accountant.Register:input_type -> accounts.RegisterInfo + 2, // 1: accounts.Accountant.AssignValue:input_type -> accounts.DataKeyValue + 4, // 2: accounts.Accountant.GetValue:input_type -> accounts.DataKey + 1, // 3: accounts.Accountant.Register:output_type -> accounts.RegisterResponse + 3, // 4: accounts.Accountant.AssignValue:output_type -> accounts.DataKeyResponse + 5, // 5: accounts.Accountant.GetValue:output_type -> accounts.DataResponse + 3, // [3:6] is the sub-list for method output_type + 0, // [0:3] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_accounts_accounts_proto_init() } +func file_accounts_accounts_proto_init() { + if File_accounts_accounts_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_accounts_accounts_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegisterInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_accounts_accounts_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegisterResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_accounts_accounts_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataKeyValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_accounts_accounts_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataKeyResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_accounts_accounts_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataKey); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_accounts_accounts_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_accounts_accounts_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_accounts_accounts_proto_goTypes, + DependencyIndexes: file_accounts_accounts_proto_depIdxs, + MessageInfos: file_accounts_accounts_proto_msgTypes, + }.Build() + File_accounts_accounts_proto = out.File + file_accounts_accounts_proto_rawDesc = nil + file_accounts_accounts_proto_goTypes = nil + file_accounts_accounts_proto_depIdxs = nil } // Reference imports to suppress errors if they are not otherwise used. @@ -384,13 +573,13 @@ type AccountantServer interface { type UnimplementedAccountantServer struct { } -func (*UnimplementedAccountantServer) Register(ctx context.Context, req *RegisterInfo) (*RegisterResponse, error) { +func (*UnimplementedAccountantServer) Register(context.Context, *RegisterInfo) (*RegisterResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Register not implemented") } -func (*UnimplementedAccountantServer) AssignValue(ctx context.Context, req *DataKeyValue) (*DataKeyResponse, error) { +func (*UnimplementedAccountantServer) AssignValue(context.Context, *DataKeyValue) (*DataKeyResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AssignValue not implemented") } -func (*UnimplementedAccountantServer) GetValue(ctx context.Context, req *DataKey) (*DataResponse, error) { +func (*UnimplementedAccountantServer) GetValue(context.Context, *DataKey) (*DataResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetValue not implemented") } @@ -470,5 +659,5 @@ var _Accountant_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "accounts.proto", + Metadata: "accounts/accounts.proto", } diff --git a/pkg/rove/rove.pb.go b/pkg/rove/rove.pb.go index a9d0f02..1dff955 100644 --- a/pkg/rove/rove.pb.go +++ b/pkg/rove/rove.pb.go @@ -1,340 +1,406 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// source: rove.proto +// versions: +// protoc-gen-go v1.23.0 +// protoc v3.6.1 +// source: rove/rove.proto package rove import ( context "context" - fmt "fmt" proto "github.com/golang/protobuf/proto" empty "github.com/golang/protobuf/ptypes/empty" + _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - math "math" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 type Command struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // The command to execute, currently only accepts move, which requires a bearing and a duration. - Command string `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` - Bearing string `protobuf:"bytes,2,opt,name=bearing,proto3" json:"bearing,omitempty"` - Duration int32 `protobuf:"varint,3,opt,name=duration,proto3" json:"duration,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Command string `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` + Bearing string `protobuf:"bytes,2,opt,name=bearing,proto3" json:"bearing,omitempty"` + Duration int32 `protobuf:"varint,3,opt,name=duration,proto3" json:"duration,omitempty"` } -func (m *Command) Reset() { *m = Command{} } -func (m *Command) String() string { return proto.CompactTextString(m) } -func (*Command) ProtoMessage() {} +func (x *Command) Reset() { + *x = Command{} + if protoimpl.UnsafeEnabled { + mi := &file_rove_rove_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Command) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Command) ProtoMessage() {} + +func (x *Command) ProtoReflect() protoreflect.Message { + mi := &file_rove_rove_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Command.ProtoReflect.Descriptor instead. func (*Command) Descriptor() ([]byte, []int) { - return fileDescriptor_cea399972d1e9fa7, []int{0} + return file_rove_rove_proto_rawDescGZIP(), []int{0} } -func (m *Command) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Command.Unmarshal(m, b) -} -func (m *Command) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Command.Marshal(b, m, deterministic) -} -func (m *Command) XXX_Merge(src proto.Message) { - xxx_messageInfo_Command.Merge(m, src) -} -func (m *Command) XXX_Size() int { - return xxx_messageInfo_Command.Size(m) -} -func (m *Command) XXX_DiscardUnknown() { - xxx_messageInfo_Command.DiscardUnknown(m) -} - -var xxx_messageInfo_Command proto.InternalMessageInfo - -func (m *Command) GetCommand() string { - if m != nil { - return m.Command +func (x *Command) GetCommand() string { + if x != nil { + return x.Command } return "" } -func (m *Command) GetBearing() string { - if m != nil { - return m.Bearing +func (x *Command) GetBearing() string { + if x != nil { + return x.Bearing } return "" } -func (m *Command) GetDuration() int32 { - if m != nil { - return m.Duration +func (x *Command) GetDuration() int32 { + if x != nil { + return x.Duration } return 0 } type CommandsRequest struct { - Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` - Commands []*Command `protobuf:"bytes,2,rep,name=commands,proto3" json:"commands,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` + Commands []*Command `protobuf:"bytes,2,rep,name=commands,proto3" json:"commands,omitempty"` } -func (m *CommandsRequest) Reset() { *m = CommandsRequest{} } -func (m *CommandsRequest) String() string { return proto.CompactTextString(m) } -func (*CommandsRequest) ProtoMessage() {} +func (x *CommandsRequest) Reset() { + *x = CommandsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rove_rove_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CommandsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommandsRequest) ProtoMessage() {} + +func (x *CommandsRequest) ProtoReflect() protoreflect.Message { + mi := &file_rove_rove_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CommandsRequest.ProtoReflect.Descriptor instead. func (*CommandsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_cea399972d1e9fa7, []int{1} + return file_rove_rove_proto_rawDescGZIP(), []int{1} } -func (m *CommandsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CommandsRequest.Unmarshal(m, b) -} -func (m *CommandsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CommandsRequest.Marshal(b, m, deterministic) -} -func (m *CommandsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CommandsRequest.Merge(m, src) -} -func (m *CommandsRequest) XXX_Size() int { - return xxx_messageInfo_CommandsRequest.Size(m) -} -func (m *CommandsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CommandsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CommandsRequest proto.InternalMessageInfo - -func (m *CommandsRequest) GetAccount() string { - if m != nil { - return m.Account +func (x *CommandsRequest) GetAccount() string { + if x != nil { + return x.Account } return "" } -func (m *CommandsRequest) GetCommands() []*Command { - if m != nil { - return m.Commands +func (x *CommandsRequest) GetCommands() []*Command { + if x != nil { + return x.Commands } return nil } type Error struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // An explanation for the HTTP error returned - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` } -func (m *Error) Reset() { *m = Error{} } -func (m *Error) String() string { return proto.CompactTextString(m) } -func (*Error) ProtoMessage() {} +func (x *Error) Reset() { + *x = Error{} + if protoimpl.UnsafeEnabled { + mi := &file_rove_rove_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Error) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Error) ProtoMessage() {} + +func (x *Error) ProtoReflect() protoreflect.Message { + mi := &file_rove_rove_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Error.ProtoReflect.Descriptor instead. func (*Error) Descriptor() ([]byte, []int) { - return fileDescriptor_cea399972d1e9fa7, []int{2} + return file_rove_rove_proto_rawDescGZIP(), []int{2} } -func (m *Error) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Error.Unmarshal(m, b) -} -func (m *Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Error.Marshal(b, m, deterministic) -} -func (m *Error) XXX_Merge(src proto.Message) { - xxx_messageInfo_Error.Merge(m, src) -} -func (m *Error) XXX_Size() int { - return xxx_messageInfo_Error.Size(m) -} -func (m *Error) XXX_DiscardUnknown() { - xxx_messageInfo_Error.DiscardUnknown(m) -} - -var xxx_messageInfo_Error proto.InternalMessageInfo - -func (m *Error) GetError() string { - if m != nil { - return m.Error +func (x *Error) GetError() string { + if x != nil { + return x.Error } return "" } type RadarRequest struct { - Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` } -func (m *RadarRequest) Reset() { *m = RadarRequest{} } -func (m *RadarRequest) String() string { return proto.CompactTextString(m) } -func (*RadarRequest) ProtoMessage() {} +func (x *RadarRequest) Reset() { + *x = RadarRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rove_rove_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RadarRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RadarRequest) ProtoMessage() {} + +func (x *RadarRequest) ProtoReflect() protoreflect.Message { + mi := &file_rove_rove_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RadarRequest.ProtoReflect.Descriptor instead. func (*RadarRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_cea399972d1e9fa7, []int{3} + return file_rove_rove_proto_rawDescGZIP(), []int{3} } -func (m *RadarRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RadarRequest.Unmarshal(m, b) -} -func (m *RadarRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RadarRequest.Marshal(b, m, deterministic) -} -func (m *RadarRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RadarRequest.Merge(m, src) -} -func (m *RadarRequest) XXX_Size() int { - return xxx_messageInfo_RadarRequest.Size(m) -} -func (m *RadarRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RadarRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RadarRequest proto.InternalMessageInfo - -func (m *RadarRequest) GetAccount() string { - if m != nil { - return m.Account +func (x *RadarRequest) GetAccount() string { + if x != nil { + return x.Account } return "" } type RadarResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // The range in tiles from the rover of the radar data Range int32 `protobuf:"varint,1,opt,name=range,proto3" json:"range,omitempty"` // A 1D array representing range*2 + 1 squared set of tiles, origin bottom left and in row->column order - Tiles []byte `protobuf:"bytes,2,opt,name=tiles,proto3" json:"tiles,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Tiles []byte `protobuf:"bytes,2,opt,name=tiles,proto3" json:"tiles,omitempty"` } -func (m *RadarResponse) Reset() { *m = RadarResponse{} } -func (m *RadarResponse) String() string { return proto.CompactTextString(m) } -func (*RadarResponse) ProtoMessage() {} +func (x *RadarResponse) Reset() { + *x = RadarResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rove_rove_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RadarResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RadarResponse) ProtoMessage() {} + +func (x *RadarResponse) ProtoReflect() protoreflect.Message { + mi := &file_rove_rove_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RadarResponse.ProtoReflect.Descriptor instead. func (*RadarResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cea399972d1e9fa7, []int{4} + return file_rove_rove_proto_rawDescGZIP(), []int{4} } -func (m *RadarResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RadarResponse.Unmarshal(m, b) -} -func (m *RadarResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RadarResponse.Marshal(b, m, deterministic) -} -func (m *RadarResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RadarResponse.Merge(m, src) -} -func (m *RadarResponse) XXX_Size() int { - return xxx_messageInfo_RadarResponse.Size(m) -} -func (m *RadarResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RadarResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RadarResponse proto.InternalMessageInfo - -func (m *RadarResponse) GetRange() int32 { - if m != nil { - return m.Range +func (x *RadarResponse) GetRange() int32 { + if x != nil { + return x.Range } return 0 } -func (m *RadarResponse) GetTiles() []byte { - if m != nil { - return m.Tiles +func (x *RadarResponse) GetTiles() []byte { + if x != nil { + return x.Tiles } return nil } type RegisterRequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } -func (m *RegisterRequest) Reset() { *m = RegisterRequest{} } -func (m *RegisterRequest) String() string { return proto.CompactTextString(m) } -func (*RegisterRequest) ProtoMessage() {} +func (x *RegisterRequest) Reset() { + *x = RegisterRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rove_rove_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegisterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterRequest) ProtoMessage() {} + +func (x *RegisterRequest) ProtoReflect() protoreflect.Message { + mi := &file_rove_rove_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RegisterRequest.ProtoReflect.Descriptor instead. func (*RegisterRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_cea399972d1e9fa7, []int{5} + return file_rove_rove_proto_rawDescGZIP(), []int{5} } -func (m *RegisterRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RegisterRequest.Unmarshal(m, b) -} -func (m *RegisterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RegisterRequest.Marshal(b, m, deterministic) -} -func (m *RegisterRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RegisterRequest.Merge(m, src) -} -func (m *RegisterRequest) XXX_Size() int { - return xxx_messageInfo_RegisterRequest.Size(m) -} -func (m *RegisterRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RegisterRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RegisterRequest proto.InternalMessageInfo - -func (m *RegisterRequest) GetName() string { - if m != nil { - return m.Name +func (x *RegisterRequest) GetName() string { + if x != nil { + return x.Name } return "" } type RoverRequest struct { - Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` } -func (m *RoverRequest) Reset() { *m = RoverRequest{} } -func (m *RoverRequest) String() string { return proto.CompactTextString(m) } -func (*RoverRequest) ProtoMessage() {} +func (x *RoverRequest) Reset() { + *x = RoverRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rove_rove_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RoverRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RoverRequest) ProtoMessage() {} + +func (x *RoverRequest) ProtoReflect() protoreflect.Message { + mi := &file_rove_rove_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RoverRequest.ProtoReflect.Descriptor instead. func (*RoverRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_cea399972d1e9fa7, []int{6} + return file_rove_rove_proto_rawDescGZIP(), []int{6} } -func (m *RoverRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RoverRequest.Unmarshal(m, b) -} -func (m *RoverRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RoverRequest.Marshal(b, m, deterministic) -} -func (m *RoverRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RoverRequest.Merge(m, src) -} -func (m *RoverRequest) XXX_Size() int { - return xxx_messageInfo_RoverRequest.Size(m) -} -func (m *RoverRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RoverRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RoverRequest proto.InternalMessageInfo - -func (m *RoverRequest) GetAccount() string { - if m != nil { - return m.Account +func (x *RoverRequest) GetAccount() string { + if x != nil { + return x.Account } return "" } type RoverResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // The name of the rover Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Position of the rover in world coordinates @@ -342,66 +408,74 @@ type RoverResponse struct { // The range of this rover's radar Range int32 `protobuf:"varint,3,opt,name=range,proto3" json:"range,omitempty"` // The speed the rover can move per tick - Speed int32 `protobuf:"varint,4,opt,name=speed,proto3" json:"speed,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Speed int32 `protobuf:"varint,4,opt,name=speed,proto3" json:"speed,omitempty"` } -func (m *RoverResponse) Reset() { *m = RoverResponse{} } -func (m *RoverResponse) String() string { return proto.CompactTextString(m) } -func (*RoverResponse) ProtoMessage() {} +func (x *RoverResponse) Reset() { + *x = RoverResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rove_rove_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RoverResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RoverResponse) ProtoMessage() {} + +func (x *RoverResponse) ProtoReflect() protoreflect.Message { + mi := &file_rove_rove_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RoverResponse.ProtoReflect.Descriptor instead. func (*RoverResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cea399972d1e9fa7, []int{7} + return file_rove_rove_proto_rawDescGZIP(), []int{7} } -func (m *RoverResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RoverResponse.Unmarshal(m, b) -} -func (m *RoverResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RoverResponse.Marshal(b, m, deterministic) -} -func (m *RoverResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RoverResponse.Merge(m, src) -} -func (m *RoverResponse) XXX_Size() int { - return xxx_messageInfo_RoverResponse.Size(m) -} -func (m *RoverResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RoverResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RoverResponse proto.InternalMessageInfo - -func (m *RoverResponse) GetName() string { - if m != nil { - return m.Name +func (x *RoverResponse) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *RoverResponse) GetPosition() *Vector { - if m != nil { - return m.Position +func (x *RoverResponse) GetPosition() *Vector { + if x != nil { + return x.Position } return nil } -func (m *RoverResponse) GetRange() int32 { - if m != nil { - return m.Range +func (x *RoverResponse) GetRange() int32 { + if x != nil { + return x.Range } return 0 } -func (m *RoverResponse) GetSpeed() int32 { - if m != nil { - return m.Speed +func (x *RoverResponse) GetSpeed() int32 { + if x != nil { + return x.Speed } return 0 } type StatusResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // The time the next tick will occur NextTick string `protobuf:"bytes,1,opt,name=next_tick,json=nextTick,proto3" json:"next_tick,omitempty"` // Whether the server is ready to accept requests @@ -409,161 +483,394 @@ type StatusResponse struct { // The tick rate of the server in minutes (how many minutes per tick) Tick int32 `protobuf:"varint,3,opt,name=tick,proto3" json:"tick,omitempty"` // The version of the server in v{major}.{minor}-{delta}-{sha} form - Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` } -func (m *StatusResponse) Reset() { *m = StatusResponse{} } -func (m *StatusResponse) String() string { return proto.CompactTextString(m) } -func (*StatusResponse) ProtoMessage() {} +func (x *StatusResponse) Reset() { + *x = StatusResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rove_rove_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatusResponse) ProtoMessage() {} + +func (x *StatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_rove_rove_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead. func (*StatusResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cea399972d1e9fa7, []int{8} + return file_rove_rove_proto_rawDescGZIP(), []int{8} } -func (m *StatusResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StatusResponse.Unmarshal(m, b) -} -func (m *StatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StatusResponse.Marshal(b, m, deterministic) -} -func (m *StatusResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_StatusResponse.Merge(m, src) -} -func (m *StatusResponse) XXX_Size() int { - return xxx_messageInfo_StatusResponse.Size(m) -} -func (m *StatusResponse) XXX_DiscardUnknown() { - xxx_messageInfo_StatusResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_StatusResponse proto.InternalMessageInfo - -func (m *StatusResponse) GetNextTick() string { - if m != nil { - return m.NextTick +func (x *StatusResponse) GetNextTick() string { + if x != nil { + return x.NextTick } return "" } -func (m *StatusResponse) GetReady() bool { - if m != nil { - return m.Ready +func (x *StatusResponse) GetReady() bool { + if x != nil { + return x.Ready } return false } -func (m *StatusResponse) GetTick() int32 { - if m != nil { - return m.Tick +func (x *StatusResponse) GetTick() int32 { + if x != nil { + return x.Tick } return 0 } -func (m *StatusResponse) GetVersion() string { - if m != nil { - return m.Version +func (x *StatusResponse) GetVersion() string { + if x != nil { + return x.Version } return "" } type Vector struct { - X int32 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"` - Y int32 `protobuf:"varint,2,opt,name=y,proto3" json:"y,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + X int32 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"` + Y int32 `protobuf:"varint,2,opt,name=y,proto3" json:"y,omitempty"` } -func (m *Vector) Reset() { *m = Vector{} } -func (m *Vector) String() string { return proto.CompactTextString(m) } -func (*Vector) ProtoMessage() {} +func (x *Vector) Reset() { + *x = Vector{} + if protoimpl.UnsafeEnabled { + mi := &file_rove_rove_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Vector) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Vector) ProtoMessage() {} + +func (x *Vector) ProtoReflect() protoreflect.Message { + mi := &file_rove_rove_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Vector.ProtoReflect.Descriptor instead. func (*Vector) Descriptor() ([]byte, []int) { - return fileDescriptor_cea399972d1e9fa7, []int{9} + return file_rove_rove_proto_rawDescGZIP(), []int{9} } -func (m *Vector) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Vector.Unmarshal(m, b) -} -func (m *Vector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Vector.Marshal(b, m, deterministic) -} -func (m *Vector) XXX_Merge(src proto.Message) { - xxx_messageInfo_Vector.Merge(m, src) -} -func (m *Vector) XXX_Size() int { - return xxx_messageInfo_Vector.Size(m) -} -func (m *Vector) XXX_DiscardUnknown() { - xxx_messageInfo_Vector.DiscardUnknown(m) -} - -var xxx_messageInfo_Vector proto.InternalMessageInfo - -func (m *Vector) GetX() int32 { - if m != nil { - return m.X +func (x *Vector) GetX() int32 { + if x != nil { + return x.X } return 0 } -func (m *Vector) GetY() int32 { - if m != nil { - return m.Y +func (x *Vector) GetY() int32 { + if x != nil { + return x.Y } return 0 } -func init() { - proto.RegisterType((*Command)(nil), "rove.Command") - proto.RegisterType((*CommandsRequest)(nil), "rove.CommandsRequest") - proto.RegisterType((*Error)(nil), "rove.Error") - proto.RegisterType((*RadarRequest)(nil), "rove.RadarRequest") - proto.RegisterType((*RadarResponse)(nil), "rove.RadarResponse") - proto.RegisterType((*RegisterRequest)(nil), "rove.RegisterRequest") - proto.RegisterType((*RoverRequest)(nil), "rove.RoverRequest") - proto.RegisterType((*RoverResponse)(nil), "rove.RoverResponse") - proto.RegisterType((*StatusResponse)(nil), "rove.StatusResponse") - proto.RegisterType((*Vector)(nil), "rove.Vector") +var File_rove_rove_proto protoreflect.FileDescriptor + +var file_rove_rove_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x72, 0x6f, 0x76, 0x65, 0x2f, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x04, 0x72, 0x6f, 0x76, 0x65, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x59, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x18, 0x0a, + 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x65, 0x61, 0x72, 0x69, + 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x65, 0x61, 0x72, 0x69, 0x6e, + 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x56, 0x0a, + 0x0f, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x29, 0x0a, 0x08, 0x63, 0x6f, + 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x72, + 0x6f, 0x76, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x08, 0x63, 0x6f, 0x6d, + 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x22, 0x1d, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x14, + 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x22, 0x28, 0x0a, 0x0c, 0x52, 0x61, 0x64, 0x61, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x3b, + 0x0a, 0x0d, 0x52, 0x61, 0x64, 0x61, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, + 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x74, 0x69, 0x6c, 0x65, 0x73, 0x22, 0x25, 0x0a, 0x0f, 0x52, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x22, 0x28, 0x0a, 0x0c, 0x52, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x79, 0x0a, 0x0d, + 0x52, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x28, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x72, + 0x61, 0x6e, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x70, 0x65, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x73, 0x70, 0x65, 0x65, 0x64, 0x22, 0x71, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x65, 0x78, + 0x74, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x65, + 0x78, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x69, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x69, 0x63, 0x6b, + 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x24, 0x0a, 0x06, 0x56, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x01, 0x79, + 0x32, 0xfb, 0x02, 0x0a, 0x0a, 0x52, 0x6f, 0x76, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, + 0x47, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x1a, 0x14, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x09, 0x12, + 0x07, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x4f, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x22, 0x09, 0x2f, 0x72, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x3a, 0x01, 0x2a, 0x12, 0x4f, 0x0a, 0x08, 0x43, 0x6f, 0x6d, + 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x12, 0x15, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x43, 0x6f, 0x6d, + 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x22, 0x09, 0x2f, 0x63, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0x40, 0x0a, 0x05, 0x52, 0x61, + 0x64, 0x61, 0x72, 0x12, 0x12, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x61, 0x64, 0x61, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, + 0x61, 0x64, 0x61, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0e, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x08, 0x12, 0x06, 0x2f, 0x72, 0x61, 0x64, 0x61, 0x72, 0x12, 0x40, 0x0a, 0x05, + 0x52, 0x6f, 0x76, 0x65, 0x72, 0x12, 0x12, 0x2e, 0x72, 0x6f, 0x76, 0x65, 0x2e, 0x52, 0x6f, 0x76, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x72, 0x6f, 0x76, 0x65, + 0x2e, 0x52, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0e, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x08, 0x12, 0x06, 0x2f, 0x72, 0x6f, 0x76, 0x65, 0x72, 0x42, 0x21, + 0x5a, 0x1f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x64, 0x69, + 0x6c, 0x75, 0x7a, 0x2f, 0x72, 0x6f, 0x76, 0x65, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x72, 0x6f, 0x76, + 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -func init() { - proto.RegisterFile("rove.proto", fileDescriptor_cea399972d1e9fa7) +var ( + file_rove_rove_proto_rawDescOnce sync.Once + file_rove_rove_proto_rawDescData = file_rove_rove_proto_rawDesc +) + +func file_rove_rove_proto_rawDescGZIP() []byte { + file_rove_rove_proto_rawDescOnce.Do(func() { + file_rove_rove_proto_rawDescData = protoimpl.X.CompressGZIP(file_rove_rove_proto_rawDescData) + }) + return file_rove_rove_proto_rawDescData } -var fileDescriptor_cea399972d1e9fa7 = []byte{ - // 477 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x5d, 0x6b, 0xdb, 0x30, - 0x14, 0x8d, 0x93, 0x38, 0x75, 0x6f, 0x92, 0x15, 0xb4, 0x6e, 0x98, 0x94, 0x41, 0x10, 0x1b, 0x64, - 0x2f, 0x2e, 0x64, 0x2f, 0x83, 0x3e, 0x8e, 0xfe, 0x01, 0x75, 0x14, 0xf6, 0x34, 0x14, 0xfb, 0xce, - 0x98, 0x36, 0x96, 0x2b, 0xc9, 0x21, 0xf9, 0x49, 0xfb, 0x97, 0x43, 0xba, 0xb2, 0x97, 0x94, 0x8d, - 0xf6, 0xed, 0x9e, 0xab, 0xab, 0x73, 0xce, 0xfd, 0x00, 0xd0, 0x6a, 0x87, 0x59, 0xa3, 0x95, 0x55, - 0x6c, 0xec, 0xe2, 0xc5, 0x55, 0xa9, 0x54, 0xf9, 0x88, 0xd7, 0x3e, 0xb7, 0x69, 0x7f, 0x5d, 0xe3, - 0xb6, 0xb1, 0x07, 0x2a, 0xe1, 0x3f, 0xe0, 0xec, 0x9b, 0xda, 0x6e, 0x65, 0x5d, 0xb0, 0x14, 0xce, - 0x72, 0x0a, 0xd3, 0x68, 0x19, 0xad, 0xce, 0x45, 0x07, 0xdd, 0xcb, 0x06, 0xa5, 0xae, 0xea, 0x32, - 0x1d, 0xd2, 0x4b, 0x80, 0x6c, 0x01, 0x49, 0xd1, 0x6a, 0x69, 0x2b, 0x55, 0xa7, 0xa3, 0x65, 0xb4, - 0x8a, 0x45, 0x8f, 0xf9, 0x3d, 0x5c, 0x04, 0x6a, 0x23, 0xf0, 0xa9, 0x45, 0x63, 0x1d, 0x91, 0xcc, - 0x73, 0xd5, 0xd6, 0xb6, 0x93, 0x08, 0x90, 0x7d, 0x86, 0x24, 0xa8, 0x99, 0x74, 0xb8, 0x1c, 0xad, - 0xa6, 0xeb, 0x79, 0xe6, 0x3b, 0x09, 0x14, 0xa2, 0x7f, 0xe6, 0x1f, 0x20, 0xbe, 0xd5, 0x5a, 0x69, - 0x76, 0x09, 0x31, 0xba, 0x20, 0x70, 0x11, 0xe0, 0x2b, 0x98, 0x09, 0x59, 0x48, 0xfd, 0xa2, 0x26, - 0xbf, 0x81, 0x79, 0xa8, 0x34, 0x8d, 0xaa, 0x0d, 0x3a, 0x42, 0x2d, 0xeb, 0x12, 0x7d, 0x61, 0x2c, - 0x08, 0xb8, 0xac, 0xad, 0x1e, 0xd1, 0xf8, 0xde, 0x67, 0x82, 0x00, 0xff, 0x04, 0x17, 0x02, 0xcb, - 0xca, 0x58, 0xec, 0x95, 0x18, 0x8c, 0x6b, 0xb9, 0xc5, 0x20, 0xe3, 0x63, 0xef, 0x46, 0xed, 0xf0, - 0x15, 0x6e, 0x0e, 0x30, 0x0f, 0x95, 0xc1, 0xcd, 0x3f, 0xe8, 0xd8, 0x0a, 0x92, 0x46, 0x99, 0xca, - 0xcf, 0xdb, 0xd9, 0x99, 0xae, 0x67, 0x34, 0xa6, 0x7b, 0xcc, 0xad, 0xd2, 0xa2, 0x7f, 0xfd, 0xdb, - 0xcb, 0xe8, 0x59, 0x2f, 0xa6, 0x41, 0x2c, 0xd2, 0x31, 0x65, 0x3d, 0xe0, 0x4f, 0xf0, 0xe6, 0xce, - 0x4a, 0xdb, 0x9a, 0x5e, 0xfb, 0x0a, 0xce, 0x6b, 0xdc, 0xdb, 0x9f, 0xb6, 0xca, 0x1f, 0x82, 0x81, - 0xc4, 0x25, 0xbe, 0x57, 0xf9, 0x83, 0xa7, 0x46, 0x59, 0x1c, 0xbc, 0x83, 0x44, 0x10, 0x70, 0x76, - 0x7d, 0x35, 0xe9, 0xf9, 0xd8, 0x75, 0xbb, 0x43, 0x6d, 0x9c, 0xdb, 0x31, 0x75, 0x1b, 0x20, 0xff, - 0x08, 0x13, 0xb2, 0xcc, 0x66, 0x10, 0xed, 0xc3, 0xc0, 0xa3, 0xbd, 0x43, 0xc4, 0x1b, 0x8b, 0xe8, - 0xb0, 0xfe, 0x3d, 0x84, 0xa9, 0x1f, 0xca, 0x1d, 0xea, 0x1d, 0x6a, 0x76, 0x03, 0x49, 0x77, 0x52, - 0xec, 0xdd, 0xc9, 0x7d, 0x74, 0x27, 0xb6, 0x78, 0x9f, 0xd1, 0xb9, 0x67, 0xdd, 0xb9, 0x67, 0xb7, - 0xee, 0xdc, 0xf9, 0x80, 0xad, 0x21, 0xf6, 0xeb, 0x66, 0x8c, 0x7e, 0x1e, 0x5f, 0xc9, 0xe2, 0xed, - 0x49, 0x8e, 0xa6, 0xc0, 0x07, 0x4e, 0xb0, 0xdb, 0x72, 0x27, 0xf8, 0x6c, 0xeb, 0x2f, 0x08, 0x3a, - 0xf3, 0xbd, 0xe0, 0xd1, 0x21, 0xf4, 0x82, 0xc7, 0x2b, 0xe7, 0x03, 0xf6, 0x15, 0x26, 0xb4, 0x0a, - 0xf6, 0x1f, 0xde, 0xc5, 0x25, 0x7d, 0x3c, 0x5d, 0x18, 0x1f, 0x6c, 0x26, 0xbe, 0xee, 0xcb, 0x9f, - 0x00, 0x00, 0x00, 0xff, 0xff, 0xed, 0x84, 0x22, 0xdd, 0x01, 0x04, 0x00, 0x00, +var file_rove_rove_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_rove_rove_proto_goTypes = []interface{}{ + (*Command)(nil), // 0: rove.Command + (*CommandsRequest)(nil), // 1: rove.CommandsRequest + (*Error)(nil), // 2: rove.Error + (*RadarRequest)(nil), // 3: rove.RadarRequest + (*RadarResponse)(nil), // 4: rove.RadarResponse + (*RegisterRequest)(nil), // 5: rove.RegisterRequest + (*RoverRequest)(nil), // 6: rove.RoverRequest + (*RoverResponse)(nil), // 7: rove.RoverResponse + (*StatusResponse)(nil), // 8: rove.StatusResponse + (*Vector)(nil), // 9: rove.Vector + (*empty.Empty)(nil), // 10: google.protobuf.Empty +} +var file_rove_rove_proto_depIdxs = []int32{ + 0, // 0: rove.CommandsRequest.commands:type_name -> rove.Command + 9, // 1: rove.RoverResponse.position:type_name -> rove.Vector + 10, // 2: rove.RoveServer.Status:input_type -> google.protobuf.Empty + 5, // 3: rove.RoveServer.Register:input_type -> rove.RegisterRequest + 1, // 4: rove.RoveServer.Commands:input_type -> rove.CommandsRequest + 3, // 5: rove.RoveServer.Radar:input_type -> rove.RadarRequest + 6, // 6: rove.RoveServer.Rover:input_type -> rove.RoverRequest + 8, // 7: rove.RoveServer.Status:output_type -> rove.StatusResponse + 10, // 8: rove.RoveServer.Register:output_type -> google.protobuf.Empty + 10, // 9: rove.RoveServer.Commands:output_type -> google.protobuf.Empty + 4, // 10: rove.RoveServer.Radar:output_type -> rove.RadarResponse + 7, // 11: rove.RoveServer.Rover:output_type -> rove.RoverResponse + 7, // [7:12] is the sub-list for method output_type + 2, // [2:7] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_rove_rove_proto_init() } +func file_rove_rove_proto_init() { + if File_rove_rove_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_rove_rove_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Command); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rove_rove_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommandsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rove_rove_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Error); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rove_rove_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RadarRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rove_rove_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RadarResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rove_rove_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegisterRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rove_rove_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RoverRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rove_rove_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RoverResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rove_rove_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatusResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rove_rove_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Vector); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rove_rove_proto_rawDesc, + NumEnums: 0, + NumMessages: 10, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_rove_rove_proto_goTypes, + DependencyIndexes: file_rove_rove_proto_depIdxs, + MessageInfos: file_rove_rove_proto_msgTypes, + }.Build() + File_rove_rove_proto = out.File + file_rove_rove_proto_rawDesc = nil + file_rove_rove_proto_goTypes = nil + file_rove_rove_proto_depIdxs = nil } // Reference imports to suppress errors if they are not otherwise used. @@ -574,10 +881,18 @@ var _ grpc.ClientConnInterface // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion6 -// RoverServerClient is the client API for RoverServer service. +// RoveServerClient is the client API for RoveServer service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type RoverServerClient interface { +type RoveServerClient interface { + // Server status + // + // Responds with various details about the current server status + Status(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*StatusResponse, error) + // Register an account + // + // Tries to register an account with the given name + Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*empty.Empty, error) // Send commands to rover // // Sending commands to this endpoint will queue them to be executed during the following ticks, in the order sent @@ -586,75 +901,75 @@ type RoverServerClient interface { // // Gets the radar output for the given rover Radar(ctx context.Context, in *RadarRequest, opts ...grpc.CallOption) (*RadarResponse, error) - // Register an account - // - // Tries to register an account with the given name - Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*empty.Empty, error) // Get rover information // // Gets information for the account's rover Rover(ctx context.Context, in *RoverRequest, opts ...grpc.CallOption) (*RoverResponse, error) - // Server status - // - // Responds with various details about the current server status - Status(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*StatusResponse, error) } -type roverServerClient struct { +type roveServerClient struct { cc grpc.ClientConnInterface } -func NewRoverServerClient(cc grpc.ClientConnInterface) RoverServerClient { - return &roverServerClient{cc} +func NewRoveServerClient(cc grpc.ClientConnInterface) RoveServerClient { + return &roveServerClient{cc} } -func (c *roverServerClient) Commands(ctx context.Context, in *CommandsRequest, opts ...grpc.CallOption) (*empty.Empty, error) { - out := new(empty.Empty) - err := c.cc.Invoke(ctx, "/rove.RoverServer/Commands", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *roverServerClient) Radar(ctx context.Context, in *RadarRequest, opts ...grpc.CallOption) (*RadarResponse, error) { - out := new(RadarResponse) - err := c.cc.Invoke(ctx, "/rove.RoverServer/Radar", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *roverServerClient) Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*empty.Empty, error) { - out := new(empty.Empty) - err := c.cc.Invoke(ctx, "/rove.RoverServer/Register", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *roverServerClient) Rover(ctx context.Context, in *RoverRequest, opts ...grpc.CallOption) (*RoverResponse, error) { - out := new(RoverResponse) - err := c.cc.Invoke(ctx, "/rove.RoverServer/Rover", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *roverServerClient) Status(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*StatusResponse, error) { +func (c *roveServerClient) Status(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*StatusResponse, error) { out := new(StatusResponse) - err := c.cc.Invoke(ctx, "/rove.RoverServer/Status", in, out, opts...) + err := c.cc.Invoke(ctx, "/rove.RoveServer/Status", in, out, opts...) if err != nil { return nil, err } return out, nil } -// RoverServerServer is the server API for RoverServer service. -type RoverServerServer interface { +func (c *roveServerClient) Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) + err := c.cc.Invoke(ctx, "/rove.RoveServer/Register", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *roveServerClient) Commands(ctx context.Context, in *CommandsRequest, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) + err := c.cc.Invoke(ctx, "/rove.RoveServer/Commands", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *roveServerClient) Radar(ctx context.Context, in *RadarRequest, opts ...grpc.CallOption) (*RadarResponse, error) { + out := new(RadarResponse) + err := c.cc.Invoke(ctx, "/rove.RoveServer/Radar", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *roveServerClient) Rover(ctx context.Context, in *RoverRequest, opts ...grpc.CallOption) (*RoverResponse, error) { + out := new(RoverResponse) + err := c.cc.Invoke(ctx, "/rove.RoveServer/Rover", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// RoveServerServer is the server API for RoveServer service. +type RoveServerServer interface { + // Server status + // + // Responds with various details about the current server status + Status(context.Context, *empty.Empty) (*StatusResponse, error) + // Register an account + // + // Tries to register an account with the given name + Register(context.Context, *RegisterRequest) (*empty.Empty, error) // Send commands to rover // // Sending commands to this endpoint will queue them to be executed during the following ticks, in the order sent @@ -663,159 +978,151 @@ type RoverServerServer interface { // // Gets the radar output for the given rover Radar(context.Context, *RadarRequest) (*RadarResponse, error) - // Register an account - // - // Tries to register an account with the given name - Register(context.Context, *RegisterRequest) (*empty.Empty, error) // Get rover information // // Gets information for the account's rover Rover(context.Context, *RoverRequest) (*RoverResponse, error) - // Server status - // - // Responds with various details about the current server status - Status(context.Context, *empty.Empty) (*StatusResponse, error) } -// UnimplementedRoverServerServer can be embedded to have forward compatible implementations. -type UnimplementedRoverServerServer struct { +// UnimplementedRoveServerServer can be embedded to have forward compatible implementations. +type UnimplementedRoveServerServer struct { } -func (*UnimplementedRoverServerServer) Commands(ctx context.Context, req *CommandsRequest) (*empty.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Commands not implemented") -} -func (*UnimplementedRoverServerServer) Radar(ctx context.Context, req *RadarRequest) (*RadarResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Radar not implemented") -} -func (*UnimplementedRoverServerServer) Register(ctx context.Context, req *RegisterRequest) (*empty.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Register not implemented") -} -func (*UnimplementedRoverServerServer) Rover(ctx context.Context, req *RoverRequest) (*RoverResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Rover not implemented") -} -func (*UnimplementedRoverServerServer) Status(ctx context.Context, req *empty.Empty) (*StatusResponse, error) { +func (*UnimplementedRoveServerServer) Status(context.Context, *empty.Empty) (*StatusResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") } - -func RegisterRoverServerServer(s *grpc.Server, srv RoverServerServer) { - s.RegisterService(&_RoverServer_serviceDesc, srv) +func (*UnimplementedRoveServerServer) Register(context.Context, *RegisterRequest) (*empty.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Register not implemented") +} +func (*UnimplementedRoveServerServer) Commands(context.Context, *CommandsRequest) (*empty.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Commands not implemented") +} +func (*UnimplementedRoveServerServer) Radar(context.Context, *RadarRequest) (*RadarResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Radar not implemented") +} +func (*UnimplementedRoveServerServer) Rover(context.Context, *RoverRequest) (*RoverResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Rover not implemented") } -func _RoverServer_Commands_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CommandsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RoverServerServer).Commands(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/rove.RoverServer/Commands", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RoverServerServer).Commands(ctx, req.(*CommandsRequest)) - } - return interceptor(ctx, in, info, handler) +func RegisterRoveServerServer(s *grpc.Server, srv RoveServerServer) { + s.RegisterService(&_RoveServer_serviceDesc, srv) } -func _RoverServer_Radar_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RadarRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RoverServerServer).Radar(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/rove.RoverServer/Radar", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RoverServerServer).Radar(ctx, req.(*RadarRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RoverServer_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RegisterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RoverServerServer).Register(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/rove.RoverServer/Register", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RoverServerServer).Register(ctx, req.(*RegisterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RoverServer_Rover_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RoverRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RoverServerServer).Rover(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/rove.RoverServer/Rover", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RoverServerServer).Rover(ctx, req.(*RoverRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RoverServer_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _RoveServer_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(empty.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(RoverServerServer).Status(ctx, in) + return srv.(RoveServerServer).Status(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/rove.RoverServer/Status", + FullMethod: "/rove.RoveServer/Status", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RoverServerServer).Status(ctx, req.(*empty.Empty)) + return srv.(RoveServerServer).Status(ctx, req.(*empty.Empty)) } return interceptor(ctx, in, info, handler) } -var _RoverServer_serviceDesc = grpc.ServiceDesc{ - ServiceName: "rove.RoverServer", - HandlerType: (*RoverServerServer)(nil), +func _RoveServer_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RegisterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RoveServerServer).Register(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rove.RoveServer/Register", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoveServerServer).Register(ctx, req.(*RegisterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RoveServer_Commands_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CommandsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RoveServerServer).Commands(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rove.RoveServer/Commands", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoveServerServer).Commands(ctx, req.(*CommandsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RoveServer_Radar_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RadarRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RoveServerServer).Radar(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rove.RoveServer/Radar", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoveServerServer).Radar(ctx, req.(*RadarRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RoveServer_Rover_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RoverRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RoveServerServer).Rover(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rove.RoveServer/Rover", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoveServerServer).Rover(ctx, req.(*RoverRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _RoveServer_serviceDesc = grpc.ServiceDesc{ + ServiceName: "rove.RoveServer", + HandlerType: (*RoveServerServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "Commands", - Handler: _RoverServer_Commands_Handler, - }, - { - MethodName: "Radar", - Handler: _RoverServer_Radar_Handler, + MethodName: "Status", + Handler: _RoveServer_Status_Handler, }, { MethodName: "Register", - Handler: _RoverServer_Register_Handler, + Handler: _RoveServer_Register_Handler, + }, + { + MethodName: "Commands", + Handler: _RoveServer_Commands_Handler, + }, + { + MethodName: "Radar", + Handler: _RoveServer_Radar_Handler, }, { MethodName: "Rover", - Handler: _RoverServer_Rover_Handler, - }, - { - MethodName: "Status", - Handler: _RoverServer_Status_Handler, + Handler: _RoveServer_Rover_Handler, }, }, Streams: []grpc.StreamDesc{}, - Metadata: "rove.proto", + Metadata: "rove/rove.proto", } diff --git a/pkg/rove/rove.pb.gw.go b/pkg/rove/rove.pb.gw.go new file mode 100644 index 0000000..f67af75 --- /dev/null +++ b/pkg/rove/rove.pb.gw.go @@ -0,0 +1,464 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: rove/rove.proto + +/* +Package rove is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package rove + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/golang/protobuf/ptypes/empty" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage + +func request_RoveServer_Status_0(ctx context.Context, marshaler runtime.Marshaler, client RoveServerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq empty.Empty + var metadata runtime.ServerMetadata + + msg, err := client.Status(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_RoveServer_Status_0(ctx context.Context, marshaler runtime.Marshaler, server RoveServerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq empty.Empty + var metadata runtime.ServerMetadata + + msg, err := server.Status(ctx, &protoReq) + return msg, metadata, err + +} + +func request_RoveServer_Register_0(ctx context.Context, marshaler runtime.Marshaler, client RoveServerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RegisterRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Register(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_RoveServer_Register_0(ctx context.Context, marshaler runtime.Marshaler, server RoveServerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RegisterRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Register(ctx, &protoReq) + return msg, metadata, err + +} + +func request_RoveServer_Commands_0(ctx context.Context, marshaler runtime.Marshaler, client RoveServerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CommandsRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Commands(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_RoveServer_Commands_0(ctx context.Context, marshaler runtime.Marshaler, server RoveServerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CommandsRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Commands(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_RoveServer_Radar_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_RoveServer_Radar_0(ctx context.Context, marshaler runtime.Marshaler, client RoveServerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RadarRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RoveServer_Radar_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Radar(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_RoveServer_Radar_0(ctx context.Context, marshaler runtime.Marshaler, server RoveServerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RadarRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RoveServer_Radar_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Radar(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_RoveServer_Rover_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_RoveServer_Rover_0(ctx context.Context, marshaler runtime.Marshaler, client RoveServerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RoverRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RoveServer_Rover_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Rover(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_RoveServer_Rover_0(ctx context.Context, marshaler runtime.Marshaler, server RoveServerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RoverRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RoveServer_Rover_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Rover(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterRoveServerHandlerServer registers the http handlers for service RoveServer to "mux". +// UnaryRPC :call RoveServerServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +func RegisterRoveServerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RoveServerServer) error { + + mux.Handle("GET", pattern_RoveServer_Status_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_RoveServer_Status_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RoveServer_Status_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_RoveServer_Register_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_RoveServer_Register_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RoveServer_Register_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_RoveServer_Commands_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_RoveServer_Commands_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RoveServer_Commands_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_RoveServer_Radar_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_RoveServer_Radar_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RoveServer_Radar_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_RoveServer_Rover_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_RoveServer_Rover_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RoveServer_Rover_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterRoveServerHandlerFromEndpoint is same as RegisterRoveServerHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterRoveServerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterRoveServerHandler(ctx, mux, conn) +} + +// RegisterRoveServerHandler registers the http handlers for service RoveServer to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterRoveServerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterRoveServerHandlerClient(ctx, mux, NewRoveServerClient(conn)) +} + +// RegisterRoveServerHandlerClient registers the http handlers for service RoveServer +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "RoveServerClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "RoveServerClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "RoveServerClient" to call the correct interceptors. +func RegisterRoveServerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RoveServerClient) error { + + mux.Handle("GET", pattern_RoveServer_Status_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_RoveServer_Status_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RoveServer_Status_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_RoveServer_Register_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_RoveServer_Register_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RoveServer_Register_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_RoveServer_Commands_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_RoveServer_Commands_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RoveServer_Commands_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_RoveServer_Radar_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_RoveServer_Radar_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RoveServer_Radar_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_RoveServer_Rover_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_RoveServer_Rover_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RoveServer_Rover_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_RoveServer_Status_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"status"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_RoveServer_Register_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"register"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_RoveServer_Commands_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"commands"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_RoveServer_Radar_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"radar"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_RoveServer_Rover_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"rover"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_RoveServer_Status_0 = runtime.ForwardResponseMessage + + forward_RoveServer_Register_0 = runtime.ForwardResponseMessage + + forward_RoveServer_Commands_0 = runtime.ForwardResponseMessage + + forward_RoveServer_Radar_0 = runtime.ForwardResponseMessage + + forward_RoveServer_Rover_0 = runtime.ForwardResponseMessage +) diff --git a/pkg/accounts/accounts.proto b/proto/accounts/accounts.proto similarity index 100% rename from pkg/accounts/accounts.proto rename to proto/accounts/accounts.proto diff --git a/proto/google/README.grpc-gateway b/proto/google/README.grpc-gateway new file mode 100644 index 0000000..b7d1bea --- /dev/null +++ b/proto/google/README.grpc-gateway @@ -0,0 +1,23 @@ +Google APIs +============ + +Project: Google APIs +URL: https://github.com/google/googleapis +Revision: 3544ab16c3342d790b00764251e348705991ea4b +License: Apache License 2.0 + + +Imported Files +--------------- + +- google/api/annotations.proto +- google/api/http.proto +- google/api/httpbody.proto + + +Generated Files +---------------- + +They are generated from the .proto files by protoc-gen-go. +- google/api/annotations.pb.go +- google/api/http.pb.go diff --git a/proto/google/api/annotations.proto b/proto/google/api/annotations.proto new file mode 100644 index 0000000..85c361b --- /dev/null +++ b/proto/google/api/annotations.proto @@ -0,0 +1,31 @@ +// Copyright (c) 2015, Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +import "google/api/http.proto"; +import "google/protobuf/descriptor.proto"; + +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "AnnotationsProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +extend google.protobuf.MethodOptions { + // See `HttpRule`. + HttpRule http = 72295728; +} diff --git a/proto/google/api/http.proto b/proto/google/api/http.proto new file mode 100644 index 0000000..2bd3a19 --- /dev/null +++ b/proto/google/api/http.proto @@ -0,0 +1,318 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "HttpProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + + +// Defines the HTTP configuration for an API service. It contains a list of +// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method +// to one or more HTTP REST API methods. +message Http { + // A list of HTTP configuration rules that apply to individual API methods. + // + // **NOTE:** All service configuration rules follow "last one wins" order. + repeated HttpRule rules = 1; + + // When set to true, URL path parmeters will be fully URI-decoded except in + // cases of single segment matches in reserved expansion, where "%2F" will be + // left encoded. + // + // The default behavior is to not decode RFC 6570 reserved characters in multi + // segment matches. + bool fully_decode_reserved_expansion = 2; +} + +// `HttpRule` defines the mapping of an RPC method to one or more HTTP +// REST API methods. The mapping specifies how different portions of the RPC +// request message are mapped to URL path, URL query parameters, and +// HTTP request body. The mapping is typically specified as an +// `google.api.http` annotation on the RPC method, +// see "google/api/annotations.proto" for details. +// +// The mapping consists of a field specifying the path template and +// method kind. The path template can refer to fields in the request +// message, as in the example below which describes a REST GET +// operation on a resource collection of messages: +// +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}"; +// } +// } +// message GetMessageRequest { +// message SubMessage { +// string subfield = 1; +// } +// string message_id = 1; // mapped to the URL +// SubMessage sub = 2; // `sub.subfield` is url-mapped +// } +// message Message { +// string text = 1; // content of the resource +// } +// +// The same http annotation can alternatively be expressed inside the +// `GRPC API Configuration` YAML file. +// +// http: +// rules: +// - selector: .Messaging.GetMessage +// get: /v1/messages/{message_id}/{sub.subfield} +// +// This definition enables an automatic, bidrectional mapping of HTTP +// JSON to RPC. Example: +// +// HTTP | RPC +// -----|----- +// `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub: SubMessage(subfield: "foo"))` +// +// In general, not only fields but also field paths can be referenced +// from a path pattern. Fields mapped to the path pattern cannot be +// repeated and must have a primitive (non-message) type. +// +// Any fields in the request message which are not bound by the path +// pattern automatically become (optional) HTTP query +// parameters. Assume the following definition of the request message: +// +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http).get = "/v1/messages/{message_id}"; +// } +// } +// message GetMessageRequest { +// message SubMessage { +// string subfield = 1; +// } +// string message_id = 1; // mapped to the URL +// int64 revision = 2; // becomes a parameter +// SubMessage sub = 3; // `sub.subfield` becomes a parameter +// } +// +// +// This enables a HTTP JSON to RPC mapping as below: +// +// HTTP | RPC +// -----|----- +// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: "foo"))` +// +// Note that fields which are mapped to HTTP parameters must have a +// primitive type or a repeated primitive type. Message types are not +// allowed. In the case of a repeated type, the parameter can be +// repeated in the URL, as in `...?param=A¶m=B`. +// +// For HTTP method kinds which allow a request body, the `body` field +// specifies the mapping. Consider a REST update method on the +// message resource collection: +// +// +// service Messaging { +// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { +// option (google.api.http) = { +// put: "/v1/messages/{message_id}" +// body: "message" +// }; +// } +// } +// message UpdateMessageRequest { +// string message_id = 1; // mapped to the URL +// Message message = 2; // mapped to the body +// } +// +// +// The following HTTP JSON to RPC mapping is enabled, where the +// representation of the JSON in the request body is determined by +// protos JSON encoding: +// +// HTTP | RPC +// -----|----- +// `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" message { text: "Hi!" })` +// +// The special name `*` can be used in the body mapping to define that +// every field not bound by the path template should be mapped to the +// request body. This enables the following alternative definition of +// the update method: +// +// service Messaging { +// rpc UpdateMessage(Message) returns (Message) { +// option (google.api.http) = { +// put: "/v1/messages/{message_id}" +// body: "*" +// }; +// } +// } +// message Message { +// string message_id = 1; +// string text = 2; +// } +// +// +// The following HTTP JSON to RPC mapping is enabled: +// +// HTTP | RPC +// -----|----- +// `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" text: "Hi!")` +// +// Note that when using `*` in the body mapping, it is not possible to +// have HTTP parameters, as all fields not bound by the path end in +// the body. This makes this option more rarely used in practice of +// defining REST APIs. The common usage of `*` is in custom methods +// which don't use the URL at all for transferring data. +// +// It is possible to define multiple HTTP methods for one RPC by using +// the `additional_bindings` option. Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/messages/{message_id}" +// additional_bindings { +// get: "/v1/users/{user_id}/messages/{message_id}" +// } +// }; +// } +// } +// message GetMessageRequest { +// string message_id = 1; +// string user_id = 2; +// } +// +// +// This enables the following two alternative HTTP JSON to RPC +// mappings: +// +// HTTP | RPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` +// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: "123456")` +// +// # Rules for HTTP mapping +// +// The rules for mapping HTTP path, query parameters, and body fields +// to the request message are as follows: +// +// 1. The `body` field specifies either `*` or a field path, or is +// omitted. If omitted, it indicates there is no HTTP request body. +// 2. Leaf fields (recursive expansion of nested messages in the +// request) can be classified into three types: +// (a) Matched in the URL template. +// (b) Covered by body (if body is `*`, everything except (a) fields; +// else everything under the body field) +// (c) All other fields. +// 3. URL query parameters found in the HTTP request are mapped to (c) fields. +// 4. Any body sent with an HTTP request can contain only (b) fields. +// +// The syntax of the path template is as follows: +// +// Template = "/" Segments [ Verb ] ; +// Segments = Segment { "/" Segment } ; +// Segment = "*" | "**" | LITERAL | Variable ; +// Variable = "{" FieldPath [ "=" Segments ] "}" ; +// FieldPath = IDENT { "." IDENT } ; +// Verb = ":" LITERAL ; +// +// The syntax `*` matches a single path segment. The syntax `**` matches zero +// or more path segments, which must be the last part of the path except the +// `Verb`. The syntax `LITERAL` matches literal text in the path. +// +// The syntax `Variable` matches part of the URL path as specified by its +// template. A variable template must not contain other variables. If a variable +// matches a single path segment, its template may be omitted, e.g. `{var}` +// is equivalent to `{var=*}`. +// +// If a variable contains exactly one path segment, such as `"{var}"` or +// `"{var=*}"`, when such a variable is expanded into a URL path, all characters +// except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the +// Discovery Document as `{var}`. +// +// If a variable contains one or more path segments, such as `"{var=foo/*}"` +// or `"{var=**}"`, when such a variable is expanded into a URL path, all +// characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables +// show up in the Discovery Document as `{+var}`. +// +// NOTE: While the single segment variable matches the semantics of +// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 +// Simple String Expansion, the multi segment variable **does not** match +// RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion +// does not expand special characters like `?` and `#`, which would lead +// to invalid URLs. +// +// NOTE: the field paths in variables and in the `body` must not refer to +// repeated fields or map fields. +message HttpRule { + // Selects methods to which this rule applies. + // + // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + string selector = 1; + + // Determines the URL pattern is matched by this rules. This pattern can be + // used with any of the {get|put|post|delete|patch} methods. A custom method + // can be defined using the 'custom' field. + oneof pattern { + // Used for listing and getting information about resources. + string get = 2; + + // Used for updating a resource. + string put = 3; + + // Used for creating a resource. + string post = 4; + + // Used for deleting a resource. + string delete = 5; + + // Used for updating a resource. + string patch = 6; + + // The custom pattern is used for specifying an HTTP method that is not + // included in the `pattern` field, such as HEAD, or "*" to leave the + // HTTP method unspecified for this rule. The wild-card rule is useful + // for services that provide content to Web (HTML) clients. + CustomHttpPattern custom = 8; + } + + // The name of the request field whose value is mapped to the HTTP body, or + // `*` for mapping all fields not captured by the path pattern to the HTTP + // body. NOTE: the referred field must not be a repeated field and must be + // present at the top-level of request message type. + string body = 7; + + // Optional. The name of the response field whose value is mapped to the HTTP + // body of response. Other response fields are ignored. When + // not set, the response message will be used as HTTP body of response. + string response_body = 12; + + // Additional HTTP bindings for the selector. Nested bindings must + // not contain an `additional_bindings` field themselves (that is, + // the nesting may only be one level deep). + repeated HttpRule additional_bindings = 11; +} + +// A custom pattern is used for defining custom HTTP verb. +message CustomHttpPattern { + // The name of this custom HTTP verb. + string kind = 1; + + // The path matched by this custom verb. + string path = 2; +} diff --git a/proto/google/api/httpbody.proto b/proto/google/api/httpbody.proto new file mode 100644 index 0000000..4428515 --- /dev/null +++ b/proto/google/api/httpbody.proto @@ -0,0 +1,78 @@ +// Copyright 2018 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.api; + +import "google/protobuf/any.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/api/httpbody;httpbody"; +option java_multiple_files = true; +option java_outer_classname = "HttpBodyProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +// Message that represents an arbitrary HTTP body. It should only be used for +// payload formats that can't be represented as JSON, such as raw binary or +// an HTML page. +// +// +// This message can be used both in streaming and non-streaming API methods in +// the request as well as the response. +// +// It can be used as a top-level request field, which is convenient if one +// wants to extract parameters from either the URL or HTTP template into the +// request fields and also want access to the raw HTTP body. +// +// Example: +// +// message GetResourceRequest { +// // A unique request id. +// string request_id = 1; +// +// // The raw HTTP body is bound to this field. +// google.api.HttpBody http_body = 2; +// } +// +// service ResourceService { +// rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); +// rpc UpdateResource(google.api.HttpBody) returns +// (google.protobuf.Empty); +// } +// +// Example with streaming methods: +// +// service CaldavService { +// rpc GetCalendar(stream google.api.HttpBody) +// returns (stream google.api.HttpBody); +// rpc UpdateCalendar(stream google.api.HttpBody) +// returns (stream google.api.HttpBody); +// } +// +// Use of this type only changes how the request and response bodies are +// handled, all other features will continue to work unchanged. +message HttpBody { + // The HTTP Content-Type header value specifying the content type of the body. + string content_type = 1; + + // The HTTP request/response body as raw binary. + bytes data = 2; + + // Application specific response metadata. Must be set in the first response + // for streaming APIs. + repeated google.protobuf.Any extensions = 3; +} \ No newline at end of file diff --git a/proto/google/rpc/code.proto b/proto/google/rpc/code.proto new file mode 100644 index 0000000..8fef411 --- /dev/null +++ b/proto/google/rpc/code.proto @@ -0,0 +1,186 @@ +// Copyright 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.rpc; + +option go_package = "google.golang.org/genproto/googleapis/rpc/code;code"; +option java_multiple_files = true; +option java_outer_classname = "CodeProto"; +option java_package = "com.google.rpc"; +option objc_class_prefix = "RPC"; + + +// The canonical error codes for Google APIs. +// +// +// Sometimes multiple error codes may apply. Services should return +// the most specific error code that applies. For example, prefer +// `OUT_OF_RANGE` over `FAILED_PRECONDITION` if both codes apply. +// Similarly prefer `NOT_FOUND` or `ALREADY_EXISTS` over `FAILED_PRECONDITION`. +enum Code { + // Not an error; returned on success + // + // HTTP Mapping: 200 OK + OK = 0; + + // The operation was cancelled, typically by the caller. + // + // HTTP Mapping: 499 Client Closed Request + CANCELLED = 1; + + // Unknown error. For example, this error may be returned when + // a `Status` value received from another address space belongs to + // an error space that is not known in this address space. Also + // errors raised by APIs that do not return enough error information + // may be converted to this error. + // + // HTTP Mapping: 500 Internal Server Error + UNKNOWN = 2; + + // The client specified an invalid argument. Note that this differs + // from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments + // that are problematic regardless of the state of the system + // (e.g., a malformed file name). + // + // HTTP Mapping: 400 Bad Request + INVALID_ARGUMENT = 3; + + // The deadline expired before the operation could complete. For operations + // that change the state of the system, this error may be returned + // even if the operation has completed successfully. For example, a + // successful response from a server could have been delayed long + // enough for the deadline to expire. + // + // HTTP Mapping: 504 Gateway Timeout + DEADLINE_EXCEEDED = 4; + + // Some requested entity (e.g., file or directory) was not found. + // + // Note to server developers: if a request is denied for an entire class + // of users, such as gradual feature rollout or undocumented whitelist, + // `NOT_FOUND` may be used. If a request is denied for some users within + // a class of users, such as user-based access control, `PERMISSION_DENIED` + // must be used. + // + // HTTP Mapping: 404 Not Found + NOT_FOUND = 5; + + // The entity that a client attempted to create (e.g., file or directory) + // already exists. + // + // HTTP Mapping: 409 Conflict + ALREADY_EXISTS = 6; + + // The caller does not have permission to execute the specified + // operation. `PERMISSION_DENIED` must not be used for rejections + // caused by exhausting some resource (use `RESOURCE_EXHAUSTED` + // instead for those errors). `PERMISSION_DENIED` must not be + // used if the caller can not be identified (use `UNAUTHENTICATED` + // instead for those errors). This error code does not imply the + // request is valid or the requested entity exists or satisfies + // other pre-conditions. + // + // HTTP Mapping: 403 Forbidden + PERMISSION_DENIED = 7; + + // The request does not have valid authentication credentials for the + // operation. + // + // HTTP Mapping: 401 Unauthorized + UNAUTHENTICATED = 16; + + // Some resource has been exhausted, perhaps a per-user quota, or + // perhaps the entire file system is out of space. + // + // HTTP Mapping: 429 Too Many Requests + RESOURCE_EXHAUSTED = 8; + + // The operation was rejected because the system is not in a state + // required for the operation's execution. For example, the directory + // to be deleted is non-empty, an rmdir operation is applied to + // a non-directory, etc. + // + // Service implementors can use the following guidelines to decide + // between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`: + // (a) Use `UNAVAILABLE` if the client can retry just the failing call. + // (b) Use `ABORTED` if the client should retry at a higher level + // (e.g., when a client-specified test-and-set fails, indicating the + // client should restart a read-modify-write sequence). + // (c) Use `FAILED_PRECONDITION` if the client should not retry until + // the system state has been explicitly fixed. E.g., if an "rmdir" + // fails because the directory is non-empty, `FAILED_PRECONDITION` + // should be returned since the client should not retry unless + // the files are deleted from the directory. + // + // HTTP Mapping: 400 Bad Request + FAILED_PRECONDITION = 9; + + // The operation was aborted, typically due to a concurrency issue such as + // a sequencer check failure or transaction abort. + // + // See the guidelines above for deciding between `FAILED_PRECONDITION`, + // `ABORTED`, and `UNAVAILABLE`. + // + // HTTP Mapping: 409 Conflict + ABORTED = 10; + + // The operation was attempted past the valid range. E.g., seeking or + // reading past end-of-file. + // + // Unlike `INVALID_ARGUMENT`, this error indicates a problem that may + // be fixed if the system state changes. For example, a 32-bit file + // system will generate `INVALID_ARGUMENT` if asked to read at an + // offset that is not in the range [0,2^32-1], but it will generate + // `OUT_OF_RANGE` if asked to read from an offset past the current + // file size. + // + // There is a fair bit of overlap between `FAILED_PRECONDITION` and + // `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific + // error) when it applies so that callers who are iterating through + // a space can easily look for an `OUT_OF_RANGE` error to detect when + // they are done. + // + // HTTP Mapping: 400 Bad Request + OUT_OF_RANGE = 11; + + // The operation is not implemented or is not supported/enabled in this + // service. + // + // HTTP Mapping: 501 Not Implemented + UNIMPLEMENTED = 12; + + // Internal errors. This means that some invariants expected by the + // underlying system have been broken. This error code is reserved + // for serious errors. + // + // HTTP Mapping: 500 Internal Server Error + INTERNAL = 13; + + // The service is currently unavailable. This is most likely a + // transient condition, which can be corrected by retrying with + // a backoff. + // + // See the guidelines above for deciding between `FAILED_PRECONDITION`, + // `ABORTED`, and `UNAVAILABLE`. + // + // HTTP Mapping: 503 Service Unavailable + UNAVAILABLE = 14; + + // Unrecoverable data loss or corruption. + // + // HTTP Mapping: 500 Internal Server Error + DATA_LOSS = 15; +} diff --git a/proto/google/rpc/error_details.proto b/proto/google/rpc/error_details.proto new file mode 100644 index 0000000..f24ae00 --- /dev/null +++ b/proto/google/rpc/error_details.proto @@ -0,0 +1,200 @@ +// Copyright 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.rpc; + +import "google/protobuf/duration.proto"; + +option go_package = "google.golang.org/genproto/googleapis/rpc/errdetails;errdetails"; +option java_multiple_files = true; +option java_outer_classname = "ErrorDetailsProto"; +option java_package = "com.google.rpc"; +option objc_class_prefix = "RPC"; + + +// Describes when the clients can retry a failed request. Clients could ignore +// the recommendation here or retry when this information is missing from error +// responses. +// +// It's always recommended that clients should use exponential backoff when +// retrying. +// +// Clients should wait until `retry_delay` amount of time has passed since +// receiving the error response before retrying. If retrying requests also +// fail, clients should use an exponential backoff scheme to gradually increase +// the delay between retries based on `retry_delay`, until either a maximum +// number of retires have been reached or a maximum retry delay cap has been +// reached. +message RetryInfo { + // Clients should wait at least this long between retrying the same request. + google.protobuf.Duration retry_delay = 1; +} + +// Describes additional debugging info. +message DebugInfo { + // The stack trace entries indicating where the error occurred. + repeated string stack_entries = 1; + + // Additional debugging information provided by the server. + string detail = 2; +} + +// Describes how a quota check failed. +// +// For example if a daily limit was exceeded for the calling project, +// a service could respond with a QuotaFailure detail containing the project +// id and the description of the quota limit that was exceeded. If the +// calling project hasn't enabled the service in the developer console, then +// a service could respond with the project id and set `service_disabled` +// to true. +// +// Also see RetryDetail and Help types for other details about handling a +// quota failure. +message QuotaFailure { + // A message type used to describe a single quota violation. For example, a + // daily quota or a custom quota that was exceeded. + message Violation { + // The subject on which the quota check failed. + // For example, "clientip:" or "project:". + string subject = 1; + + // A description of how the quota check failed. Clients can use this + // description to find more about the quota configuration in the service's + // public documentation, or find the relevant quota limit to adjust through + // developer console. + // + // For example: "Service disabled" or "Daily Limit for read operations + // exceeded". + string description = 2; + } + + // Describes all quota violations. + repeated Violation violations = 1; +} + +// Describes what preconditions have failed. +// +// For example, if an RPC failed because it required the Terms of Service to be +// acknowledged, it could list the terms of service violation in the +// PreconditionFailure message. +message PreconditionFailure { + // A message type used to describe a single precondition failure. + message Violation { + // The type of PreconditionFailure. We recommend using a service-specific + // enum type to define the supported precondition violation types. For + // example, "TOS" for "Terms of Service violation". + string type = 1; + + // The subject, relative to the type, that failed. + // For example, "google.com/cloud" relative to the "TOS" type would + // indicate which terms of service is being referenced. + string subject = 2; + + // A description of how the precondition failed. Developers can use this + // description to understand how to fix the failure. + // + // For example: "Terms of service not accepted". + string description = 3; + } + + // Describes all precondition violations. + repeated Violation violations = 1; +} + +// Describes violations in a client request. This error type focuses on the +// syntactic aspects of the request. +message BadRequest { + // A message type used to describe a single bad request field. + message FieldViolation { + // A path leading to a field in the request body. The value will be a + // sequence of dot-separated identifiers that identify a protocol buffer + // field. E.g., "field_violations.field" would identify this field. + string field = 1; + + // A description of why the request element is bad. + string description = 2; + } + + // Describes all violations in a client request. + repeated FieldViolation field_violations = 1; +} + +// Contains metadata about the request that clients can attach when filing a bug +// or providing other forms of feedback. +message RequestInfo { + // An opaque string that should only be interpreted by the service generating + // it. For example, it can be used to identify requests in the service's logs. + string request_id = 1; + + // Any data that was used to serve this request. For example, an encrypted + // stack trace that can be sent back to the service provider for debugging. + string serving_data = 2; +} + +// Describes the resource that is being accessed. +message ResourceInfo { + // A name for the type of resource being accessed, e.g. "sql table", + // "cloud storage bucket", "file", "Google calendar"; or the type URL + // of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic". + string resource_type = 1; + + // The name of the resource being accessed. For example, a shared calendar + // name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current + // error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED]. + string resource_name = 2; + + // The owner of the resource (optional). + // For example, "user:" or "project:". + string owner = 3; + + // Describes what error is encountered when accessing this resource. + // For example, updating a cloud project may require the `writer` permission + // on the developer console project. + string description = 4; +} + +// Provides links to documentation or for performing an out of band action. +// +// For example, if a quota check failed with an error indicating the calling +// project hasn't enabled the accessed service, this can contain a URL pointing +// directly to the right place in the developer console to flip the bit. +message Help { + // Describes a URL link. + message Link { + // Describes what the link offers. + string description = 1; + + // The URL of the link. + string url = 2; + } + + // URL(s) pointing to additional information on handling the current error. + repeated Link links = 1; +} + +// Provides a localized error message that is safe to return to the user +// which can be attached to an RPC error. +message LocalizedMessage { + // The locale used following the specification defined at + // http://www.rfc-editor.org/rfc/bcp/bcp47.txt. + // Examples are: "en-US", "fr-CH", "es-MX" + string locale = 1; + + // The localized error message in the above locale. + string message = 2; +} diff --git a/proto/google/rpc/status.proto b/proto/google/rpc/status.proto new file mode 100644 index 0000000..0839ee9 --- /dev/null +++ b/proto/google/rpc/status.proto @@ -0,0 +1,92 @@ +// Copyright 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.rpc; + +import "google/protobuf/any.proto"; + +option go_package = "google.golang.org/genproto/googleapis/rpc/status;status"; +option java_multiple_files = true; +option java_outer_classname = "StatusProto"; +option java_package = "com.google.rpc"; +option objc_class_prefix = "RPC"; + + +// The `Status` type defines a logical error model that is suitable for different +// programming environments, including REST APIs and RPC APIs. It is used by +// [gRPC](https://github.com/grpc). The error model is designed to be: +// +// - Simple to use and understand for most users +// - Flexible enough to meet unexpected needs +// +// # Overview +// +// The `Status` message contains three pieces of data: error code, error message, +// and error details. The error code should be an enum value of +// [google.rpc.Code][google.rpc.Code], but it may accept additional error codes if needed. The +// error message should be a developer-facing English message that helps +// developers *understand* and *resolve* the error. If a localized user-facing +// error message is needed, put the localized message in the error details or +// localize it in the client. The optional error details may contain arbitrary +// information about the error. There is a predefined set of error detail types +// in the package `google.rpc` that can be used for common error conditions. +// +// # Language mapping +// +// The `Status` message is the logical representation of the error model, but it +// is not necessarily the actual wire format. When the `Status` message is +// exposed in different client libraries and different wire protocols, it can be +// mapped differently. For example, it will likely be mapped to some exceptions +// in Java, but more likely mapped to some error codes in C. +// +// # Other uses +// +// The error model and the `Status` message can be used in a variety of +// environments, either with or without APIs, to provide a +// consistent developer experience across different environments. +// +// Example uses of this error model include: +// +// - Partial errors. If a service needs to return partial errors to the client, +// it may embed the `Status` in the normal response to indicate the partial +// errors. +// +// - Workflow errors. A typical workflow has multiple steps. Each step may +// have a `Status` message for error reporting. +// +// - Batch operations. If a client uses batch request and batch response, the +// `Status` message should be used directly inside batch response, one for +// each error sub-response. +// +// - Asynchronous operations. If an API call embeds asynchronous operation +// results in its response, the status of those operations should be +// represented directly using the `Status` message. +// +// - Logging. If some API errors are stored in logs, the message `Status` could +// be used directly after any stripping needed for security/privacy reasons. +message Status { + // The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + int32 code = 1; + + // A developer-facing error message, which should be in English. Any + // user-facing error message should be localized and sent in the + // [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + string message = 2; + + // A list of messages that carry the error details. There is a common set of + // message types for APIs to use. + repeated google.protobuf.Any details = 3; +} diff --git a/pkg/rove/rove.proto b/proto/rove/rove.proto similarity index 76% rename from pkg/rove/rove.proto rename to proto/rove/rove.proto index a4ce6b7..9546d52 100644 --- a/pkg/rove/rove.proto +++ b/proto/rove/rove.proto @@ -2,33 +2,58 @@ syntax = "proto3"; package rove; +option go_package = "github.com/mdiluz/rove/pkg/rove"; + import "google/protobuf/empty.proto"; +import "google/api/annotations.proto"; -service RoverServer { - // Send commands to rover +service RoveServer { + // Server status // - // Sending commands to this endpoint will queue them to be executed during the following ticks, in the order sent - rpc Commands(CommandsRequest) returns (google.protobuf.Empty) {} - - // Get radar information - // - // Gets the radar output for the given rover - rpc Radar(RadarRequest) returns (RadarResponse) {} + // Responds with various details about the current server status + rpc Status(google.protobuf.Empty) returns (StatusResponse) { + option (google.api.http) = { + get: "/status" + }; + } // Register an account // // Tries to register an account with the given name - rpc Register(RegisterRequest) returns (google.protobuf.Empty) {} + rpc Register(RegisterRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/register" + body: "*" + }; + } + + // Send commands to rover + // + // Sending commands to this endpoint will queue them to be executed during the following ticks, in the order sent + rpc Commands(CommandsRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/commands" + body: "*" + }; + } + + // Get radar information + // + // Gets the radar output for the given rover + rpc Radar(RadarRequest) returns (RadarResponse) { + option (google.api.http) = { + get: "/radar" + }; + } // Get rover information // // Gets information for the account's rover - rpc Rover(RoverRequest) returns (RoverResponse) {} - - // Server status - // - // Responds with various details about the current server status - rpc Status(google.protobuf.Empty) returns (StatusResponse) {} + rpc Rover(RoverRequest) returns (RoverResponse) { + option (google.api.http) = { + get: "/rover" + }; + } } message Command { diff --git a/proto/rove/rove.swagger.json b/proto/rove/rove.swagger.json new file mode 100644 index 0000000..290f037 --- /dev/null +++ b/proto/rove/rove.swagger.json @@ -0,0 +1,318 @@ +{ + "swagger": "2.0", + "info": { + "title": "rove/rove.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/commands": { + "post": { + "summary": "Send commands to rover", + "description": "Sending commands to this endpoint will queue them to be executed during the following ticks, in the order sent", + "operationId": "RoveServer_Commands", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "properties": {} + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/gatewayruntimeError" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/roveCommandsRequest" + } + } + ], + "tags": [ + "RoveServer" + ] + } + }, + "/radar": { + "get": { + "summary": "Get radar information", + "description": "Gets the radar output for the given rover", + "operationId": "RoveServer_Radar", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/roveRadarResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/gatewayruntimeError" + } + } + }, + "parameters": [ + { + "name": "account", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "RoveServer" + ] + } + }, + "/register": { + "post": { + "summary": "Register an account", + "description": "Tries to register an account with the given name", + "operationId": "RoveServer_Register", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "properties": {} + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/gatewayruntimeError" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/roveRegisterRequest" + } + } + ], + "tags": [ + "RoveServer" + ] + } + }, + "/rover": { + "get": { + "summary": "Get rover information", + "description": "Gets information for the account's rover", + "operationId": "RoveServer_Rover", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/roveRoverResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/gatewayruntimeError" + } + } + }, + "parameters": [ + { + "name": "account", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "RoveServer" + ] + } + }, + "/status": { + "get": { + "summary": "Server status", + "description": "Responds with various details about the current server status", + "operationId": "RoveServer_Status", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/roveStatusResponse" + } + }, + "default": { + "description": "An unexpected error response", + "schema": { + "$ref": "#/definitions/gatewayruntimeError" + } + } + }, + "tags": [ + "RoveServer" + ] + } + } + }, + "definitions": { + "gatewayruntimeError": { + "type": "object", + "properties": { + "error": { + "type": "string" + }, + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "type_url": { + "type": "string" + }, + "value": { + "type": "string", + "format": "byte" + } + } + }, + "roveCommand": { + "type": "object", + "properties": { + "command": { + "type": "string", + "description": "The command to execute, currently only accepts move, which requires a bearing and a duration." + }, + "bearing": { + "type": "string" + }, + "duration": { + "type": "integer", + "format": "int32" + } + } + }, + "roveCommandsRequest": { + "type": "object", + "properties": { + "account": { + "type": "string" + }, + "commands": { + "type": "array", + "items": { + "$ref": "#/definitions/roveCommand" + } + } + } + }, + "roveRadarResponse": { + "type": "object", + "properties": { + "range": { + "type": "integer", + "format": "int32", + "title": "The range in tiles from the rover of the radar data" + }, + "tiles": { + "type": "string", + "format": "byte", + "title": "A 1D array representing range*2 + 1 squared set of tiles, origin bottom left and in row-\u003ecolumn order" + } + } + }, + "roveRegisterRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + }, + "roveRoverResponse": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "The name of the rover" + }, + "position": { + "$ref": "#/definitions/roveVector", + "title": "Position of the rover in world coordinates" + }, + "range": { + "type": "integer", + "format": "int32", + "title": "The range of this rover's radar" + }, + "speed": { + "type": "integer", + "format": "int32", + "title": "The speed the rover can move per tick" + } + } + }, + "roveStatusResponse": { + "type": "object", + "properties": { + "next_tick": { + "type": "string", + "title": "The time the next tick will occur" + }, + "ready": { + "type": "boolean", + "format": "boolean", + "title": "Whether the server is ready to accept requests" + }, + "tick": { + "type": "integer", + "format": "int32", + "title": "The tick rate of the server in minutes (how many minutes per tick)" + }, + "version": { + "type": "string", + "title": "The version of the server in v{major}.{minor}-{delta}-{sha} form" + } + } + }, + "roveVector": { + "type": "object", + "properties": { + "x": { + "type": "integer", + "format": "int32" + }, + "y": { + "type": "integer", + "format": "int32" + } + } + } + } +} diff --git a/tools/tools.go b/tools/tools.go new file mode 100644 index 0000000..2052d72 --- /dev/null +++ b/tools/tools.go @@ -0,0 +1,9 @@ +// +build tools + +package tools + +import ( + _ "github.com/golang/protobuf/protoc-gen-go" + _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway" + _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger" +)