-
Notifications
You must be signed in to change notification settings - Fork 3
/
discovery.pb.go
269 lines (227 loc) · 11.4 KB
/
discovery.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
// Code generated by protoc-gen-go.
// source: github.com/micro/discovery-srv/proto/discovery/discovery.proto
// DO NOT EDIT!
/*
Package go_micro_srv_discovery_discovery is a generated protocol buffer package.
It is generated from these files:
github.com/micro/discovery-srv/proto/discovery/discovery.proto
It has these top-level messages:
ServiceEndpoint
EndpointsRequest
EndpointsResponse
HeartbeatsRequest
HeartbeatsResponse
WatchResultsRequest
WatchResultsResponse
*/
package go_micro_srv_discovery_discovery
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import discovery "github.com/micro/go-platform/discovery/proto"
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.
const _ = proto.ProtoPackageIsVersion1
type ServiceEndpoint struct {
Service string `protobuf:"bytes,1,opt,name=service" json:"service,omitempty"`
Version string `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"`
Endpoint *discovery.Endpoint `protobuf:"bytes,3,opt,name=endpoint" json:"endpoint,omitempty"`
}
func (m *ServiceEndpoint) Reset() { *m = ServiceEndpoint{} }
func (m *ServiceEndpoint) String() string { return proto.CompactTextString(m) }
func (*ServiceEndpoint) ProtoMessage() {}
func (*ServiceEndpoint) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
func (m *ServiceEndpoint) GetEndpoint() *discovery.Endpoint {
if m != nil {
return m.Endpoint
}
return nil
}
type EndpointsRequest struct {
Service string `protobuf:"bytes,1,opt,name=service" json:"service,omitempty"`
Version string `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"`
Limit uint64 `protobuf:"varint,3,opt,name=limit" json:"limit,omitempty"`
Offset uint64 `protobuf:"varint,4,opt,name=offset" json:"offset,omitempty"`
}
func (m *EndpointsRequest) Reset() { *m = EndpointsRequest{} }
func (m *EndpointsRequest) String() string { return proto.CompactTextString(m) }
func (*EndpointsRequest) ProtoMessage() {}
func (*EndpointsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
type EndpointsResponse struct {
Endpoints []*ServiceEndpoint `protobuf:"bytes,1,rep,name=endpoints" json:"endpoints,omitempty"`
}
func (m *EndpointsResponse) Reset() { *m = EndpointsResponse{} }
func (m *EndpointsResponse) String() string { return proto.CompactTextString(m) }
func (*EndpointsResponse) ProtoMessage() {}
func (*EndpointsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
func (m *EndpointsResponse) GetEndpoints() []*ServiceEndpoint {
if m != nil {
return m.Endpoints
}
return nil
}
type HeartbeatsRequest struct {
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
After uint64 `protobuf:"varint,2,opt,name=after" json:"after,omitempty"`
Limit uint64 `protobuf:"varint,3,opt,name=limit" json:"limit,omitempty"`
Offset uint64 `protobuf:"varint,4,opt,name=offset" json:"offset,omitempty"`
}
func (m *HeartbeatsRequest) Reset() { *m = HeartbeatsRequest{} }
func (m *HeartbeatsRequest) String() string { return proto.CompactTextString(m) }
func (*HeartbeatsRequest) ProtoMessage() {}
func (*HeartbeatsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
type HeartbeatsResponse struct {
Heartbeats []*discovery.Heartbeat `protobuf:"bytes,1,rep,name=heartbeats" json:"heartbeats,omitempty"`
}
func (m *HeartbeatsResponse) Reset() { *m = HeartbeatsResponse{} }
func (m *HeartbeatsResponse) String() string { return proto.CompactTextString(m) }
func (*HeartbeatsResponse) ProtoMessage() {}
func (*HeartbeatsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
func (m *HeartbeatsResponse) GetHeartbeats() []*discovery.Heartbeat {
if m != nil {
return m.Heartbeats
}
return nil
}
type WatchResultsRequest struct {
Service string `protobuf:"bytes,1,opt,name=service" json:"service,omitempty"`
After uint64 `protobuf:"varint,2,opt,name=after" json:"after,omitempty"`
Limit uint64 `protobuf:"varint,3,opt,name=limit" json:"limit,omitempty"`
Offset uint64 `protobuf:"varint,4,opt,name=offset" json:"offset,omitempty"`
}
func (m *WatchResultsRequest) Reset() { *m = WatchResultsRequest{} }
func (m *WatchResultsRequest) String() string { return proto.CompactTextString(m) }
func (*WatchResultsRequest) ProtoMessage() {}
func (*WatchResultsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
type WatchResultsResponse struct {
Results []*discovery.Result `protobuf:"bytes,1,rep,name=results" json:"results,omitempty"`
}
func (m *WatchResultsResponse) Reset() { *m = WatchResultsResponse{} }
func (m *WatchResultsResponse) String() string { return proto.CompactTextString(m) }
func (*WatchResultsResponse) ProtoMessage() {}
func (*WatchResultsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
func (m *WatchResultsResponse) GetResults() []*discovery.Result {
if m != nil {
return m.Results
}
return nil
}
func init() {
proto.RegisterType((*ServiceEndpoint)(nil), "go.micro.srv.discovery.discovery.ServiceEndpoint")
proto.RegisterType((*EndpointsRequest)(nil), "go.micro.srv.discovery.discovery.EndpointsRequest")
proto.RegisterType((*EndpointsResponse)(nil), "go.micro.srv.discovery.discovery.EndpointsResponse")
proto.RegisterType((*HeartbeatsRequest)(nil), "go.micro.srv.discovery.discovery.HeartbeatsRequest")
proto.RegisterType((*HeartbeatsResponse)(nil), "go.micro.srv.discovery.discovery.HeartbeatsResponse")
proto.RegisterType((*WatchResultsRequest)(nil), "go.micro.srv.discovery.discovery.WatchResultsRequest")
proto.RegisterType((*WatchResultsResponse)(nil), "go.micro.srv.discovery.discovery.WatchResultsResponse")
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ client.Option
var _ server.Option
// Client API for Discovery service
type DiscoveryClient interface {
Endpoints(ctx context.Context, in *EndpointsRequest, opts ...client.CallOption) (*EndpointsResponse, error)
Heartbeats(ctx context.Context, in *HeartbeatsRequest, opts ...client.CallOption) (*HeartbeatsResponse, error)
WatchResults(ctx context.Context, in *WatchResultsRequest, opts ...client.CallOption) (*WatchResultsResponse, error)
}
type discoveryClient struct {
c client.Client
serviceName string
}
func NewDiscoveryClient(serviceName string, c client.Client) DiscoveryClient {
if c == nil {
c = client.NewClient()
}
if len(serviceName) == 0 {
serviceName = "go.micro.srv.discovery.discovery"
}
return &discoveryClient{
c: c,
serviceName: serviceName,
}
}
func (c *discoveryClient) Endpoints(ctx context.Context, in *EndpointsRequest, opts ...client.CallOption) (*EndpointsResponse, error) {
req := c.c.NewRequest(c.serviceName, "Discovery.Endpoints", in)
out := new(EndpointsResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *discoveryClient) Heartbeats(ctx context.Context, in *HeartbeatsRequest, opts ...client.CallOption) (*HeartbeatsResponse, error) {
req := c.c.NewRequest(c.serviceName, "Discovery.Heartbeats", in)
out := new(HeartbeatsResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *discoveryClient) WatchResults(ctx context.Context, in *WatchResultsRequest, opts ...client.CallOption) (*WatchResultsResponse, error) {
req := c.c.NewRequest(c.serviceName, "Discovery.WatchResults", in)
out := new(WatchResultsResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for Discovery service
type DiscoveryHandler interface {
Endpoints(context.Context, *EndpointsRequest, *EndpointsResponse) error
Heartbeats(context.Context, *HeartbeatsRequest, *HeartbeatsResponse) error
WatchResults(context.Context, *WatchResultsRequest, *WatchResultsResponse) error
}
func RegisterDiscoveryHandler(s server.Server, hdlr DiscoveryHandler) {
s.Handle(s.NewHandler(&Discovery{hdlr}))
}
type Discovery struct {
DiscoveryHandler
}
func (h *Discovery) Endpoints(ctx context.Context, in *EndpointsRequest, out *EndpointsResponse) error {
return h.DiscoveryHandler.Endpoints(ctx, in, out)
}
func (h *Discovery) Heartbeats(ctx context.Context, in *HeartbeatsRequest, out *HeartbeatsResponse) error {
return h.DiscoveryHandler.Heartbeats(ctx, in, out)
}
func (h *Discovery) WatchResults(ctx context.Context, in *WatchResultsRequest, out *WatchResultsResponse) error {
return h.DiscoveryHandler.WatchResults(ctx, in, out)
}
var fileDescriptor0 = []byte{
// 379 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x94, 0x93, 0xcd, 0x4f, 0xc2, 0x30,
0x18, 0xc6, 0xe5, 0x43, 0x70, 0xaf, 0x1f, 0x48, 0xf5, 0xb0, 0xcc, 0xc4, 0x90, 0x9d, 0xbc, 0x50,
0x14, 0xd0, 0x93, 0xf1, 0x84, 0x89, 0x17, 0x13, 0x23, 0x26, 0xc6, 0xe3, 0x18, 0x1d, 0x34, 0x61,
0xeb, 0x6c, 0xcb, 0x12, 0x4e, 0x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