From bbb435a7d9202aba0f57facbfa8cf67cf6768047 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Tue, 15 Feb 2022 15:12:14 +0000 Subject: [PATCH] autocomplete coming soon --- place/examples.json | 8 ++ place/handler/google.go | 4 + place/proto/place.pb.go | 241 +++++++++++++++++++++++++--------- place/proto/place.pb.micro.go | 17 +++ place/proto/place.proto | 6 + place/publicapi.json | 1 + 6 files changed, 213 insertions(+), 64 deletions(-) diff --git a/place/examples.json b/place/examples.json index 4dfc890..c6d6380 100644 --- a/place/examples.json +++ b/place/examples.json @@ -1,4 +1,12 @@ { + "autocomplete": [{ + "title": "Autocomplete queries", + "description": "Autocomplete queries for places", + "run_check": false, + "request": {} + }, + "response": {} + }], "nearby": [{ "title": "Find places nearby", "description": "Find places and points of interest nearby", diff --git a/place/handler/google.go b/place/handler/google.go index 3c5c269..b770607 100644 --- a/place/handler/google.go +++ b/place/handler/google.go @@ -43,6 +43,10 @@ func NewGoogle() *Google { } } +func (g *Google) Autocomplete(ctx context.Context, req *pb.AutocompleteRequest, rsp *pb.AutocompleteResponse) error { + return errors.BadRequest("place.autocomplete", "coming soon") +} + func (g *Google) Nearby(ctx context.Context, req *pb.NearbyRequest, rsp *pb.NearbyResponse) error { greq := &maps.NearbySearchRequest{} diff --git a/place/proto/place.pb.go b/place/proto/place.pb.go index 424af6a..f23565e 100644 --- a/place/proto/place.pb.go +++ b/place/proto/place.pb.go @@ -149,6 +149,83 @@ func (x *Result) GetTypes() []string { return nil } +// Autocomplete queries (coming soon) +type AutocompleteRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *AutocompleteRequest) Reset() { + *x = AutocompleteRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_place_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AutocompleteRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AutocompleteRequest) ProtoMessage() {} + +func (x *AutocompleteRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_place_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 AutocompleteRequest.ProtoReflect.Descriptor instead. +func (*AutocompleteRequest) Descriptor() ([]byte, []int) { + return file_proto_place_proto_rawDescGZIP(), []int{1} +} + +type AutocompleteResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *AutocompleteResponse) Reset() { + *x = AutocompleteResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_place_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AutocompleteResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AutocompleteResponse) ProtoMessage() {} + +func (x *AutocompleteResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_place_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 AutocompleteResponse.ProtoReflect.Descriptor instead. +func (*AutocompleteResponse) Descriptor() ([]byte, []int) { + return file_proto_place_proto_rawDescGZIP(), []int{2} +} + // Search for places nearby, points of interest and geographic locations type NearbyRequest struct { state protoimpl.MessageState @@ -172,7 +249,7 @@ type NearbyRequest struct { func (x *NearbyRequest) Reset() { *x = NearbyRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_place_proto_msgTypes[1] + mi := &file_proto_place_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -185,7 +262,7 @@ func (x *NearbyRequest) String() string { func (*NearbyRequest) ProtoMessage() {} func (x *NearbyRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_place_proto_msgTypes[1] + mi := &file_proto_place_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -198,7 +275,7 @@ func (x *NearbyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use NearbyRequest.ProtoReflect.Descriptor instead. func (*NearbyRequest) Descriptor() ([]byte, []int) { - return file_proto_place_proto_rawDescGZIP(), []int{1} + return file_proto_place_proto_rawDescGZIP(), []int{3} } func (x *NearbyRequest) GetLocation() string { @@ -254,7 +331,7 @@ type NearbyResponse struct { func (x *NearbyResponse) Reset() { *x = NearbyResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_place_proto_msgTypes[2] + mi := &file_proto_place_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -267,7 +344,7 @@ func (x *NearbyResponse) String() string { func (*NearbyResponse) ProtoMessage() {} func (x *NearbyResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_place_proto_msgTypes[2] + mi := &file_proto_place_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -280,7 +357,7 @@ func (x *NearbyResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use NearbyResponse.ProtoReflect.Descriptor instead. func (*NearbyResponse) Descriptor() ([]byte, []int) { - return file_proto_place_proto_rawDescGZIP(), []int{2} + return file_proto_place_proto_rawDescGZIP(), []int{4} } func (x *NearbyResponse) GetResults() []*Result { @@ -310,7 +387,7 @@ type SearchRequest struct { func (x *SearchRequest) Reset() { *x = SearchRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_place_proto_msgTypes[3] + mi := &file_proto_place_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -323,7 +400,7 @@ func (x *SearchRequest) String() string { func (*SearchRequest) ProtoMessage() {} func (x *SearchRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_place_proto_msgTypes[3] + mi := &file_proto_place_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -336,7 +413,7 @@ func (x *SearchRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead. func (*SearchRequest) Descriptor() ([]byte, []int) { - return file_proto_place_proto_rawDescGZIP(), []int{3} + return file_proto_place_proto_rawDescGZIP(), []int{5} } func (x *SearchRequest) GetQuery() string { @@ -385,7 +462,7 @@ type SearchResponse struct { func (x *SearchResponse) Reset() { *x = SearchResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_place_proto_msgTypes[4] + mi := &file_proto_place_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -398,7 +475,7 @@ func (x *SearchResponse) String() string { func (*SearchResponse) ProtoMessage() {} func (x *SearchResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_place_proto_msgTypes[4] + mi := &file_proto_place_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -411,7 +488,7 @@ func (x *SearchResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SearchResponse.ProtoReflect.Descriptor instead. func (*SearchResponse) Descriptor() ([]byte, []int) { - return file_proto_place_proto_rawDescGZIP(), []int{4} + return file_proto_place_proto_rawDescGZIP(), []int{6} } func (x *SearchResponse) GetResults() []*Result { @@ -442,42 +519,50 @@ var file_proto_place_proto_rawDesc = []byte{ 0x67, 0x48, 0x6f, 0x75, 0x72, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x76, 0x69, 0x63, 0x69, 0x6e, 0x69, 0x74, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, 0x69, 0x63, 0x69, 0x6e, 0x69, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x22, 0xa0, 0x01, 0x0a, 0x0d, 0x4e, 0x65, 0x61, - 0x72, 0x62, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x61, 0x64, 0x69, 0x75, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x72, 0x61, 0x64, 0x69, 0x75, 0x73, 0x12, 0x18, - 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, - 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x6e, 0x6f, 0x77, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, - 0x6f, 0x70, 0x65, 0x6e, 0x4e, 0x6f, 0x77, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x39, 0x0a, 0x0e, 0x4e, - 0x65, 0x61, 0x72, 0x62, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, - 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, - 0x2e, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x88, 0x01, 0x0a, 0x0d, 0x53, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x1a, - 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x61, - 0x64, 0x69, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x72, 0x61, 0x64, 0x69, - 0x75, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x6e, 0x6f, 0x77, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x6f, 0x70, 0x65, 0x6e, 0x4e, 0x6f, 0x77, 0x12, 0x12, 0x0a, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x22, 0x39, 0x0a, 0x0e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x32, 0x79, 0x0a, 0x05, - 0x50, 0x6c, 0x61, 0x63, 0x65, 0x12, 0x37, 0x0a, 0x06, 0x4e, 0x65, 0x61, 0x72, 0x62, 0x79, 0x12, - 0x14, 0x2e, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x4e, 0x65, 0x61, 0x72, 0x62, 0x79, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x4e, 0x65, - 0x61, 0x72, 0x62, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x37, - 0x0a, 0x06, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x14, 0x2e, 0x70, 0x6c, 0x61, 0x63, 0x65, - 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, - 0x2e, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x0f, 0x5a, 0x0d, 0x2e, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x3b, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x09, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x22, 0x15, 0x0a, 0x13, 0x41, 0x75, 0x74, 0x6f, + 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, + 0x16, 0x0a, 0x14, 0x41, 0x75, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xa0, 0x01, 0x0a, 0x0d, 0x4e, 0x65, 0x61, 0x72, + 0x62, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x61, 0x64, 0x69, 0x75, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x72, 0x61, 0x64, 0x69, 0x75, 0x73, 0x12, 0x18, 0x0a, + 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6f, + 0x70, 0x65, 0x6e, 0x5f, 0x6e, 0x6f, 0x77, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x6f, + 0x70, 0x65, 0x6e, 0x4e, 0x6f, 0x77, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x39, 0x0a, 0x0e, 0x4e, 0x65, + 0x61, 0x72, 0x62, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x07, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, + 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x88, 0x01, 0x0a, 0x0d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x1a, 0x0a, + 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x61, 0x64, + 0x69, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x72, 0x61, 0x64, 0x69, 0x75, + 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x6e, 0x6f, 0x77, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x07, 0x6f, 0x70, 0x65, 0x6e, 0x4e, 0x6f, 0x77, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x22, 0x39, 0x0a, 0x0e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x27, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x32, 0xc4, 0x01, 0x0a, 0x05, + 0x50, 0x6c, 0x61, 0x63, 0x65, 0x12, 0x49, 0x0a, 0x0c, 0x41, 0x75, 0x74, 0x6f, 0x63, 0x6f, 0x6d, + 0x70, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1a, 0x2e, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x41, 0x75, + 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1b, 0x2e, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x63, 0x6f, + 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x37, 0x0a, 0x06, 0x4e, 0x65, 0x61, 0x72, 0x62, 0x79, 0x12, 0x14, 0x2e, 0x70, 0x6c, 0x61, + 0x63, 0x65, 0x2e, 0x4e, 0x65, 0x61, 0x72, 0x62, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x15, 0x2e, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x4e, 0x65, 0x61, 0x72, 0x62, 0x79, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x37, 0x0a, 0x06, 0x53, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x12, 0x14, 0x2e, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2e, 0x53, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x6c, 0x61, 0x63, + 0x65, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x42, 0x0f, 0x5a, 0x0d, 0x2e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, 0x70, 0x6c, + 0x61, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -492,23 +577,27 @@ func file_proto_place_proto_rawDescGZIP() []byte { return file_proto_place_proto_rawDescData } -var file_proto_place_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_proto_place_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_proto_place_proto_goTypes = []interface{}{ - (*Result)(nil), // 0: place.Result - (*NearbyRequest)(nil), // 1: place.NearbyRequest - (*NearbyResponse)(nil), // 2: place.NearbyResponse - (*SearchRequest)(nil), // 3: place.SearchRequest - (*SearchResponse)(nil), // 4: place.SearchResponse + (*Result)(nil), // 0: place.Result + (*AutocompleteRequest)(nil), // 1: place.AutocompleteRequest + (*AutocompleteResponse)(nil), // 2: place.AutocompleteResponse + (*NearbyRequest)(nil), // 3: place.NearbyRequest + (*NearbyResponse)(nil), // 4: place.NearbyResponse + (*SearchRequest)(nil), // 5: place.SearchRequest + (*SearchResponse)(nil), // 6: place.SearchResponse } var file_proto_place_proto_depIdxs = []int32{ 0, // 0: place.NearbyResponse.results:type_name -> place.Result 0, // 1: place.SearchResponse.results:type_name -> place.Result - 1, // 2: place.Place.Nearby:input_type -> place.NearbyRequest - 3, // 3: place.Place.Search:input_type -> place.SearchRequest - 2, // 4: place.Place.Nearby:output_type -> place.NearbyResponse - 4, // 5: place.Place.Search:output_type -> place.SearchResponse - 4, // [4:6] is the sub-list for method output_type - 2, // [2:4] is the sub-list for method input_type + 1, // 2: place.Place.Autocomplete:input_type -> place.AutocompleteRequest + 3, // 3: place.Place.Nearby:input_type -> place.NearbyRequest + 5, // 4: place.Place.Search:input_type -> place.SearchRequest + 2, // 5: place.Place.Autocomplete:output_type -> place.AutocompleteResponse + 4, // 6: place.Place.Nearby:output_type -> place.NearbyResponse + 6, // 7: place.Place.Search:output_type -> place.SearchResponse + 5, // [5:8] is the sub-list for method output_type + 2, // [2:5] 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 @@ -533,7 +622,7 @@ func file_proto_place_proto_init() { } } file_proto_place_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NearbyRequest); i { + switch v := v.(*AutocompleteRequest); i { case 0: return &v.state case 1: @@ -545,7 +634,7 @@ func file_proto_place_proto_init() { } } file_proto_place_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NearbyResponse); i { + switch v := v.(*AutocompleteResponse); i { case 0: return &v.state case 1: @@ -557,7 +646,7 @@ func file_proto_place_proto_init() { } } file_proto_place_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchRequest); i { + switch v := v.(*NearbyRequest); i { case 0: return &v.state case 1: @@ -569,6 +658,30 @@ func file_proto_place_proto_init() { } } file_proto_place_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NearbyResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_place_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_place_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SearchResponse); i { case 0: return &v.state @@ -587,7 +700,7 @@ func file_proto_place_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_place_proto_rawDesc, NumEnums: 0, - NumMessages: 5, + NumMessages: 7, NumExtensions: 0, NumServices: 1, }, diff --git a/place/proto/place.pb.micro.go b/place/proto/place.pb.micro.go index 17b3db4..cc8c10e 100644 --- a/place/proto/place.pb.micro.go +++ b/place/proto/place.pb.micro.go @@ -42,6 +42,7 @@ func NewPlaceEndpoints() []*api.Endpoint { // Client API for Place service type PlaceService interface { + Autocomplete(ctx context.Context, in *AutocompleteRequest, opts ...client.CallOption) (*AutocompleteResponse, error) Nearby(ctx context.Context, in *NearbyRequest, opts ...client.CallOption) (*NearbyResponse, error) Search(ctx context.Context, in *SearchRequest, opts ...client.CallOption) (*SearchResponse, error) } @@ -58,6 +59,16 @@ func NewPlaceService(name string, c client.Client) PlaceService { } } +func (c *placeService) Autocomplete(ctx context.Context, in *AutocompleteRequest, opts ...client.CallOption) (*AutocompleteResponse, error) { + req := c.c.NewRequest(c.name, "Place.Autocomplete", in) + out := new(AutocompleteResponse) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *placeService) Nearby(ctx context.Context, in *NearbyRequest, opts ...client.CallOption) (*NearbyResponse, error) { req := c.c.NewRequest(c.name, "Place.Nearby", in) out := new(NearbyResponse) @@ -81,12 +92,14 @@ func (c *placeService) Search(ctx context.Context, in *SearchRequest, opts ...cl // Server API for Place service type PlaceHandler interface { + Autocomplete(context.Context, *AutocompleteRequest, *AutocompleteResponse) error Nearby(context.Context, *NearbyRequest, *NearbyResponse) error Search(context.Context, *SearchRequest, *SearchResponse) error } func RegisterPlaceHandler(s server.Server, hdlr PlaceHandler, opts ...server.HandlerOption) error { type place interface { + Autocomplete(ctx context.Context, in *AutocompleteRequest, out *AutocompleteResponse) error Nearby(ctx context.Context, in *NearbyRequest, out *NearbyResponse) error Search(ctx context.Context, in *SearchRequest, out *SearchResponse) error } @@ -101,6 +114,10 @@ type placeHandler struct { PlaceHandler } +func (h *placeHandler) Autocomplete(ctx context.Context, in *AutocompleteRequest, out *AutocompleteResponse) error { + return h.PlaceHandler.Autocomplete(ctx, in, out) +} + func (h *placeHandler) Nearby(ctx context.Context, in *NearbyRequest, out *NearbyResponse) error { return h.PlaceHandler.Nearby(ctx, in, out) } diff --git a/place/proto/place.proto b/place/proto/place.proto index bb67fba..d7581d4 100644 --- a/place/proto/place.proto +++ b/place/proto/place.proto @@ -5,6 +5,7 @@ package place; option go_package = "./proto;place"; service Place { + rpc Autocomplete(AutocompleteRequest) returns (AutocompleteResponse) {} rpc Nearby(NearbyRequest) returns (NearbyResponse) {} rpc Search(SearchRequest) returns (SearchResponse) {} } @@ -32,6 +33,11 @@ message Result { repeated string types = 10; } +// Autocomplete queries (coming soon) +message AutocompleteRequest {} + +message AutocompleteResponse {} + // Search for places nearby, points of interest and geographic locations message NearbyRequest { // specify the location by lat,lng e.g -33.8670522,-151.1957362 diff --git a/place/publicapi.json b/place/publicapi.json index b638a09..83164c6 100644 --- a/place/publicapi.json +++ b/place/publicapi.json @@ -4,6 +4,7 @@ "category": "utility", "display_name": "Places", "pricing": { + "Place.Autocomplete": 5000, "Place.Search": 20000, "Place.Nearby": 20000 }