diff --git a/.gitignore b/.gitignore
index 723ef36..ae257e8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,5 @@
-.idea
\ No newline at end of file
+.idea
+
+idl/google
+idl/grafeas
+idl/validate
diff --git a/Makefile b/Makefile
index d5762e3..b4b8104 100644
--- a/Makefile
+++ b/Makefile
@@ -5,10 +5,11 @@ all:
.PHONY: gen-proto
gen-proto:
+ rm -rf internal/idl
buf breaking idl --against '.git#branch=main,subdir=idl'
+ buf mod update idl
buf lint idl
buf format idl -w
- buf mod update idl
buf generate idl
.PHONY: gen-models
diff --git a/cmd/dispatch/ingest.go b/cmd/dispatch/ingest.go
index 318a964..ad139a5 100644
--- a/cmd/dispatch/ingest.go
+++ b/cmd/dispatch/ingest.go
@@ -6,6 +6,7 @@ import (
"github.com/kevinmichaelchen/api-dispatch/internal/idl/coop/drivers/dispatch/v1beta1"
"github.com/kevinmichaelchen/api-dispatch/internal/service/money"
"github.com/spf13/cobra"
+ "google.golang.org/genproto/googleapis/type/latlng"
"google.golang.org/protobuf/types/known/timestamppb"
"io/ioutil"
"log"
@@ -63,7 +64,7 @@ func ingestDrivers(cmd *cobra.Command, args []string) {
locations = append(locations, &v1beta1.DriverLocation{
DriverId: e.DriverID,
MostRecentHeartbeat: timestamppb.Now(),
- CurrentLocation: &v1beta1.LatLng{
+ CurrentLocation: &latlng.LatLng{
Latitude: e.LatLng.Latitude,
Longitude: e.LatLng.Longitude,
},
@@ -123,7 +124,7 @@ func ingestTrips(cmd *cobra.Command, args []string) {
trips = append(trips, &v1beta1.Trip{
Id: e.Id,
ScheduledFor: timestamppb.New(e.ScheduledFor),
- PickupLocation: &v1beta1.LatLng{
+ PickupLocation: &latlng.LatLng{
Latitude: e.LatLng.Latitude,
Longitude: e.LatLng.Longitude,
},
diff --git a/cmd/dispatch/nearest.go b/cmd/dispatch/nearest.go
index 0bbd170..fef8f67 100644
--- a/cmd/dispatch/nearest.go
+++ b/cmd/dispatch/nearest.go
@@ -4,13 +4,14 @@ import (
"context"
"github.com/kevinmichaelchen/api-dispatch/internal/idl/coop/drivers/dispatch/v1beta1"
"github.com/spf13/cobra"
+ "google.golang.org/genproto/googleapis/type/latlng"
"log"
)
func getNearestDrivers(cmd *cobra.Command, args []string) {
// Create request
req := &v1beta1.GetNearestDriversRequest{
- PickupLocation: &v1beta1.LatLng{
+ PickupLocation: &latlng.LatLng{
Latitude: latitude,
Longitude: longitude,
},
@@ -36,7 +37,7 @@ func getNearestTrips(cmd *cobra.Command, args []string) {
// Create request
req := &v1beta1.GetNearestTripsRequest{
Driver: &v1beta1.GetNearestTripsRequest_DriverLocation{
- DriverLocation: &v1beta1.LatLng{
+ DriverLocation: &latlng.LatLng{
Latitude: latitude,
Longitude: longitude,
},
diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md
index 09d85d6..f12d64e 100644
--- a/docs/CONTRIBUTING.md
+++ b/docs/CONTRIBUTING.md
@@ -118,15 +118,8 @@ dispatch=# select driver_id from driver_location ;
## JetBrains Protobuf Import Paths
In `Languages & Frameworks > Protocol Buffers`, import the `./idl` directory.
-Install envoyproxy/protoc-gen-validate into your `GOPATH`.
+Then install dependencies in `./idl/buf.yaml`:
```
-$ go env -json GOPATH GOROOT
-{
- "GOPATH": "/Users/kevinchen/go",
- "GOROOT": "/opt/homebrew/Cellar/go/1.18.2/libexec"
-}
-
-$ go install github.com/envoyproxy/protoc-gen-validate@latest
+buf export buf.build/googleapis/googleapis -o idl
+buf export buf.build/envoyproxy/protoc-gen-validate -o idl
```
-
-Add an import path for `${GOPATH}/pkg/mod/github.com/envoyproxy/protoc-gen-validate@v0.6.7`.
\ No newline at end of file
diff --git a/idl/README.md b/idl/README.md
new file mode 100644
index 0000000..6d02ce7
--- /dev/null
+++ b/idl/README.md
@@ -0,0 +1,10 @@
+Our protobufs use dependencies from the
+[Buf Schema Registry](https://buf.build/explore).
+
+You'll need to download these locally for your IDE to be happy.
+
+From the root-level of this repo, run:
+```
+buf export buf.build/googleapis/googleapis -o idl
+buf export buf.build/envoyproxy/protoc-gen-validate -o idl
+```
diff --git a/idl/buf.lock b/idl/buf.lock
index 2415498..5c4a6f5 100644
--- a/idl/buf.lock
+++ b/idl/buf.lock
@@ -5,3 +5,7 @@ deps:
owner: envoyproxy
repository: protoc-gen-validate
commit: dc09a417d27241f7b069feae2cd74a0e
+ - remote: buf.build
+ owner: googleapis
+ repository: googleapis
+ commit: 2c4adef7af3d4b74b8a224260cf10cb9
diff --git a/idl/buf.yaml b/idl/buf.yaml
index 9bfaa69..be50708 100644
--- a/idl/buf.yaml
+++ b/idl/buf.yaml
@@ -1,6 +1,7 @@
version: v1
deps:
- buf.build/envoyproxy/protoc-gen-validate:0e25aabb25c0709aff19aea176a1da13328b12fb
+ - buf.build/googleapis/googleapis:2c4adef7af3d4b74b8a224260cf10cb9
breaking:
use:
- FILE
diff --git a/idl/coop/drivers/dispatch/v1beta1/api.proto b/idl/coop/drivers/dispatch/v1beta1/api.proto
index 18136cf..e9b90bf 100644
--- a/idl/coop/drivers/dispatch/v1beta1/api.proto
+++ b/idl/coop/drivers/dispatch/v1beta1/api.proto
@@ -3,9 +3,9 @@ syntax = "proto3";
package coop.drivers.dispatch.v1beta1;
import "coop/drivers/dispatch/v1beta1/driver.proto";
-import "coop/drivers/dispatch/v1beta1/latlng.proto";
import "coop/drivers/dispatch/v1beta1/trip.proto";
import "google/protobuf/duration.proto";
+import "google/type/latlng.proto";
import "validate/validate.proto";
option go_package = "github.com/kevinmichaelchen/api-dispatch/internal/idl/coop/drivers/dispatch/v1beta1";
@@ -47,7 +47,7 @@ message CreateTripsResponse {}
message GetNearestDriversRequest {
// trip pickup location
- LatLng pickup_location = 1;
+ google.type.LatLng pickup_location = 1 [(validate.rules).message.required = true];
int32 limit = 2 [(validate.rules).int32 = {
gt: 0,
lte: 1000
@@ -64,7 +64,7 @@ message GetNearestTripsRequest {
option (validate.required) = true;
string driver_id = 1;
- LatLng driver_location = 2;
+ google.type.LatLng driver_location = 2;
}
int32 limit = 3 [(validate.rules).int32 = {
gt: 0,
@@ -86,7 +86,7 @@ message SearchResult {
// Time it takes driver to go to pickup
google.protobuf.Duration duration = 4;
// The match's location.
- LatLng location = 5;
+ google.type.LatLng location = 5;
// Human-readable location
string address = 6;
// The highest (finest) H3 resolution in which the match was found.
diff --git a/idl/coop/drivers/dispatch/v1beta1/driver.proto b/idl/coop/drivers/dispatch/v1beta1/driver.proto
index 8458850..db4c9d9 100644
--- a/idl/coop/drivers/dispatch/v1beta1/driver.proto
+++ b/idl/coop/drivers/dispatch/v1beta1/driver.proto
@@ -2,8 +2,8 @@ syntax = "proto3";
package coop.drivers.dispatch.v1beta1;
-import "coop/drivers/dispatch/v1beta1/latlng.proto";
import "google/protobuf/timestamp.proto";
+import "google/type/latlng.proto";
import "validate/validate.proto";
option go_package = "github.com/kevinmichaelchen/api-dispatch/internal/idl/coop/drivers/dispatch/v1beta1";
@@ -12,5 +12,5 @@ message DriverLocation {
string id = 1;
string driver_id = 2 [(validate.rules).string.min_len = 1];
google.protobuf.Timestamp most_recent_heartbeat = 3 [(validate.rules).timestamp.required = true];
- LatLng current_location = 4 [(validate.rules).message.required = true];
+ google.type.LatLng current_location = 4 [(validate.rules).message.required = true];
}
diff --git a/idl/coop/drivers/dispatch/v1beta1/latlng.proto b/idl/coop/drivers/dispatch/v1beta1/latlng.proto
deleted file mode 100644
index b8a8394..0000000
--- a/idl/coop/drivers/dispatch/v1beta1/latlng.proto
+++ /dev/null
@@ -1,26 +0,0 @@
-syntax = "proto3";
-
-package coop.drivers.dispatch.v1beta1;
-
-import "validate/validate.proto";
-
-option go_package = "github.com/kevinmichaelchen/api-dispatch/internal/idl/coop/drivers/dispatch/v1beta1";
-
-// An object that represents a latitude/longitude pair. This is expressed as a
-// pair of doubles to represent degrees latitude and degrees longitude. Unless
-// specified otherwise, this must conform to the
-// WGS84
-// standard. Values must be within normalized ranges.
-message LatLng {
- // The latitude in degrees. It must be in the range [-90.0, +90.0].
- double latitude = 1 [(validate.rules).double = {
- gte: -90,
- lte: 90
- }];
-
- // The longitude in degrees. It must be in the range [-180.0, +180.0].
- double longitude = 2 [(validate.rules).double = {
- gte: -180,
- lte: 180
- }];
-}
diff --git a/idl/coop/drivers/dispatch/v1beta1/trip.proto b/idl/coop/drivers/dispatch/v1beta1/trip.proto
index a43e6b1..a712959 100644
--- a/idl/coop/drivers/dispatch/v1beta1/trip.proto
+++ b/idl/coop/drivers/dispatch/v1beta1/trip.proto
@@ -2,8 +2,8 @@ syntax = "proto3";
package coop.drivers.dispatch.v1beta1;
-import "coop/drivers/dispatch/v1beta1/latlng.proto";
import "google/protobuf/timestamp.proto";
+import "google/type/latlng.proto";
import "validate/validate.proto";
option go_package = "github.com/kevinmichaelchen/api-dispatch/internal/idl/coop/drivers/dispatch/v1beta1";
@@ -11,7 +11,7 @@ option go_package = "github.com/kevinmichaelchen/api-dispatch/internal/idl/coop/
message Trip {
string id = 1 [(validate.rules).string.min_len = 1];
// where
- LatLng pickup_location = 2 [(validate.rules).message.required = true];
+ google.type.LatLng pickup_location = 2 [(validate.rules).message.required = true];
// when
google.protobuf.Timestamp scheduled_for = 3 [(validate.rules).timestamp.required = true];
// how much $$$
diff --git a/internal/idl/coop/drivers/dispatch/v1beta1/api.pb.go b/internal/idl/coop/drivers/dispatch/v1beta1/api.pb.go
index 98a28ee..7c84f15 100644
--- a/internal/idl/coop/drivers/dispatch/v1beta1/api.pb.go
+++ b/internal/idl/coop/drivers/dispatch/v1beta1/api.pb.go
@@ -8,6 +8,7 @@ package v1beta1
import (
_ "github.com/envoyproxy/protoc-gen-validate/validate"
+ latlng "google.golang.org/genproto/googleapis/type/latlng"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
durationpb "google.golang.org/protobuf/types/known/durationpb"
@@ -198,8 +199,8 @@ type GetNearestDriversRequest struct {
unknownFields protoimpl.UnknownFields
// trip pickup location
- PickupLocation *LatLng `protobuf:"bytes,1,opt,name=pickup_location,json=pickupLocation,proto3" json:"pickup_location,omitempty"`
- Limit int32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
+ PickupLocation *latlng.LatLng `protobuf:"bytes,1,opt,name=pickup_location,json=pickupLocation,proto3" json:"pickup_location,omitempty"`
+ Limit int32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
}
func (x *GetNearestDriversRequest) Reset() {
@@ -234,7 +235,7 @@ func (*GetNearestDriversRequest) Descriptor() ([]byte, []int) {
return file_coop_drivers_dispatch_v1beta1_api_proto_rawDescGZIP(), []int{4}
}
-func (x *GetNearestDriversRequest) GetPickupLocation() *LatLng {
+func (x *GetNearestDriversRequest) GetPickupLocation() *latlng.LatLng {
if x != nil {
return x.PickupLocation
}
@@ -361,7 +362,7 @@ func (x *GetNearestTripsRequest) GetDriverId() string {
return ""
}
-func (x *GetNearestTripsRequest) GetDriverLocation() *LatLng {
+func (x *GetNearestTripsRequest) GetDriverLocation() *latlng.LatLng {
if x, ok := x.GetDriver().(*GetNearestTripsRequest_DriverLocation); ok {
return x.DriverLocation
}
@@ -384,7 +385,7 @@ type GetNearestTripsRequest_DriverId struct {
}
type GetNearestTripsRequest_DriverLocation struct {
- DriverLocation *LatLng `protobuf:"bytes,2,opt,name=driver_location,json=driverLocation,proto3,oneof"`
+ DriverLocation *latlng.LatLng `protobuf:"bytes,2,opt,name=driver_location,json=driverLocation,proto3,oneof"`
}
func (*GetNearestTripsRequest_DriverId) isGetNearestTripsRequest_Driver() {}
@@ -452,7 +453,7 @@ type SearchResult struct {
// Time it takes driver to go to pickup
Duration *durationpb.Duration `protobuf:"bytes,4,opt,name=duration,proto3" json:"duration,omitempty"`
// The match's location.
- Location *LatLng `protobuf:"bytes,5,opt,name=location,proto3" json:"location,omitempty"`
+ Location *latlng.LatLng `protobuf:"bytes,5,opt,name=location,proto3" json:"location,omitempty"`
// Human-readable location
Address string `protobuf:"bytes,6,opt,name=address,proto3" json:"address,omitempty"`
// The highest (finest) H3 resolution in which the match was found.
@@ -530,7 +531,7 @@ func (x *SearchResult) GetDuration() *durationpb.Duration {
return nil
}
-func (x *SearchResult) GetLocation() *LatLng {
+func (x *SearchResult) GetLocation() *latlng.LatLng {
if x != nil {
return x.Location
}
@@ -701,159 +702,155 @@ var file_coop_drivers_dispatch_v1beta1_api_proto_rawDesc = []byte{
0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x2a, 0x63, 0x6f, 0x6f, 0x70, 0x2f, 0x64,
0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2f, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2f,
0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x2e, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x6f, 0x70, 0x2f, 0x64, 0x72, 0x69, 0x76, 0x65,
+ 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x28, 0x63, 0x6f, 0x6f, 0x70, 0x2f, 0x64, 0x72, 0x69, 0x76, 0x65,
0x72, 0x73, 0x2f, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65,
- 0x74, 0x61, 0x31, 0x2f, 0x6c, 0x61, 0x74, 0x6c, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x1a, 0x28, 0x63, 0x6f, 0x6f, 0x70, 0x2f, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2f, 0x64,
- 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f,
- 0x74, 0x72, 0x69, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61,
- 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69,
- 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x22, 0x78, 0x0a, 0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x72, 0x69,
- 0x76, 0x65, 0x72, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75,
- 0x65, 0x73, 0x74, 0x12, 0x58, 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
- 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x2e, 0x64, 0x72,
- 0x69, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x76,
- 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x4c, 0x6f, 0x63,
- 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0b, 0xfa, 0x42, 0x08, 0x92, 0x01, 0x05, 0x08, 0x01, 0x10,
- 0xe8, 0x07, 0x52, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x1f, 0x0a,
- 0x1d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x4c, 0x6f, 0x63,
- 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5c,
- 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x72, 0x69, 0x70, 0x73, 0x52, 0x65, 0x71,
- 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x05, 0x74, 0x72, 0x69, 0x70, 0x73, 0x18, 0x01, 0x20,
- 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65,
- 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65,
- 0x74, 0x61, 0x31, 0x2e, 0x54, 0x72, 0x69, 0x70, 0x42, 0x0b, 0xfa, 0x42, 0x08, 0x92, 0x01, 0x05,
- 0x08, 0x01, 0x10, 0xe8, 0x07, 0x52, 0x05, 0x74, 0x72, 0x69, 0x70, 0x73, 0x22, 0x15, 0x0a, 0x13,
- 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x72, 0x69, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
- 0x6e, 0x73, 0x65, 0x22, 0x8c, 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x61, 0x72, 0x65,
- 0x73, 0x74, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
- 0x12, 0x4e, 0x0a, 0x0f, 0x70, 0x69, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74,
- 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x63, 0x6f, 0x6f, 0x70,
- 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63,
- 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x61, 0x74, 0x4c, 0x6e, 0x67,
- 0x52, 0x0e, 0x70, 0x69, 0x63, 0x6b, 0x75, 0x70, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
- 0x12, 0x20, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42,
- 0x0a, 0xfa, 0x42, 0x07, 0x1a, 0x05, 0x18, 0xe8, 0x07, 0x20, 0x00, 0x52, 0x05, 0x6c, 0x69, 0x6d,
- 0x69, 0x74, 0x22, 0x89, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x61, 0x72, 0x65, 0x73,
- 0x74, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
- 0x12, 0x45, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28,
- 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73,
- 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
- 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07,
- 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x69, 0x63, 0x6b, 0x75,
- 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
- 0x0d, 0x70, 0x69, 0x63, 0x6b, 0x75, 0x70, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xba,
- 0x01, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x61, 0x72, 0x65, 0x73, 0x74, 0x54, 0x72, 0x69,
- 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x09, 0x64, 0x72, 0x69,
- 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08,
- 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x50, 0x0a, 0x0f, 0x64, 0x72, 0x69, 0x76,
- 0x65, 0x72, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28,
- 0x0b, 0x32, 0x25, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73,
+ 0x74, 0x61, 0x31, 0x2f, 0x74, 0x72, 0x69, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f,
+ 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6c, 0x61, 0x74, 0x6c,
+ 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61,
+ 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x22, 0x78, 0x0a, 0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x72, 0x69, 0x76, 0x65,
+ 0x72, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x12, 0x58, 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01,
+ 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76,
+ 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62,
+ 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x4c, 0x6f, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x42, 0x0b, 0xfa, 0x42, 0x08, 0x92, 0x01, 0x05, 0x08, 0x01, 0x10, 0xe8, 0x07,
+ 0x52, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x1f, 0x0a, 0x1d, 0x55,
+ 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x4c, 0x6f, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5c, 0x0a, 0x12,
+ 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x72, 0x69, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x12, 0x46, 0x0a, 0x05, 0x74, 0x72, 0x69, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28,
+ 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73,
0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
- 0x31, 0x2e, 0x4c, 0x61, 0x74, 0x4c, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x0e, 0x64, 0x72, 0x69, 0x76,
- 0x65, 0x72, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x05, 0x6c, 0x69,
- 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x1a, 0x05,
- 0x18, 0xe8, 0x07, 0x20, 0x00, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x42, 0x0d, 0x0a, 0x06,
- 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0x60, 0x0a, 0x17, 0x47,
- 0x65, 0x74, 0x4e, 0x65, 0x61, 0x72, 0x65, 0x73, 0x74, 0x54, 0x72, 0x69, 0x70, 0x73, 0x52, 0x65,
+ 0x31, 0x2e, 0x54, 0x72, 0x69, 0x70, 0x42, 0x0b, 0xfa, 0x42, 0x08, 0x92, 0x01, 0x05, 0x08, 0x01,
+ 0x10, 0xe8, 0x07, 0x52, 0x05, 0x74, 0x72, 0x69, 0x70, 0x73, 0x22, 0x15, 0x0a, 0x13, 0x43, 0x72,
+ 0x65, 0x61, 0x74, 0x65, 0x54, 0x72, 0x69, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
+ 0x65, 0x22, 0x84, 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x61, 0x72, 0x65, 0x73, 0x74,
+ 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46,
+ 0x0a, 0x0f, 0x70, 0x69, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x4c, 0x61, 0x74, 0x4c, 0x6e, 0x67, 0x42, 0x08, 0xfa, 0x42,
+ 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0e, 0x70, 0x69, 0x63, 0x6b, 0x75, 0x70, 0x4c, 0x6f,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18,
+ 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x1a, 0x05, 0x18, 0xe8, 0x07, 0x20,
+ 0x00, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x89, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74,
+ 0x4e, 0x65, 0x61, 0x72, 0x65, 0x73, 0x74, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74,
0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x2e, 0x64,
0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2e,
0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65,
- 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0xa9, 0x03,
- 0x0a, 0x0c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x39,
- 0x0a, 0x04, 0x74, 0x72, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63,
- 0x6f, 0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70,
- 0x61, 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x72, 0x69,
- 0x70, 0x48, 0x00, 0x52, 0x04, 0x74, 0x72, 0x69, 0x70, 0x12, 0x47, 0x0a, 0x06, 0x64, 0x72, 0x69,
- 0x76, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6f, 0x6f, 0x70,
- 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63,
- 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72,
- 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x64, 0x72, 0x69, 0x76,
- 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6d,
- 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0e, 0x64, 0x69, 0x73,
- 0x74, 0x61, 0x6e, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x35, 0x0a, 0x08, 0x64,
- 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e,
- 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
- 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69,
- 0x6f, 0x6e, 0x12, 0x41, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05,
- 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76,
- 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62,
- 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x61, 0x74, 0x4c, 0x6e, 0x67, 0x52, 0x08, 0x6c, 0x6f, 0x63,
- 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73,
- 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12,
- 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20,
- 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12,
- 0x17, 0x0a, 0x07, 0x6b, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05,
- 0x52, 0x06, 0x6b, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72,
- 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x42, 0x09,
- 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x5c, 0x0a, 0x12, 0x4c, 0x69, 0x73,
- 0x74, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
- 0x27, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01,
- 0x28, 0x05, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x1a, 0x05, 0x18, 0xe8, 0x07, 0x20, 0x00, 0x52, 0x08,
- 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65,
- 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61,
- 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x97, 0x01, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74,
- 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
- 0x58, 0x0a, 0x10, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69,
- 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6f, 0x6f, 0x70,
- 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63,
- 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72,
- 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72,
- 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78,
- 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65,
- 0x6e, 0x32, 0xa8, 0x05, 0x0a, 0x0f, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x53, 0x65,
- 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x94, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
- 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12,
- 0x3b, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x64,
- 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e,
- 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x4c, 0x6f, 0x63, 0x61,
- 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, 0x2e, 0x63,
- 0x6f, 0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70,
- 0x61, 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64,
- 0x61, 0x74, 0x65, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f,
- 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x76, 0x0a, 0x0b,
- 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x72, 0x69, 0x70, 0x73, 0x12, 0x31, 0x2e, 0x63, 0x6f,
+ 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x25, 0x0a,
+ 0x0e, 0x70, 0x69, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18,
+ 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x69, 0x63, 0x6b, 0x75, 0x70, 0x41, 0x64, 0x64,
+ 0x72, 0x65, 0x73, 0x73, 0x22, 0xa8, 0x01, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x61, 0x72,
+ 0x65, 0x73, 0x74, 0x54, 0x72, 0x69, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
+ 0x1d, 0x0a, 0x09, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x3e,
+ 0x0a, 0x0f, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x4c, 0x61, 0x74, 0x4c, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x0e,
+ 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20,
+ 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0a, 0xfa,
+ 0x42, 0x07, 0x1a, 0x05, 0x18, 0xe8, 0x07, 0x20, 0x00, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74,
+ 0x42, 0x0d, 0x0a, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22,
+ 0x60, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x61, 0x72, 0x65, 0x73, 0x74, 0x54, 0x72, 0x69,
+ 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x07, 0x72, 0x65,
+ 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6f,
0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61,
- 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61,
- 0x74, 0x65, 0x54, 0x72, 0x69, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32,
+ 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72,
+ 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74,
+ 0x73, 0x22, 0x97, 0x03, 0x0a, 0x0c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75,
+ 0x6c, 0x74, 0x12, 0x39, 0x0a, 0x04, 0x74, 0x72, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
+ 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2e,
+ 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31,
+ 0x2e, 0x54, 0x72, 0x69, 0x70, 0x48, 0x00, 0x52, 0x04, 0x74, 0x72, 0x69, 0x70, 0x12, 0x47, 0x0a,
+ 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e,
+ 0x63, 0x6f, 0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73,
+ 0x70, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x72,
+ 0x69, 0x76, 0x65, 0x72, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x06,
+ 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e,
+ 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52,
+ 0x0e, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12,
+ 0x35, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28,
+ 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+ 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x64, 0x75,
+ 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x4c, 0x61, 0x74, 0x4c, 0x6e, 0x67, 0x52, 0x08, 0x6c,
+ 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65,
+ 0x73, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73,
+ 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x18,
+ 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f,
+ 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x6b, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x01,
+ 0x28, 0x05, 0x52, 0x06, 0x6b, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63,
+ 0x6f, 0x72, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65,
+ 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x5c, 0x0a, 0x12, 0x4c,
+ 0x69, 0x73, 0x74, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x12, 0x27, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x05, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x1a, 0x05, 0x18, 0xe8, 0x07, 0x20, 0x00,
+ 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61,
+ 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
+ 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x97, 0x01, 0x0a, 0x13, 0x4c, 0x69,
+ 0x73, 0x74, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
+ 0x65, 0x12, 0x58, 0x0a, 0x10, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x5f, 0x6c, 0x6f, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6f,
+ 0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61,
+ 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x72, 0x69, 0x76,
+ 0x65, 0x72, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x64, 0x72, 0x69, 0x76,
+ 0x65, 0x72, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e,
+ 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f,
+ 0x6b, 0x65, 0x6e, 0x32, 0xa8, 0x05, 0x0a, 0x0f, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68,
+ 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x94, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61,
+ 0x74, 0x65, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x73, 0x12, 0x3b, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73,
+ 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
+ 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x4c, 0x6f,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c,
0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69,
- 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43,
- 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x72, 0x69, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
- 0x73, 0x65, 0x22, 0x00, 0x12, 0x88, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x61, 0x72,
- 0x65, 0x73, 0x74, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x12, 0x37, 0x2e, 0x63, 0x6f, 0x6f,
- 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74,
- 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x65,
- 0x61, 0x72, 0x65, 0x73, 0x74, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75,
- 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65,
- 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65,
- 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x61, 0x72, 0x65, 0x73, 0x74, 0x44, 0x72,
- 0x69, 0x76, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12,
- 0x82, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x61, 0x72, 0x65, 0x73, 0x74, 0x54, 0x72,
- 0x69, 0x70, 0x73, 0x12, 0x35, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65,
- 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65,
- 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x61, 0x72, 0x65, 0x73, 0x74, 0x54, 0x72,
- 0x69, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x63, 0x6f, 0x6f,
- 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74,
- 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x65,
- 0x61, 0x72, 0x65, 0x73, 0x74, 0x54, 0x72, 0x69, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
- 0x73, 0x65, 0x22, 0x00, 0x12, 0x76, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x72, 0x69, 0x76,
- 0x65, 0x72, 0x73, 0x12, 0x31, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65,
- 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65,
- 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x52,
- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x2e, 0x64, 0x72,
- 0x69, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x76,
- 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x72, 0x69, 0x76, 0x65,
- 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x55, 0x5a, 0x53,
- 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x65, 0x76, 0x69, 0x6e,
- 0x6d, 0x69, 0x63, 0x68, 0x61, 0x65, 0x6c, 0x63, 0x68, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2d,
- 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61,
- 0x6c, 0x2f, 0x69, 0x64, 0x6c, 0x2f, 0x63, 0x6f, 0x6f, 0x70, 0x2f, 0x64, 0x72, 0x69, 0x76, 0x65,
- 0x72, 0x73, 0x2f, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65,
- 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55,
+ 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x4c, 0x6f, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x76,
+ 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x72, 0x69, 0x70, 0x73, 0x12, 0x31, 0x2e,
+ 0x63, 0x6f, 0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73,
+ 0x70, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72,
+ 0x65, 0x61, 0x74, 0x65, 0x54, 0x72, 0x69, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
+ 0x1a, 0x32, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2e,
+ 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31,
+ 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x72, 0x69, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70,
+ 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x88, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4e, 0x65,
+ 0x61, 0x72, 0x65, 0x73, 0x74, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x12, 0x37, 0x2e, 0x63,
+ 0x6f, 0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70,
+ 0x61, 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74,
+ 0x4e, 0x65, 0x61, 0x72, 0x65, 0x73, 0x74, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69,
+ 0x76, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31,
+ 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x61, 0x72, 0x65, 0x73, 0x74,
+ 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
+ 0x00, 0x12, 0x82, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x61, 0x72, 0x65, 0x73, 0x74,
+ 0x54, 0x72, 0x69, 0x70, 0x73, 0x12, 0x35, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69,
+ 0x76, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31,
+ 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x61, 0x72, 0x65, 0x73, 0x74,
+ 0x54, 0x72, 0x69, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x63,
+ 0x6f, 0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70,
+ 0x61, 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74,
+ 0x4e, 0x65, 0x61, 0x72, 0x65, 0x73, 0x74, 0x54, 0x72, 0x69, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70,
+ 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x76, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x72,
+ 0x69, 0x76, 0x65, 0x72, 0x73, 0x12, 0x31, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69,
+ 0x76, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31,
+ 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72,
+ 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x2e,
+ 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68,
+ 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x72, 0x69,
+ 0x76, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x55,
+ 0x5a, 0x53, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x65, 0x76,
+ 0x69, 0x6e, 0x6d, 0x69, 0x63, 0x68, 0x61, 0x65, 0x6c, 0x63, 0x68, 0x65, 0x6e, 0x2f, 0x61, 0x70,
+ 0x69, 0x2d, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72,
+ 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x64, 0x6c, 0x2f, 0x63, 0x6f, 0x6f, 0x70, 0x2f, 0x64, 0x72, 0x69,
+ 0x76, 0x65, 0x72, 0x73, 0x2f, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2f, 0x76, 0x31,
+ 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -883,20 +880,20 @@ var file_coop_drivers_dispatch_v1beta1_api_proto_goTypes = []interface{}{
(*ListDriversResponse)(nil), // 10: coop.drivers.dispatch.v1beta1.ListDriversResponse
(*DriverLocation)(nil), // 11: coop.drivers.dispatch.v1beta1.DriverLocation
(*Trip)(nil), // 12: coop.drivers.dispatch.v1beta1.Trip
- (*LatLng)(nil), // 13: coop.drivers.dispatch.v1beta1.LatLng
+ (*latlng.LatLng)(nil), // 13: google.type.LatLng
(*durationpb.Duration)(nil), // 14: google.protobuf.Duration
}
var file_coop_drivers_dispatch_v1beta1_api_proto_depIdxs = []int32{
11, // 0: coop.drivers.dispatch.v1beta1.UpdateDriverLocationsRequest.locations:type_name -> coop.drivers.dispatch.v1beta1.DriverLocation
12, // 1: coop.drivers.dispatch.v1beta1.CreateTripsRequest.trips:type_name -> coop.drivers.dispatch.v1beta1.Trip
- 13, // 2: coop.drivers.dispatch.v1beta1.GetNearestDriversRequest.pickup_location:type_name -> coop.drivers.dispatch.v1beta1.LatLng
+ 13, // 2: coop.drivers.dispatch.v1beta1.GetNearestDriversRequest.pickup_location:type_name -> google.type.LatLng
8, // 3: coop.drivers.dispatch.v1beta1.GetNearestDriversResponse.results:type_name -> coop.drivers.dispatch.v1beta1.SearchResult
- 13, // 4: coop.drivers.dispatch.v1beta1.GetNearestTripsRequest.driver_location:type_name -> coop.drivers.dispatch.v1beta1.LatLng
+ 13, // 4: coop.drivers.dispatch.v1beta1.GetNearestTripsRequest.driver_location:type_name -> google.type.LatLng
8, // 5: coop.drivers.dispatch.v1beta1.GetNearestTripsResponse.results:type_name -> coop.drivers.dispatch.v1beta1.SearchResult
12, // 6: coop.drivers.dispatch.v1beta1.SearchResult.trip:type_name -> coop.drivers.dispatch.v1beta1.Trip
11, // 7: coop.drivers.dispatch.v1beta1.SearchResult.driver:type_name -> coop.drivers.dispatch.v1beta1.DriverLocation
14, // 8: coop.drivers.dispatch.v1beta1.SearchResult.duration:type_name -> google.protobuf.Duration
- 13, // 9: coop.drivers.dispatch.v1beta1.SearchResult.location:type_name -> coop.drivers.dispatch.v1beta1.LatLng
+ 13, // 9: coop.drivers.dispatch.v1beta1.SearchResult.location:type_name -> google.type.LatLng
11, // 10: coop.drivers.dispatch.v1beta1.ListDriversResponse.driver_locations:type_name -> coop.drivers.dispatch.v1beta1.DriverLocation
0, // 11: coop.drivers.dispatch.v1beta1.DispatchService.UpdateDriverLocations:input_type -> coop.drivers.dispatch.v1beta1.UpdateDriverLocationsRequest
2, // 12: coop.drivers.dispatch.v1beta1.DispatchService.CreateTrips:input_type -> coop.drivers.dispatch.v1beta1.CreateTripsRequest
@@ -921,7 +918,6 @@ func file_coop_drivers_dispatch_v1beta1_api_proto_init() {
return
}
file_coop_drivers_dispatch_v1beta1_driver_proto_init()
- file_coop_drivers_dispatch_v1beta1_latlng_proto_init()
file_coop_drivers_dispatch_v1beta1_trip_proto_init()
if !protoimpl.UnsafeEnabled {
file_coop_drivers_dispatch_v1beta1_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
diff --git a/internal/idl/coop/drivers/dispatch/v1beta1/api.pb.validate.go b/internal/idl/coop/drivers/dispatch/v1beta1/api.pb.validate.go
index 696201e..a8b742b 100644
--- a/internal/idl/coop/drivers/dispatch/v1beta1/api.pb.validate.go
+++ b/internal/idl/coop/drivers/dispatch/v1beta1/api.pb.validate.go
@@ -557,6 +557,17 @@ func (m *GetNearestDriversRequest) validate(all bool) error {
var errors []error
+ if m.GetPickupLocation() == nil {
+ err := GetNearestDriversRequestValidationError{
+ field: "PickupLocation",
+ reason: "value is required",
+ }
+ if !all {
+ return err
+ }
+ errors = append(errors, err)
+ }
+
if all {
switch v := interface{}(m.GetPickupLocation()).(type) {
case interface{ ValidateAll() error }:
diff --git a/internal/idl/coop/drivers/dispatch/v1beta1/driver.pb.go b/internal/idl/coop/drivers/dispatch/v1beta1/driver.pb.go
index 5ab85db..d49b4c8 100644
--- a/internal/idl/coop/drivers/dispatch/v1beta1/driver.pb.go
+++ b/internal/idl/coop/drivers/dispatch/v1beta1/driver.pb.go
@@ -8,6 +8,7 @@ package v1beta1
import (
_ "github.com/envoyproxy/protoc-gen-validate/validate"
+ latlng "google.golang.org/genproto/googleapis/type/latlng"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
@@ -30,7 +31,7 @@ type DriverLocation struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
DriverId string `protobuf:"bytes,2,opt,name=driver_id,json=driverId,proto3" json:"driver_id,omitempty"`
MostRecentHeartbeat *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=most_recent_heartbeat,json=mostRecentHeartbeat,proto3" json:"most_recent_heartbeat,omitempty"`
- CurrentLocation *LatLng `protobuf:"bytes,4,opt,name=current_location,json=currentLocation,proto3" json:"current_location,omitempty"`
+ CurrentLocation *latlng.LatLng `protobuf:"bytes,4,opt,name=current_location,json=currentLocation,proto3" json:"current_location,omitempty"`
}
func (x *DriverLocation) Reset() {
@@ -86,7 +87,7 @@ func (x *DriverLocation) GetMostRecentHeartbeat() *timestamppb.Timestamp {
return nil
}
-func (x *DriverLocation) GetCurrentLocation() *LatLng {
+func (x *DriverLocation) GetCurrentLocation() *latlng.LatLng {
if x != nil {
return x.CurrentLocation
}
@@ -100,35 +101,33 @@ var file_coop_drivers_dispatch_v1beta1_driver_proto_rawDesc = []byte{
0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f,
0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1d, 0x63, 0x6f,
0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61,
- 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x2a, 0x63, 0x6f, 0x6f,
- 0x70, 0x2f, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2f, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74,
- 0x63, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x6c, 0x61, 0x74, 0x6c, 0x6e,
- 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
- 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61,
- 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x22, 0xfc, 0x01, 0x0a, 0x0e, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x4c, 0x6f, 0x63, 0x61,
- 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
- 0x52, 0x02, 0x69, 0x64, 0x12, 0x24, 0x0a, 0x09, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x5f, 0x69,
- 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01,
- 0x52, 0x08, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x58, 0x0a, 0x15, 0x6d, 0x6f,
- 0x73, 0x74, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62,
- 0x65, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65,
- 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xfa, 0x42, 0x05, 0xb2, 0x01, 0x02, 0x08, 0x01, 0x52,
- 0x13, 0x6d, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x72, 0x74,
- 0x62, 0x65, 0x61, 0x74, 0x12, 0x5a, 0x0a, 0x10, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f,
- 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25,
- 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69,
- 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c,
- 0x61, 0x74, 0x4c, 0x6e, 0x67, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52,
- 0x0f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
- 0x42, 0x55, 0x5a, 0x53, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b,
- 0x65, 0x76, 0x69, 0x6e, 0x6d, 0x69, 0x63, 0x68, 0x61, 0x65, 0x6c, 0x63, 0x68, 0x65, 0x6e, 0x2f,
- 0x61, 0x70, 0x69, 0x2d, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2f, 0x69, 0x6e, 0x74,
- 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x64, 0x6c, 0x2f, 0x63, 0x6f, 0x6f, 0x70, 0x2f, 0x64,
- 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2f, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2f,
- 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d,
+ 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6c, 0x61, 0x74, 0x6c, 0x6e, 0x67,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65,
+ 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
+ 0xea, 0x01, 0x0a, 0x0e, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02,
+ 0x69, 0x64, 0x12, 0x24, 0x0a, 0x09, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18,
+ 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x08,
+ 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x58, 0x0a, 0x15, 0x6d, 0x6f, 0x73, 0x74,
+ 0x5f, 0x72, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61,
+ 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74,
+ 0x61, 0x6d, 0x70, 0x42, 0x08, 0xfa, 0x42, 0x05, 0xb2, 0x01, 0x02, 0x08, 0x01, 0x52, 0x13, 0x6d,
+ 0x6f, 0x73, 0x74, 0x52, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65,
+ 0x61, 0x74, 0x12, 0x48, 0x0a, 0x10, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x6f,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x4c, 0x61, 0x74, 0x4c, 0x6e,
+ 0x67, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0f, 0x63, 0x75, 0x72,
+ 0x72, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x55, 0x5a, 0x53,
+ 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x65, 0x76, 0x69, 0x6e,
+ 0x6d, 0x69, 0x63, 0x68, 0x61, 0x65, 0x6c, 0x63, 0x68, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2d,
+ 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61,
+ 0x6c, 0x2f, 0x69, 0x64, 0x6c, 0x2f, 0x63, 0x6f, 0x6f, 0x70, 0x2f, 0x64, 0x72, 0x69, 0x76, 0x65,
+ 0x72, 0x73, 0x2f, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65,
+ 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -147,11 +146,11 @@ var file_coop_drivers_dispatch_v1beta1_driver_proto_msgTypes = make([]protoimpl.
var file_coop_drivers_dispatch_v1beta1_driver_proto_goTypes = []interface{}{
(*DriverLocation)(nil), // 0: coop.drivers.dispatch.v1beta1.DriverLocation
(*timestamppb.Timestamp)(nil), // 1: google.protobuf.Timestamp
- (*LatLng)(nil), // 2: coop.drivers.dispatch.v1beta1.LatLng
+ (*latlng.LatLng)(nil), // 2: google.type.LatLng
}
var file_coop_drivers_dispatch_v1beta1_driver_proto_depIdxs = []int32{
1, // 0: coop.drivers.dispatch.v1beta1.DriverLocation.most_recent_heartbeat:type_name -> google.protobuf.Timestamp
- 2, // 1: coop.drivers.dispatch.v1beta1.DriverLocation.current_location:type_name -> coop.drivers.dispatch.v1beta1.LatLng
+ 2, // 1: coop.drivers.dispatch.v1beta1.DriverLocation.current_location:type_name -> google.type.LatLng
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
@@ -164,7 +163,6 @@ func file_coop_drivers_dispatch_v1beta1_driver_proto_init() {
if File_coop_drivers_dispatch_v1beta1_driver_proto != nil {
return
}
- file_coop_drivers_dispatch_v1beta1_latlng_proto_init()
if !protoimpl.UnsafeEnabled {
file_coop_drivers_dispatch_v1beta1_driver_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DriverLocation); i {
diff --git a/internal/idl/coop/drivers/dispatch/v1beta1/latlng.pb.go b/internal/idl/coop/drivers/dispatch/v1beta1/latlng.pb.go
deleted file mode 100644
index 3ed42f9..0000000
--- a/internal/idl/coop/drivers/dispatch/v1beta1/latlng.pb.go
+++ /dev/null
@@ -1,172 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// versions:
-// protoc-gen-go v1.27.1
-// protoc (unknown)
-// source: coop/drivers/dispatch/v1beta1/latlng.proto
-
-package v1beta1
-
-import (
- _ "github.com/envoyproxy/protoc-gen-validate/validate"
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
- reflect "reflect"
- sync "sync"
-)
-
-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)
-)
-
-// An object that represents a latitude/longitude pair. This is expressed as a
-// pair of doubles to represent degrees latitude and degrees longitude. Unless
-// specified otherwise, this must conform to the
-// WGS84
-// standard. Values must be within normalized ranges.
-type LatLng struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // The latitude in degrees. It must be in the range [-90.0, +90.0].
- Latitude float64 `protobuf:"fixed64,1,opt,name=latitude,proto3" json:"latitude,omitempty"`
- // The longitude in degrees. It must be in the range [-180.0, +180.0].
- Longitude float64 `protobuf:"fixed64,2,opt,name=longitude,proto3" json:"longitude,omitempty"`
-}
-
-func (x *LatLng) Reset() {
- *x = LatLng{}
- if protoimpl.UnsafeEnabled {
- mi := &file_coop_drivers_dispatch_v1beta1_latlng_proto_msgTypes[0]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *LatLng) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*LatLng) ProtoMessage() {}
-
-func (x *LatLng) ProtoReflect() protoreflect.Message {
- mi := &file_coop_drivers_dispatch_v1beta1_latlng_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 LatLng.ProtoReflect.Descriptor instead.
-func (*LatLng) Descriptor() ([]byte, []int) {
- return file_coop_drivers_dispatch_v1beta1_latlng_proto_rawDescGZIP(), []int{0}
-}
-
-func (x *LatLng) GetLatitude() float64 {
- if x != nil {
- return x.Latitude
- }
- return 0
-}
-
-func (x *LatLng) GetLongitude() float64 {
- if x != nil {
- return x.Longitude
- }
- return 0
-}
-
-var File_coop_drivers_dispatch_v1beta1_latlng_proto protoreflect.FileDescriptor
-
-var file_coop_drivers_dispatch_v1beta1_latlng_proto_rawDesc = []byte{
- 0x0a, 0x2a, 0x63, 0x6f, 0x6f, 0x70, 0x2f, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2f, 0x64,
- 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f,
- 0x6c, 0x61, 0x74, 0x6c, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1d, 0x63, 0x6f,
- 0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61,
- 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x17, 0x76, 0x61, 0x6c,
- 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x74, 0x0a, 0x06, 0x4c, 0x61, 0x74, 0x4c, 0x6e, 0x67, 0x12, 0x33,
- 0x0a, 0x08, 0x6c, 0x61, 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01,
- 0x42, 0x17, 0xfa, 0x42, 0x14, 0x12, 0x12, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x56, 0x40,
- 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x56, 0xc0, 0x52, 0x08, 0x6c, 0x61, 0x74, 0x69, 0x74,
- 0x75, 0x64, 0x65, 0x12, 0x35, 0x0a, 0x09, 0x6c, 0x6f, 0x6e, 0x67, 0x69, 0x74, 0x75, 0x64, 0x65,
- 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x42, 0x17, 0xfa, 0x42, 0x14, 0x12, 0x12, 0x19, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x80, 0x66, 0x40, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x66, 0xc0, 0x52,
- 0x09, 0x6c, 0x6f, 0x6e, 0x67, 0x69, 0x74, 0x75, 0x64, 0x65, 0x42, 0x55, 0x5a, 0x53, 0x67, 0x69,
- 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x65, 0x76, 0x69, 0x6e, 0x6d, 0x69,
- 0x63, 0x68, 0x61, 0x65, 0x6c, 0x63, 0x68, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2d, 0x64, 0x69,
- 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f,
- 0x69, 0x64, 0x6c, 0x2f, 0x63, 0x6f, 0x6f, 0x70, 0x2f, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73,
- 0x2f, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
- 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
-}
-
-var (
- file_coop_drivers_dispatch_v1beta1_latlng_proto_rawDescOnce sync.Once
- file_coop_drivers_dispatch_v1beta1_latlng_proto_rawDescData = file_coop_drivers_dispatch_v1beta1_latlng_proto_rawDesc
-)
-
-func file_coop_drivers_dispatch_v1beta1_latlng_proto_rawDescGZIP() []byte {
- file_coop_drivers_dispatch_v1beta1_latlng_proto_rawDescOnce.Do(func() {
- file_coop_drivers_dispatch_v1beta1_latlng_proto_rawDescData = protoimpl.X.CompressGZIP(file_coop_drivers_dispatch_v1beta1_latlng_proto_rawDescData)
- })
- return file_coop_drivers_dispatch_v1beta1_latlng_proto_rawDescData
-}
-
-var file_coop_drivers_dispatch_v1beta1_latlng_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
-var file_coop_drivers_dispatch_v1beta1_latlng_proto_goTypes = []interface{}{
- (*LatLng)(nil), // 0: coop.drivers.dispatch.v1beta1.LatLng
-}
-var file_coop_drivers_dispatch_v1beta1_latlng_proto_depIdxs = []int32{
- 0, // [0:0] is the sub-list for method output_type
- 0, // [0:0] 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_coop_drivers_dispatch_v1beta1_latlng_proto_init() }
-func file_coop_drivers_dispatch_v1beta1_latlng_proto_init() {
- if File_coop_drivers_dispatch_v1beta1_latlng_proto != nil {
- return
- }
- if !protoimpl.UnsafeEnabled {
- file_coop_drivers_dispatch_v1beta1_latlng_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*LatLng); 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_coop_drivers_dispatch_v1beta1_latlng_proto_rawDesc,
- NumEnums: 0,
- NumMessages: 1,
- NumExtensions: 0,
- NumServices: 0,
- },
- GoTypes: file_coop_drivers_dispatch_v1beta1_latlng_proto_goTypes,
- DependencyIndexes: file_coop_drivers_dispatch_v1beta1_latlng_proto_depIdxs,
- MessageInfos: file_coop_drivers_dispatch_v1beta1_latlng_proto_msgTypes,
- }.Build()
- File_coop_drivers_dispatch_v1beta1_latlng_proto = out.File
- file_coop_drivers_dispatch_v1beta1_latlng_proto_rawDesc = nil
- file_coop_drivers_dispatch_v1beta1_latlng_proto_goTypes = nil
- file_coop_drivers_dispatch_v1beta1_latlng_proto_depIdxs = nil
-}
diff --git a/internal/idl/coop/drivers/dispatch/v1beta1/latlng.pb.validate.go b/internal/idl/coop/drivers/dispatch/v1beta1/latlng.pb.validate.go
deleted file mode 100644
index d042841..0000000
--- a/internal/idl/coop/drivers/dispatch/v1beta1/latlng.pb.validate.go
+++ /dev/null
@@ -1,156 +0,0 @@
-// Code generated by protoc-gen-validate. DO NOT EDIT.
-// source: coop/drivers/dispatch/v1beta1/latlng.proto
-
-package v1beta1
-
-import (
- "bytes"
- "errors"
- "fmt"
- "net"
- "net/mail"
- "net/url"
- "regexp"
- "sort"
- "strings"
- "time"
- "unicode/utf8"
-
- "google.golang.org/protobuf/types/known/anypb"
-)
-
-// ensure the imports are used
-var (
- _ = bytes.MinRead
- _ = errors.New("")
- _ = fmt.Print
- _ = utf8.UTFMax
- _ = (*regexp.Regexp)(nil)
- _ = (*strings.Reader)(nil)
- _ = net.IPv4len
- _ = time.Duration(0)
- _ = (*url.URL)(nil)
- _ = (*mail.Address)(nil)
- _ = anypb.Any{}
- _ = sort.Sort
-)
-
-// Validate checks the field values on LatLng with the rules defined in the
-// proto definition for this message. If any rules are violated, the first
-// error encountered is returned, or nil if there are no violations.
-func (m *LatLng) Validate() error {
- return m.validate(false)
-}
-
-// ValidateAll checks the field values on LatLng with the rules defined in the
-// proto definition for this message. If any rules are violated, the result is
-// a list of violation errors wrapped in LatLngMultiError, or nil if none found.
-func (m *LatLng) ValidateAll() error {
- return m.validate(true)
-}
-
-func (m *LatLng) validate(all bool) error {
- if m == nil {
- return nil
- }
-
- var errors []error
-
- if val := m.GetLatitude(); val < -90 || val > 90 {
- err := LatLngValidationError{
- field: "Latitude",
- reason: "value must be inside range [-90, 90]",
- }
- if !all {
- return err
- }
- errors = append(errors, err)
- }
-
- if val := m.GetLongitude(); val < -180 || val > 180 {
- err := LatLngValidationError{
- field: "Longitude",
- reason: "value must be inside range [-180, 180]",
- }
- if !all {
- return err
- }
- errors = append(errors, err)
- }
-
- if len(errors) > 0 {
- return LatLngMultiError(errors)
- }
-
- return nil
-}
-
-// LatLngMultiError is an error wrapping multiple validation errors returned by
-// LatLng.ValidateAll() if the designated constraints aren't met.
-type LatLngMultiError []error
-
-// Error returns a concatenation of all the error messages it wraps.
-func (m LatLngMultiError) Error() string {
- var msgs []string
- for _, err := range m {
- msgs = append(msgs, err.Error())
- }
- return strings.Join(msgs, "; ")
-}
-
-// AllErrors returns a list of validation violation errors.
-func (m LatLngMultiError) AllErrors() []error { return m }
-
-// LatLngValidationError is the validation error returned by LatLng.Validate if
-// the designated constraints aren't met.
-type LatLngValidationError struct {
- field string
- reason string
- cause error
- key bool
-}
-
-// Field function returns field value.
-func (e LatLngValidationError) Field() string { return e.field }
-
-// Reason function returns reason value.
-func (e LatLngValidationError) Reason() string { return e.reason }
-
-// Cause function returns cause value.
-func (e LatLngValidationError) Cause() error { return e.cause }
-
-// Key function returns key value.
-func (e LatLngValidationError) Key() bool { return e.key }
-
-// ErrorName returns error name.
-func (e LatLngValidationError) ErrorName() string { return "LatLngValidationError" }
-
-// Error satisfies the builtin error interface
-func (e LatLngValidationError) Error() string {
- cause := ""
- if e.cause != nil {
- cause = fmt.Sprintf(" | caused by: %v", e.cause)
- }
-
- key := ""
- if e.key {
- key = "key for "
- }
-
- return fmt.Sprintf(
- "invalid %sLatLng.%s: %s%s",
- key,
- e.field,
- e.reason,
- cause)
-}
-
-var _ error = LatLngValidationError{}
-
-var _ interface {
- Field() string
- Reason() string
- Key() bool
- Cause() error
- ErrorName() string
-} = LatLngValidationError{}
diff --git a/internal/idl/coop/drivers/dispatch/v1beta1/trip.pb.go b/internal/idl/coop/drivers/dispatch/v1beta1/trip.pb.go
index bc92921..8f3eabf 100644
--- a/internal/idl/coop/drivers/dispatch/v1beta1/trip.pb.go
+++ b/internal/idl/coop/drivers/dispatch/v1beta1/trip.pb.go
@@ -8,6 +8,7 @@ package v1beta1
import (
_ "github.com/envoyproxy/protoc-gen-validate/validate"
+ latlng "google.golang.org/genproto/googleapis/type/latlng"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
@@ -29,7 +30,7 @@ type Trip struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// where
- PickupLocation *LatLng `protobuf:"bytes,2,opt,name=pickup_location,json=pickupLocation,proto3" json:"pickup_location,omitempty"`
+ PickupLocation *latlng.LatLng `protobuf:"bytes,2,opt,name=pickup_location,json=pickupLocation,proto3" json:"pickup_location,omitempty"`
// when
ScheduledFor *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=scheduled_for,json=scheduledFor,proto3" json:"scheduled_for,omitempty"`
// how much $$$
@@ -75,7 +76,7 @@ func (x *Trip) GetId() string {
return ""
}
-func (x *Trip) GetPickupLocation() *LatLng {
+func (x *Trip) GetPickupLocation() *latlng.LatLng {
if x != nil {
return x.PickupLocation
}
@@ -176,45 +177,43 @@ var file_coop_drivers_dispatch_v1beta1_trip_proto_rawDesc = []byte{
0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f,
0x74, 0x72, 0x69, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1d, 0x63, 0x6f, 0x6f, 0x70,
0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63,
- 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x2a, 0x63, 0x6f, 0x6f, 0x70, 0x2f,
- 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2f, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68,
- 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x6c, 0x61, 0x74, 0x6c, 0x6e, 0x67, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,
- 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65,
- 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
- 0x9f, 0x02, 0x0a, 0x04, 0x54, 0x72, 0x69, 0x70, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
- 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69,
- 0x64, 0x12, 0x58, 0x0a, 0x0f, 0x70, 0x69, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x6c, 0x6f, 0x63, 0x61,
- 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x63, 0x6f, 0x6f,
- 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74,
- 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x61, 0x74, 0x4c, 0x6e,
- 0x67, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0e, 0x70, 0x69, 0x63,
- 0x6b, 0x75, 0x70, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x49, 0x0a, 0x0d, 0x73,
- 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x5f, 0x66, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08,
- 0xfa, 0x42, 0x05, 0xb2, 0x01, 0x02, 0x08, 0x01, 0x52, 0x0c, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75,
- 0x6c, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x12, 0x59, 0x0a, 0x10, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74,
- 0x65, 0x64, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b,
- 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2e,
- 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31,
- 0x2e, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01,
- 0x52, 0x0f, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e,
- 0x74, 0x22, 0x7a, 0x0a, 0x05, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x12, 0x2d, 0x0a, 0x0d, 0x63, 0x75,
- 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
- 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0x98, 0x01, 0x03, 0x52, 0x0c, 0x63, 0x75, 0x72,
- 0x72, 0x65, 0x6e, 0x63, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x69,
- 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x12,
- 0x2c, 0x0a, 0x05, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x42, 0x16,
- 0xfa, 0x42, 0x13, 0x1a, 0x11, 0x18, 0xff, 0x93, 0xeb, 0xdc, 0x03, 0x28, 0x81, 0xec, 0x94, 0xa3,
- 0xfc, 0xff, 0xff, 0xff, 0xff, 0x01, 0x52, 0x05, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x42, 0x55, 0x5a,
- 0x53, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x65, 0x76, 0x69,
- 0x6e, 0x6d, 0x69, 0x63, 0x68, 0x61, 0x65, 0x6c, 0x63, 0x68, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69,
- 0x2d, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e,
- 0x61, 0x6c, 0x2f, 0x69, 0x64, 0x6c, 0x2f, 0x63, 0x6f, 0x6f, 0x70, 0x2f, 0x64, 0x72, 0x69, 0x76,
- 0x65, 0x72, 0x73, 0x2f, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2f, 0x76, 0x31, 0x62,
- 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73,
+ 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6c, 0x61, 0x74, 0x6c, 0x6e, 0x67, 0x2e, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76,
+ 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8d, 0x02,
+ 0x0a, 0x04, 0x54, 0x72, 0x69, 0x70, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12,
+ 0x46, 0x0a, 0x0f, 0x70, 0x69, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x4c, 0x61, 0x74, 0x4c, 0x6e, 0x67, 0x42, 0x08, 0xfa,
+ 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0e, 0x70, 0x69, 0x63, 0x6b, 0x75, 0x70, 0x4c,
+ 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x49, 0x0a, 0x0d, 0x73, 0x63, 0x68, 0x65, 0x64,
+ 0x75, 0x6c, 0x65, 0x64, 0x5f, 0x66, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a,
+ 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
+ 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xfa, 0x42, 0x05, 0xb2,
+ 0x01, 0x02, 0x08, 0x01, 0x52, 0x0c, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x46,
+ 0x6f, 0x72, 0x12, 0x59, 0x0a, 0x10, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x70,
+ 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63,
+ 0x6f, 0x6f, 0x70, 0x2e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x70,
+ 0x61, 0x74, 0x63, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x6e,
+ 0x65, 0x79, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0f, 0x65, 0x78,
+ 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x7a, 0x0a,
+ 0x05, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x12, 0x2d, 0x0a, 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e,
+ 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa,
+ 0x42, 0x05, 0x72, 0x03, 0x98, 0x01, 0x03, 0x52, 0x0c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63,
+ 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x2c, 0x0a, 0x05, 0x6e,
+ 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x42, 0x16, 0xfa, 0x42, 0x13, 0x1a,
+ 0x11, 0x18, 0xff, 0x93, 0xeb, 0xdc, 0x03, 0x28, 0x81, 0xec, 0x94, 0xa3, 0xfc, 0xff, 0xff, 0xff,
+ 0xff, 0x01, 0x52, 0x05, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x42, 0x55, 0x5a, 0x53, 0x67, 0x69, 0x74,
+ 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x65, 0x76, 0x69, 0x6e, 0x6d, 0x69, 0x63,
+ 0x68, 0x61, 0x65, 0x6c, 0x63, 0x68, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2d, 0x64, 0x69, 0x73,
+ 0x70, 0x61, 0x74, 0x63, 0x68, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69,
+ 0x64, 0x6c, 0x2f, 0x63, 0x6f, 0x6f, 0x70, 0x2f, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x73, 0x2f,
+ 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31,
+ 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -233,11 +232,11 @@ var file_coop_drivers_dispatch_v1beta1_trip_proto_msgTypes = make([]protoimpl.Me
var file_coop_drivers_dispatch_v1beta1_trip_proto_goTypes = []interface{}{
(*Trip)(nil), // 0: coop.drivers.dispatch.v1beta1.Trip
(*Money)(nil), // 1: coop.drivers.dispatch.v1beta1.Money
- (*LatLng)(nil), // 2: coop.drivers.dispatch.v1beta1.LatLng
+ (*latlng.LatLng)(nil), // 2: google.type.LatLng
(*timestamppb.Timestamp)(nil), // 3: google.protobuf.Timestamp
}
var file_coop_drivers_dispatch_v1beta1_trip_proto_depIdxs = []int32{
- 2, // 0: coop.drivers.dispatch.v1beta1.Trip.pickup_location:type_name -> coop.drivers.dispatch.v1beta1.LatLng
+ 2, // 0: coop.drivers.dispatch.v1beta1.Trip.pickup_location:type_name -> google.type.LatLng
3, // 1: coop.drivers.dispatch.v1beta1.Trip.scheduled_for:type_name -> google.protobuf.Timestamp
1, // 2: coop.drivers.dispatch.v1beta1.Trip.expected_payment:type_name -> coop.drivers.dispatch.v1beta1.Money
3, // [3:3] is the sub-list for method output_type
@@ -252,7 +251,6 @@ func file_coop_drivers_dispatch_v1beta1_trip_proto_init() {
if File_coop_drivers_dispatch_v1beta1_trip_proto != nil {
return
}
- file_coop_drivers_dispatch_v1beta1_latlng_proto_init()
if !protoimpl.UnsafeEnabled {
file_coop_drivers_dispatch_v1beta1_trip_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Trip); i {
diff --git a/internal/service/db/list_drivers.go b/internal/service/db/list_drivers.go
index c667bb4..c684b88 100644
--- a/internal/service/db/list_drivers.go
+++ b/internal/service/db/list_drivers.go
@@ -7,6 +7,7 @@ import (
"github.com/kevinmichaelchen/api-dispatch/internal/idl/coop/drivers/dispatch/v1beta1"
"github.com/kevinmichaelchen/api-dispatch/internal/models"
"github.com/volatiletech/sqlboiler/v4/queries/qm"
+ "google.golang.org/genproto/googleapis/type/latlng"
"google.golang.org/protobuf/types/known/timestamppb"
)
@@ -91,7 +92,7 @@ func driverLocationToProto(in *models.DriverLocation) *v1beta1.DriverLocation {
Id: in.ID,
DriverId: in.DriverID,
MostRecentHeartbeat: timestamppb.New(in.CreatedAt),
- CurrentLocation: &v1beta1.LatLng{
+ CurrentLocation: &latlng.LatLng{
Latitude: in.Latitude,
Longitude: in.Longitude,
},
diff --git a/internal/service/db/query.go b/internal/service/db/query.go
index 671b0a0..28b8541 100644
--- a/internal/service/db/query.go
+++ b/internal/service/db/query.go
@@ -4,11 +4,11 @@ import (
"context"
"fmt"
"github.com/friendsofgo/errors"
- "github.com/kevinmichaelchen/api-dispatch/internal/idl/coop/drivers/dispatch/v1beta1"
"github.com/kevinmichaelchen/api-dispatch/internal/models"
"github.com/kevinmichaelchen/api-dispatch/internal/service/h3"
"github.com/volatiletech/sqlboiler/v4/queries"
"go.opentelemetry.io/otel"
+ "google.golang.org/genproto/googleapis/type/latlng"
)
var (
@@ -32,7 +32,7 @@ type GetNearbyDriverLocationsOutput struct {
R10K2 models.DriverLocationSlice
}
-func (s *Store) GetNearbyDriverLocations(ctx context.Context, location *v1beta1.LatLng) (*GetNearbyDriverLocationsOutput, error) {
+func (s *Store) GetNearbyDriverLocations(ctx context.Context, location *latlng.LatLng) (*GetNearbyDriverLocationsOutput, error) {
tr := otel.Tracer("")
ctx, span := tr.Start(ctx, "GetNearbyDriverLocations")
defer span.End()
@@ -77,7 +77,7 @@ func (s *Store) GetNearbyDriverLocations(ctx context.Context, location *v1beta1.
}, nil
}
-func (s *Store) getNearbyDriverLocationsHelper(ctx context.Context, l *v1beta1.LatLng, res int, k int) (models.DriverLocationSlice, error) {
+func (s *Store) getNearbyDriverLocationsHelper(ctx context.Context, l *latlng.LatLng, res int, k int) (models.DriverLocationSlice, error) {
// TODO filter out offline drivers or busy (currently-on-a-trip) drivers
if k < 1 || k > 2 {
return nil, errUnsupportedKValue
@@ -115,7 +115,7 @@ type GetNearbyTripsOutput struct {
R10K2 models.TripSlice
}
-func (s *Store) GetNearbyTrips(ctx context.Context, location *v1beta1.LatLng) (*GetNearbyTripsOutput, error) {
+func (s *Store) GetNearbyTrips(ctx context.Context, location *latlng.LatLng) (*GetNearbyTripsOutput, error) {
tr := otel.Tracer("")
ctx, span := tr.Start(ctx, "GetNearbyTrips")
defer span.End()
@@ -161,7 +161,7 @@ func (s *Store) GetNearbyTrips(ctx context.Context, location *v1beta1.LatLng) (*
}
// TODO trips that are too far in the past (or in a terminal state) should be filtered out
-func (s *Store) getNearbyTripsHelper(ctx context.Context, l *v1beta1.LatLng, res int, k int) (models.TripSlice, error) {
+func (s *Store) getNearbyTripsHelper(ctx context.Context, l *latlng.LatLng, res int, k int) (models.TripSlice, error) {
if k < 1 || k > 2 {
return nil, errUnsupportedKValue
}
diff --git a/internal/service/dispatch.go b/internal/service/dispatch.go
index 5a0e1d1..07431d6 100644
--- a/internal/service/dispatch.go
+++ b/internal/service/dispatch.go
@@ -9,6 +9,7 @@ import (
"github.com/kevinmichaelchen/api-dispatch/pkg/maps"
"github.com/kevinmichaelchen/api-dispatch/pkg/maps/distance"
"go.uber.org/zap"
+ "google.golang.org/genproto/googleapis/type/latlng"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/durationpb"
@@ -70,7 +71,7 @@ func (s *Service) GetNearestDrivers(
if enrich {
// Enrich results (e.g., with distance/duration info, among other things)
- var driverLocations []*v1beta1.LatLng
+ var driverLocations []*latlng.LatLng
for _, result := range results {
driverLocations = append(driverLocations, result.GetLocation())
}
@@ -93,6 +94,12 @@ func (s *Service) GetNearestDrivers(
results = results[:req.GetLimit()]
}
+ var resultIDs []string
+ for _, e := range results {
+ resultIDs = append(resultIDs, e.GetDriver().GetDriverId())
+ }
+ logger.Info("Nearest drivers", zap.Strings("driverIDs", resultIDs))
+
return &v1beta1.GetNearestDriversResponse{
Results: results,
PickupAddress: pickupAddress,
@@ -142,7 +149,7 @@ func (s *Service) GetNearestTrips(
results = ranking.SortResultsByKRing(results)
// Enrich results (e.g., with distance/duration info, among other things)
- var pickupLocations []*v1beta1.LatLng
+ var pickupLocations []*latlng.LatLng
for _, result := range results {
pickupLocations = append(pickupLocations, result.GetLocation())
}
@@ -168,15 +175,15 @@ func (s *Service) GetNearestTrips(
func (s *Service) enrichNearbyDrivers(
ctx context.Context,
results []*v1beta1.SearchResult,
- driverLocations []*v1beta1.LatLng,
- pickupLocation *v1beta1.LatLng,
+ driverLocations []*latlng.LatLng,
+ pickupLocation *latlng.LatLng,
) (*distance.MatrixResponse, error) {
logger := ctxzap.Extract(ctx)
out, err := s.distanceSvc.BetweenPoints(ctx, distance.BetweenPointsInput{
// the driver location(s) is/are always the origin(s)
Origins: toLatLngs(driverLocations),
- Destinations: toLatLngs([]*v1beta1.LatLng{pickupLocation}),
+ Destinations: toLatLngs([]*latlng.LatLng{pickupLocation}),
})
if err != nil {
return nil, err
@@ -199,14 +206,14 @@ func (s *Service) enrichNearbyDrivers(
func (s *Service) enrichNearbyTrips(
ctx context.Context,
results []*v1beta1.SearchResult,
- driverLocation *v1beta1.LatLng,
- pickupLocations []*v1beta1.LatLng,
+ driverLocation *latlng.LatLng,
+ pickupLocations []*latlng.LatLng,
) (*distance.MatrixResponse, error) {
logger := ctxzap.Extract(ctx)
out, err := s.distanceSvc.BetweenPoints(ctx, distance.BetweenPointsInput{
// the driver location(s) is/are always the origin(s)
- Origins: toLatLngs([]*v1beta1.LatLng{driverLocation}),
+ Origins: toLatLngs([]*latlng.LatLng{driverLocation}),
Destinations: toLatLngs(pickupLocations),
})
if err != nil {
@@ -247,7 +254,7 @@ func randomMoney() *v1beta1.Money {
return money.ConvertFloatToMoney(f)
}
-func toLatLngs(in []*v1beta1.LatLng) []maps.LatLng {
+func toLatLngs(in []*latlng.LatLng) []maps.LatLng {
var out []maps.LatLng
for _, e := range in {
out = append(out, maps.LatLng{
diff --git a/internal/service/h3/h3.go b/internal/service/h3/h3.go
index b85c97a..489aef5 100644
--- a/internal/service/h3/h3.go
+++ b/internal/service/h3/h3.go
@@ -1,9 +1,9 @@
package h3
import (
- "github.com/kevinmichaelchen/api-dispatch/internal/idl/coop/drivers/dispatch/v1beta1"
"github.com/uber/h3-go"
"github.com/volatiletech/sqlboiler/v4/types"
+ "google.golang.org/genproto/googleapis/type/latlng"
)
// GetCell indexes the location at the specified resolution, returning the index
@@ -12,7 +12,7 @@ import (
// https://h3geo.org/docs/core-library/geoToH3desc
//
// https://h3geo.org/docs/api/indexing#geotoh3
-func GetCell(l *v1beta1.LatLng, res int) string {
+func GetCell(l *latlng.LatLng, res int) string {
i := h3.FromGeo(h3.GeoCoord{
Latitude: l.GetLatitude(),
Longitude: l.GetLongitude(),
@@ -25,7 +25,7 @@ func GetCell(l *v1beta1.LatLng, res int) string {
// k-ring 1 is defined as k-ring 0 and all neighboring indices, and so on.
//
// https://h3geo.org/docs/api/traversal#kring
-func CellNeighbors(l *v1beta1.LatLng, res int, k int) types.StringArray {
+func CellNeighbors(l *latlng.LatLng, res int, k int) types.StringArray {
i := h3.FromGeo(h3.GeoCoord{
Latitude: l.GetLatitude(),
Longitude: l.GetLongitude(),
@@ -41,7 +41,7 @@ func CellNeighbors(l *v1beta1.LatLng, res int, k int) types.StringArray {
// PointDistance returns the "great circle" or "haversine" distance between
// pairs of GeoCoord points (lat/lng pairs) in meters.
// https://h3geo.org/docs/api/misc/#pointdistm
-func PointDistance(l1, l2 *v1beta1.LatLng) float64 {
+func PointDistance(l1, l2 *latlng.LatLng) float64 {
// TODO can't find this on the h3-go SDK
return 0
}
diff --git a/internal/service/merge.go b/internal/service/merge.go
index 1e20533..1267bcd 100644
--- a/internal/service/merge.go
+++ b/internal/service/merge.go
@@ -5,6 +5,7 @@ import (
"github.com/kevinmichaelchen/api-dispatch/internal/models"
"github.com/kevinmichaelchen/api-dispatch/internal/service/h3"
"github.com/kevinmichaelchen/api-dispatch/internal/service/money"
+ "google.golang.org/genproto/googleapis/type/latlng"
"google.golang.org/protobuf/types/known/timestamppb"
)
@@ -14,7 +15,7 @@ type MergeDriversInput struct {
KValue int
}
-func MergeDrivers(location *v1beta1.LatLng, in ...MergeDriversInput) []*v1beta1.SearchResult {
+func MergeDrivers(location *latlng.LatLng, in ...MergeDriversInput) []*v1beta1.SearchResult {
cache := make(map[string]*v1beta1.SearchResult)
for _, mi := range in {
for _, dl := range mi.Drivers {
@@ -34,7 +35,7 @@ func MergeDrivers(location *v1beta1.LatLng, in ...MergeDriversInput) []*v1beta1.
}
}
}
- latLng := &v1beta1.LatLng{
+ latLng := &latlng.LatLng{
Latitude: dl.Latitude,
Longitude: dl.Longitude,
}
@@ -67,7 +68,7 @@ type MergeTripsInput struct {
kValue int
}
-func MergeTrips(location *v1beta1.LatLng, in ...MergeTripsInput) []*v1beta1.SearchResult {
+func MergeTrips(location *latlng.LatLng, in ...MergeTripsInput) []*v1beta1.SearchResult {
cache := make(map[string]*v1beta1.SearchResult)
for _, mi := range in {
for _, e := range mi.trips {
@@ -87,7 +88,7 @@ func MergeTrips(location *v1beta1.LatLng, in ...MergeTripsInput) []*v1beta1.Sear
}
}
}
- latLng := &v1beta1.LatLng{
+ latLng := &latlng.LatLng{
Latitude: e.Latitude,
Longitude: e.Longitude,
}
diff --git a/internal/service/ranking/rank_trips_test.go b/internal/service/ranking/rank_trips_test.go
index 958bb07..0ed874f 100644
--- a/internal/service/ranking/rank_trips_test.go
+++ b/internal/service/ranking/rank_trips_test.go
@@ -3,6 +3,7 @@ package ranking
import (
"github.com/kevinmichaelchen/api-dispatch/internal/idl/coop/drivers/dispatch/v1beta1"
"github.com/stretchr/testify/require"
+ "google.golang.org/genproto/googleapis/type/latlng"
"google.golang.org/protobuf/types/known/durationpb"
"google.golang.org/protobuf/types/known/timestamppb"
"testing"
@@ -44,7 +45,7 @@ func newSearchResult(timeUntilTripStart time.Duration, timeForDriverToArrive tim
},
DistanceMeters: 100,
Duration: durationpb.New(timeForDriverToArrive),
- Location: &v1beta1.LatLng{
+ Location: &latlng.LatLng{
Latitude: 10,
Longitude: 10,
},
diff --git a/internal/service/service.go b/internal/service/service.go
index 254ee70..c5c8808 100644
--- a/internal/service/service.go
+++ b/internal/service/service.go
@@ -6,10 +6,7 @@ import (
"github.com/kevinmichaelchen/api-dispatch/internal/service/db"
"github.com/kevinmichaelchen/api-dispatch/internal/service/geo"
"github.com/kevinmichaelchen/api-dispatch/internal/service/health"
- "google.golang.org/grpc/codes"
healthV1 "google.golang.org/grpc/health/grpc_health_v1"
- "google.golang.org/grpc/status"
- "google.golang.org/protobuf/proto"
)
type Service struct {
@@ -21,19 +18,6 @@ func NewService(dataStore *db.Store, distanceSvc *geo.Service) *Service {
return &Service{dataStore: dataStore, distanceSvc: distanceSvc}
}
-type Validater interface {
- Validate() error
-}
-
-func validate(m proto.Message, r Validater) error {
- //name := m.ProtoReflect().Type().Descriptor().Name()
- err := r.Validate()
- if err != nil {
- return status.Error(codes.InvalidArgument, err.Error())
- }
- return nil
-}
-
func (s *Service) ListDrivers(ctx context.Context, r *v1beta1.ListDriversRequest) (*v1beta1.ListDriversResponse, error) {
err := validate(r, r)
if err != nil {
diff --git a/internal/service/validate.go b/internal/service/validate.go
new file mode 100644
index 0000000..1ac0697
--- /dev/null
+++ b/internal/service/validate.go
@@ -0,0 +1,54 @@
+package service
+
+import (
+ "fmt"
+ validation "github.com/go-ozzo/ozzo-validation/v4"
+ "github.com/kevinmichaelchen/api-dispatch/internal/idl/coop/drivers/dispatch/v1beta1"
+ "google.golang.org/genproto/googleapis/type/latlng"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/grpc/status"
+ "google.golang.org/protobuf/proto"
+)
+
+type Validater interface {
+ Validate() error
+}
+
+func validateLatLng(value interface{}) error {
+ l, ok := value.(*latlng.LatLng)
+ if !ok {
+ return fmt.Errorf("expected *latlng.LatLng, but received %T", l)
+ }
+ return validation.ValidateStruct(l,
+ validation.Field(&l.Latitude,
+ validation.Min(float64(-90)),
+ validation.Max(float64(90)),
+ ),
+ validation.Field(&l.Longitude,
+ validation.Min(float64(-180)),
+ validation.Max(float64(180)),
+ ),
+ )
+}
+
+func validateGetNearestDriversRequest(r *v1beta1.GetNearestDriversRequest) error {
+ err := r.Validate()
+ if err != nil {
+ return err
+ }
+ return validation.Errors{
+ "PickupLocation": validation.Validate(
+ r.GetPickupLocation(),
+ validation.By(validateLatLng),
+ ),
+ }.Filter()
+}
+
+func validate(m proto.Message, r Validater) error {
+ //name := m.ProtoReflect().Type().Descriptor().Name()
+ err := r.Validate()
+ if err != nil {
+ return status.Error(codes.InvalidArgument, err.Error())
+ }
+ return nil
+}
diff --git a/internal/service/validator_test.go b/internal/service/validate_test.go
similarity index 72%
rename from internal/service/validator_test.go
rename to internal/service/validate_test.go
index 7c8d8eb..f7a730c 100644
--- a/internal/service/validator_test.go
+++ b/internal/service/validate_test.go
@@ -3,13 +3,14 @@ package service
import (
"github.com/kevinmichaelchen/api-dispatch/internal/idl/coop/drivers/dispatch/v1beta1"
"github.com/stretchr/testify/require"
+ "google.golang.org/genproto/googleapis/type/latlng"
"testing"
)
func Test_validateGetNearestDriversRequest(t *testing.T) {
buildValid := func() *v1beta1.GetNearestDriversRequest {
return &v1beta1.GetNearestDriversRequest{
- PickupLocation: &v1beta1.LatLng{
+ PickupLocation: &latlng.LatLng{
Latitude: 40.2,
Longitude: -73.3,
},
@@ -53,7 +54,7 @@ func Test_validateGetNearestDriversRequest(t *testing.T) {
return p
},
expect: func(t *testing.T, err error) {
- require.EqualError(t, err, `invalid GetNearestDriversRequest.PickupLocation: embedded message failed validation | caused by: invalid LatLng.Latitude: value must be inside range [-90, 90]`)
+ require.EqualError(t, err, `PickupLocation: (latitude: must be no less than -90.).`)
},
},
"Latitude too high": {
@@ -63,7 +64,7 @@ func Test_validateGetNearestDriversRequest(t *testing.T) {
return p
},
expect: func(t *testing.T, err error) {
- require.EqualError(t, err, `invalid GetNearestDriversRequest.PickupLocation: embedded message failed validation | caused by: invalid LatLng.Latitude: value must be inside range [-90, 90]`)
+ require.EqualError(t, err, `PickupLocation: (latitude: must be no greater than 90.).`)
},
},
"Longitude too low": {
@@ -73,7 +74,7 @@ func Test_validateGetNearestDriversRequest(t *testing.T) {
return p
},
expect: func(t *testing.T, err error) {
- require.EqualError(t, err, `invalid GetNearestDriversRequest.PickupLocation: embedded message failed validation | caused by: invalid LatLng.Longitude: value must be inside range [-180, 180]`)
+ require.EqualError(t, err, `PickupLocation: (longitude: must be no less than -180.).`)
},
},
"Longitude too high": {
@@ -83,14 +84,14 @@ func Test_validateGetNearestDriversRequest(t *testing.T) {
return p
},
expect: func(t *testing.T, err error) {
- require.EqualError(t, err, `invalid GetNearestDriversRequest.PickupLocation: embedded message failed validation | caused by: invalid LatLng.Longitude: value must be inside range [-180, 180]`)
+ require.EqualError(t, err, `PickupLocation: (longitude: must be no greater than 180.).`)
},
},
}
for testName, tc := range cases {
t.Run(testName, func(t *testing.T) {
r := tc.build()
- err := r.Validate()
+ err := validateGetNearestDriversRequest(r)
tc.expect(t, err)
})
}