forked from micro/micro
/
geo.pb.go
136 lines (111 loc) · 4.31 KB
/
geo.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
// Code generated by protoc-gen-go.
// source: srv/geo/proto/geo.proto
// DO NOT EDIT!
/*
Package geo is a generated protocol buffer package.
It is generated from these files:
srv/geo/proto/geo.proto
It has these top-level messages:
Request
Result
*/
package geo
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import (
client "github.com/micro/go-micro/client"
server "github.com/micro/go-micro/server"
context "golang.org/x/net/context"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
// The latitude and longitude of the current location.
type Request struct {
Lat float32 `protobuf:"fixed32,1,opt,name=lat" json:"lat,omitempty"`
Lon float32 `protobuf:"fixed32,2,opt,name=lon" json:"lon,omitempty"`
}
func (m *Request) Reset() { *m = Request{} }
func (m *Request) String() string { return proto.CompactTextString(m) }
func (*Request) ProtoMessage() {}
func (*Request) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
type Result struct {
HotelIds []string `protobuf:"bytes,1,rep,name=hotelIds" json:"hotelIds,omitempty"`
}
func (m *Result) Reset() { *m = Result{} }
func (m *Result) String() string { return proto.CompactTextString(m) }
func (*Result) ProtoMessage() {}
func (*Result) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
func init() {
proto.RegisterType((*Request)(nil), "geo.Request")
proto.RegisterType((*Result)(nil), "geo.Result")
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ client.Option
var _ server.Option
// Client API for Geo service
type GeoClient interface {
// Finds the hotels contained nearby the current lat/lon.
Nearby(ctx context.Context, in *Request, opts ...client.CallOption) (*Result, error)
}
type geoClient struct {
c client.Client
serviceName string
}
func NewGeoClient(serviceName string, c client.Client) GeoClient {
if c == nil {
c = client.NewClient()
}
if len(serviceName) == 0 {
serviceName = "geo"
}
return &geoClient{
c: c,
serviceName: serviceName,
}
}
func (c *geoClient) Nearby(ctx context.Context, in *Request, opts ...client.CallOption) (*Result, error) {
req := c.c.NewRequest(c.serviceName, "Geo.Nearby", in)
out := new(Result)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for Geo service
type GeoHandler interface {
// Finds the hotels contained nearby the current lat/lon.
Nearby(context.Context, *Request, *Result) error
}
func RegisterGeoHandler(s server.Server, hdlr GeoHandler, opts ...server.HandlerOption) {
s.Handle(s.NewHandler(&Geo{hdlr}, opts...))
}
type Geo struct {
GeoHandler
}
func (h *Geo) Nearby(ctx context.Context, in *Request, out *Result) error {
return h.GeoHandler.Nearby(ctx, in, out)
}
func init() { proto.RegisterFile("srv/geo/proto/geo.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 151 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x12, 0x2f, 0x2e, 0x2a, 0xd3,
0x4f, 0x4f, 0xcd, 0xd7, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x07, 0xb1, 0xf4, 0xc0, 0x2c, 0x21, 0xe6,
0xf4, 0xd4, 0x7c, 0x25, 0x5d, 0x2e, 0xf6, 0xa0, 0xd4, 0xc2, 0xd2, 0xd4, 0xe2, 0x12, 0x21, 0x01,
0x2e, 0xe6, 0x9c, 0xc4, 0x12, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xa6, 0x20, 0x10, 0x13, 0x2c, 0x92,
0x9f, 0x27, 0xc1, 0x04, 0x15, 0xc9, 0xcf, 0x53, 0x52, 0xe1, 0x62, 0x0b, 0x4a, 0x2d, 0x2e, 0xcd,
0x29, 0x11, 0x92, 0xe2, 0xe2, 0xc8, 0xc8, 0x2f, 0x49, 0xcd, 0xf1, 0x4c, 0x29, 0x96, 0x60, 0x54,
0x60, 0xd6, 0xe0, 0x0c, 0x82, 0xf3, 0x8d, 0xb4, 0xb8, 0x98, 0xdd, 0x53, 0xf3, 0x85, 0x94, 0xb9,
0xd8, 0xfc, 0x52, 0x13, 0x8b, 0x92, 0x2a, 0x85, 0x78, 0xf4, 0x40, 0xd6, 0x42, 0x2d, 0x92, 0xe2,
0x86, 0xf2, 0x40, 0xe6, 0x24, 0xb1, 0x81, 0x1d, 0x63, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x6f,
0xa0, 0xba, 0x03, 0xa7, 0x00, 0x00, 0x00,
}