github.com/kaisenlinux/docker.io@v0.0.0-20230510090727-ea55db55fac7/swarmkit/protobuf/plugin/raftproxy/test/service.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: github.com/docker/swarmkit/protobuf/plugin/raftproxy/test/service.proto 3 4 package test 5 6 import ( 7 context "context" 8 fmt "fmt" 9 github_com_docker_swarmkit_api_deepcopy "github.com/docker/swarmkit/api/deepcopy" 10 raftselector "github.com/docker/swarmkit/manager/raftselector" 11 proto "github.com/gogo/protobuf/proto" 12 grpc "google.golang.org/grpc" 13 codes "google.golang.org/grpc/codes" 14 metadata "google.golang.org/grpc/metadata" 15 peer "google.golang.org/grpc/peer" 16 status "google.golang.org/grpc/status" 17 io "io" 18 math "math" 19 reflect "reflect" 20 strings "strings" 21 rafttime "time" 22 ) 23 24 // Reference imports to suppress errors if they are not otherwise used. 25 var _ = proto.Marshal 26 var _ = fmt.Errorf 27 var _ = math.Inf 28 29 // This is a compile-time assertion to ensure that this generated file 30 // is compatible with the proto package it is being compiled against. 31 // A compilation error at this line likely means your copy of the 32 // proto package needs to be updated. 33 const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package 34 35 type HealthCheckResponse_ServingStatus int32 36 37 const ( 38 HealthCheckResponse_UNKNOWN HealthCheckResponse_ServingStatus = 0 39 HealthCheckResponse_SERVING HealthCheckResponse_ServingStatus = 1 40 HealthCheckResponse_NOT_SERVING HealthCheckResponse_ServingStatus = 2 41 ) 42 43 var HealthCheckResponse_ServingStatus_name = map[int32]string{ 44 0: "UNKNOWN", 45 1: "SERVING", 46 2: "NOT_SERVING", 47 } 48 49 var HealthCheckResponse_ServingStatus_value = map[string]int32{ 50 "UNKNOWN": 0, 51 "SERVING": 1, 52 "NOT_SERVING": 2, 53 } 54 55 func (x HealthCheckResponse_ServingStatus) String() string { 56 return proto.EnumName(HealthCheckResponse_ServingStatus_name, int32(x)) 57 } 58 59 func (HealthCheckResponse_ServingStatus) EnumDescriptor() ([]byte, []int) { 60 return fileDescriptor_b6ba585df09575a9, []int{6, 0} 61 } 62 63 // Points are represented as latitude-longitude pairs in the E7 representation 64 // (degrees multiplied by 10**7 and rounded to the nearest integer). 65 // Latitudes should be in the range +/- 90 degrees and longitude should be in 66 // the range +/- 180 degrees (inclusive). 67 type Point struct { 68 Latitude int32 `protobuf:"varint,1,opt,name=latitude,proto3" json:"latitude,omitempty"` 69 Longitude int32 `protobuf:"varint,2,opt,name=longitude,proto3" json:"longitude,omitempty"` 70 } 71 72 func (m *Point) Reset() { *m = Point{} } 73 func (*Point) ProtoMessage() {} 74 func (*Point) Descriptor() ([]byte, []int) { 75 return fileDescriptor_b6ba585df09575a9, []int{0} 76 } 77 func (m *Point) XXX_Unmarshal(b []byte) error { 78 return m.Unmarshal(b) 79 } 80 func (m *Point) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 81 if deterministic { 82 return xxx_messageInfo_Point.Marshal(b, m, deterministic) 83 } else { 84 b = b[:cap(b)] 85 n, err := m.MarshalTo(b) 86 if err != nil { 87 return nil, err 88 } 89 return b[:n], nil 90 } 91 } 92 func (m *Point) XXX_Merge(src proto.Message) { 93 xxx_messageInfo_Point.Merge(m, src) 94 } 95 func (m *Point) XXX_Size() int { 96 return m.Size() 97 } 98 func (m *Point) XXX_DiscardUnknown() { 99 xxx_messageInfo_Point.DiscardUnknown(m) 100 } 101 102 var xxx_messageInfo_Point proto.InternalMessageInfo 103 104 // A latitude-longitude rectangle, represented as two diagonally opposite 105 // points "lo" and "hi". 106 type Rectangle struct { 107 // One corner of the rectangle. 108 Lo *Point `protobuf:"bytes,1,opt,name=lo,proto3" json:"lo,omitempty"` 109 // The other corner of the rectangle. 110 Hi *Point `protobuf:"bytes,2,opt,name=hi,proto3" json:"hi,omitempty"` 111 } 112 113 func (m *Rectangle) Reset() { *m = Rectangle{} } 114 func (*Rectangle) ProtoMessage() {} 115 func (*Rectangle) Descriptor() ([]byte, []int) { 116 return fileDescriptor_b6ba585df09575a9, []int{1} 117 } 118 func (m *Rectangle) XXX_Unmarshal(b []byte) error { 119 return m.Unmarshal(b) 120 } 121 func (m *Rectangle) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 122 if deterministic { 123 return xxx_messageInfo_Rectangle.Marshal(b, m, deterministic) 124 } else { 125 b = b[:cap(b)] 126 n, err := m.MarshalTo(b) 127 if err != nil { 128 return nil, err 129 } 130 return b[:n], nil 131 } 132 } 133 func (m *Rectangle) XXX_Merge(src proto.Message) { 134 xxx_messageInfo_Rectangle.Merge(m, src) 135 } 136 func (m *Rectangle) XXX_Size() int { 137 return m.Size() 138 } 139 func (m *Rectangle) XXX_DiscardUnknown() { 140 xxx_messageInfo_Rectangle.DiscardUnknown(m) 141 } 142 143 var xxx_messageInfo_Rectangle proto.InternalMessageInfo 144 145 // A feature names something at a given point. 146 // 147 // If a feature could not be named, the name is empty. 148 type Feature struct { 149 // The name of the feature. 150 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` 151 // The point where the feature is detected. 152 Location *Point `protobuf:"bytes,2,opt,name=location,proto3" json:"location,omitempty"` 153 } 154 155 func (m *Feature) Reset() { *m = Feature{} } 156 func (*Feature) ProtoMessage() {} 157 func (*Feature) Descriptor() ([]byte, []int) { 158 return fileDescriptor_b6ba585df09575a9, []int{2} 159 } 160 func (m *Feature) XXX_Unmarshal(b []byte) error { 161 return m.Unmarshal(b) 162 } 163 func (m *Feature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 164 if deterministic { 165 return xxx_messageInfo_Feature.Marshal(b, m, deterministic) 166 } else { 167 b = b[:cap(b)] 168 n, err := m.MarshalTo(b) 169 if err != nil { 170 return nil, err 171 } 172 return b[:n], nil 173 } 174 } 175 func (m *Feature) XXX_Merge(src proto.Message) { 176 xxx_messageInfo_Feature.Merge(m, src) 177 } 178 func (m *Feature) XXX_Size() int { 179 return m.Size() 180 } 181 func (m *Feature) XXX_DiscardUnknown() { 182 xxx_messageInfo_Feature.DiscardUnknown(m) 183 } 184 185 var xxx_messageInfo_Feature proto.InternalMessageInfo 186 187 // A RouteNote is a message sent while at a given point. 188 type RouteNote struct { 189 // The location from which the message is sent. 190 Location *Point `protobuf:"bytes,1,opt,name=location,proto3" json:"location,omitempty"` 191 // The message to be sent. 192 Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` 193 } 194 195 func (m *RouteNote) Reset() { *m = RouteNote{} } 196 func (*RouteNote) ProtoMessage() {} 197 func (*RouteNote) Descriptor() ([]byte, []int) { 198 return fileDescriptor_b6ba585df09575a9, []int{3} 199 } 200 func (m *RouteNote) XXX_Unmarshal(b []byte) error { 201 return m.Unmarshal(b) 202 } 203 func (m *RouteNote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 204 if deterministic { 205 return xxx_messageInfo_RouteNote.Marshal(b, m, deterministic) 206 } else { 207 b = b[:cap(b)] 208 n, err := m.MarshalTo(b) 209 if err != nil { 210 return nil, err 211 } 212 return b[:n], nil 213 } 214 } 215 func (m *RouteNote) XXX_Merge(src proto.Message) { 216 xxx_messageInfo_RouteNote.Merge(m, src) 217 } 218 func (m *RouteNote) XXX_Size() int { 219 return m.Size() 220 } 221 func (m *RouteNote) XXX_DiscardUnknown() { 222 xxx_messageInfo_RouteNote.DiscardUnknown(m) 223 } 224 225 var xxx_messageInfo_RouteNote proto.InternalMessageInfo 226 227 // A RouteSummary is received in response to a RecordRoute rpc. 228 // 229 // It contains the number of individual points received, the number of 230 // detected features, and the total distance covered as the cumulative sum of 231 // the distance between each point. 232 type RouteSummary struct { 233 // The number of points received. 234 PointCount int32 `protobuf:"varint,1,opt,name=point_count,json=pointCount,proto3" json:"point_count,omitempty"` 235 // The number of known features passed while traversing the route. 236 FeatureCount int32 `protobuf:"varint,2,opt,name=feature_count,json=featureCount,proto3" json:"feature_count,omitempty"` 237 // The distance covered in metres. 238 Distance int32 `protobuf:"varint,3,opt,name=distance,proto3" json:"distance,omitempty"` 239 // The duration of the traversal in seconds. 240 ElapsedTime int32 `protobuf:"varint,4,opt,name=elapsed_time,json=elapsedTime,proto3" json:"elapsed_time,omitempty"` 241 } 242 243 func (m *RouteSummary) Reset() { *m = RouteSummary{} } 244 func (*RouteSummary) ProtoMessage() {} 245 func (*RouteSummary) Descriptor() ([]byte, []int) { 246 return fileDescriptor_b6ba585df09575a9, []int{4} 247 } 248 func (m *RouteSummary) XXX_Unmarshal(b []byte) error { 249 return m.Unmarshal(b) 250 } 251 func (m *RouteSummary) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 252 if deterministic { 253 return xxx_messageInfo_RouteSummary.Marshal(b, m, deterministic) 254 } else { 255 b = b[:cap(b)] 256 n, err := m.MarshalTo(b) 257 if err != nil { 258 return nil, err 259 } 260 return b[:n], nil 261 } 262 } 263 func (m *RouteSummary) XXX_Merge(src proto.Message) { 264 xxx_messageInfo_RouteSummary.Merge(m, src) 265 } 266 func (m *RouteSummary) XXX_Size() int { 267 return m.Size() 268 } 269 func (m *RouteSummary) XXX_DiscardUnknown() { 270 xxx_messageInfo_RouteSummary.DiscardUnknown(m) 271 } 272 273 var xxx_messageInfo_RouteSummary proto.InternalMessageInfo 274 275 type HealthCheckRequest struct { 276 Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` 277 } 278 279 func (m *HealthCheckRequest) Reset() { *m = HealthCheckRequest{} } 280 func (*HealthCheckRequest) ProtoMessage() {} 281 func (*HealthCheckRequest) Descriptor() ([]byte, []int) { 282 return fileDescriptor_b6ba585df09575a9, []int{5} 283 } 284 func (m *HealthCheckRequest) XXX_Unmarshal(b []byte) error { 285 return m.Unmarshal(b) 286 } 287 func (m *HealthCheckRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 288 if deterministic { 289 return xxx_messageInfo_HealthCheckRequest.Marshal(b, m, deterministic) 290 } else { 291 b = b[:cap(b)] 292 n, err := m.MarshalTo(b) 293 if err != nil { 294 return nil, err 295 } 296 return b[:n], nil 297 } 298 } 299 func (m *HealthCheckRequest) XXX_Merge(src proto.Message) { 300 xxx_messageInfo_HealthCheckRequest.Merge(m, src) 301 } 302 func (m *HealthCheckRequest) XXX_Size() int { 303 return m.Size() 304 } 305 func (m *HealthCheckRequest) XXX_DiscardUnknown() { 306 xxx_messageInfo_HealthCheckRequest.DiscardUnknown(m) 307 } 308 309 var xxx_messageInfo_HealthCheckRequest proto.InternalMessageInfo 310 311 type HealthCheckResponse struct { 312 Status HealthCheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,proto3,enum=routeguide.HealthCheckResponse_ServingStatus" json:"status,omitempty"` 313 } 314 315 func (m *HealthCheckResponse) Reset() { *m = HealthCheckResponse{} } 316 func (*HealthCheckResponse) ProtoMessage() {} 317 func (*HealthCheckResponse) Descriptor() ([]byte, []int) { 318 return fileDescriptor_b6ba585df09575a9, []int{6} 319 } 320 func (m *HealthCheckResponse) XXX_Unmarshal(b []byte) error { 321 return m.Unmarshal(b) 322 } 323 func (m *HealthCheckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 324 if deterministic { 325 return xxx_messageInfo_HealthCheckResponse.Marshal(b, m, deterministic) 326 } else { 327 b = b[:cap(b)] 328 n, err := m.MarshalTo(b) 329 if err != nil { 330 return nil, err 331 } 332 return b[:n], nil 333 } 334 } 335 func (m *HealthCheckResponse) XXX_Merge(src proto.Message) { 336 xxx_messageInfo_HealthCheckResponse.Merge(m, src) 337 } 338 func (m *HealthCheckResponse) XXX_Size() int { 339 return m.Size() 340 } 341 func (m *HealthCheckResponse) XXX_DiscardUnknown() { 342 xxx_messageInfo_HealthCheckResponse.DiscardUnknown(m) 343 } 344 345 var xxx_messageInfo_HealthCheckResponse proto.InternalMessageInfo 346 347 func init() { 348 proto.RegisterEnum("routeguide.HealthCheckResponse_ServingStatus", HealthCheckResponse_ServingStatus_name, HealthCheckResponse_ServingStatus_value) 349 proto.RegisterType((*Point)(nil), "routeguide.Point") 350 proto.RegisterType((*Rectangle)(nil), "routeguide.Rectangle") 351 proto.RegisterType((*Feature)(nil), "routeguide.Feature") 352 proto.RegisterType((*RouteNote)(nil), "routeguide.RouteNote") 353 proto.RegisterType((*RouteSummary)(nil), "routeguide.RouteSummary") 354 proto.RegisterType((*HealthCheckRequest)(nil), "routeguide.HealthCheckRequest") 355 proto.RegisterType((*HealthCheckResponse)(nil), "routeguide.HealthCheckResponse") 356 } 357 358 func init() { 359 proto.RegisterFile("github.com/docker/swarmkit/protobuf/plugin/raftproxy/test/service.proto", fileDescriptor_b6ba585df09575a9) 360 } 361 362 var fileDescriptor_b6ba585df09575a9 = []byte{ 363 // 628 bytes of a gzipped FileDescriptorProto 364 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0x4f, 0x4f, 0xdb, 0x4e, 365 0x10, 0xf5, 0x86, 0xbf, 0x99, 0x84, 0x1f, 0xfc, 0x16, 0x55, 0x8a, 0xd2, 0xca, 0x14, 0xf7, 0xc2, 366 0x05, 0x1b, 0xa5, 0x52, 0x0f, 0x3d, 0x50, 0x15, 0x44, 0xd3, 0x3f, 0x28, 0x50, 0x27, 0x6d, 0xa5, 367 0x5e, 0xd0, 0xe2, 0x0c, 0xce, 0x0a, 0xdb, 0xeb, 0x7a, 0xd7, 0x2d, 0xdc, 0x7a, 0xe9, 0xbd, 0x52, 368 0x2f, 0x3d, 0xf7, 0xd3, 0x70, 0xe4, 0xc8, 0xb1, 0x84, 0x2f, 0x52, 0x79, 0x6d, 0x43, 0xd2, 0x06, 369 0x71, 0xf3, 0xbc, 0x79, 0x6f, 0xc6, 0xf3, 0x66, 0xb4, 0xd0, 0xf6, 0xb9, 0x1a, 0xa4, 0x87, 0xb6, 370 0x27, 0x42, 0xa7, 0x2f, 0xbc, 0x63, 0x4c, 0x1c, 0xf9, 0x85, 0x25, 0xe1, 0x31, 0x57, 0x4e, 0x9c, 371 0x08, 0x25, 0x0e, 0xd3, 0x23, 0x27, 0x0e, 0x52, 0x9f, 0x47, 0x4e, 0xc2, 0x8e, 0x54, 0x9c, 0x88, 372 0x93, 0x53, 0x47, 0xa1, 0x54, 0x8e, 0xc4, 0xe4, 0x33, 0xf7, 0xd0, 0xd6, 0x34, 0x0a, 0x89, 0x48, 373 0x15, 0xfa, 0x29, 0xef, 0xa3, 0xf5, 0x1c, 0x66, 0xf6, 0x05, 0x8f, 0x14, 0x6d, 0xc2, 0x7c, 0xc0, 374 0x14, 0x57, 0x69, 0x1f, 0x1b, 0xe4, 0x21, 0x59, 0x9b, 0x71, 0xaf, 0x63, 0xfa, 0x00, 0xaa, 0x81, 375 0x88, 0xfc, 0x3c, 0x59, 0xd1, 0xc9, 0x1b, 0xc0, 0x7a, 0x0b, 0x55, 0x17, 0x3d, 0xc5, 0x22, 0x3f, 376 0x40, 0xba, 0x0a, 0x95, 0x40, 0xe8, 0x02, 0xb5, 0xd6, 0xff, 0xf6, 0x4d, 0x23, 0x5b, 0x77, 0x71, 377 0x2b, 0x81, 0xc8, 0x28, 0x03, 0xae, 0xcb, 0x4c, 0xa6, 0x0c, 0xb8, 0xb5, 0x0b, 0x73, 0x2f, 0x90, 378 0xa9, 0x34, 0x41, 0x4a, 0x61, 0x3a, 0x62, 0x61, 0xfe, 0x4f, 0x55, 0x57, 0x7f, 0xd3, 0x75, 0x98, 379 0x0f, 0x84, 0xc7, 0x14, 0x17, 0xd1, 0xed, 0x75, 0xae, 0x29, 0x56, 0x0f, 0xaa, 0x6e, 0x96, 0xed, 380 0x08, 0x35, 0xae, 0x25, 0x77, 0x6a, 0x69, 0x03, 0xe6, 0x42, 0x94, 0x92, 0xf9, 0xf9, 0xe0, 0x55, 381 0xb7, 0x0c, 0xad, 0x1f, 0x04, 0xea, 0xba, 0x6c, 0x37, 0x0d, 0x43, 0x96, 0x9c, 0xd2, 0x15, 0xa8, 382 0xc5, 0x99, 0xfa, 0xc0, 0x13, 0x69, 0xa4, 0x0a, 0x13, 0x41, 0x43, 0xdb, 0x19, 0x42, 0x1f, 0xc1, 383 0xc2, 0x51, 0x3e, 0x55, 0x41, 0xc9, 0xad, 0xac, 0x17, 0x60, 0x4e, 0x6a, 0xc2, 0x7c, 0x9f, 0x4b, 384 0xc5, 0x22, 0x0f, 0x1b, 0x53, 0xf9, 0x1e, 0xca, 0x98, 0xae, 0x42, 0x1d, 0x03, 0x16, 0x4b, 0xec, 385 0x1f, 0x28, 0x1e, 0x62, 0x63, 0x5a, 0xe7, 0x6b, 0x05, 0xd6, 0xe3, 0x21, 0x5a, 0x36, 0xd0, 0x97, 386 0xc8, 0x02, 0x35, 0xd8, 0x1e, 0xa0, 0x77, 0xec, 0xe2, 0xa7, 0x14, 0xa5, 0xca, 0xa6, 0x28, 0x4e, 387 0xa0, 0xf0, 0xb1, 0x0c, 0xad, 0x9f, 0x04, 0x96, 0xc7, 0x04, 0x32, 0x16, 0x91, 0x44, 0xba, 0x03, 388 0xb3, 0x52, 0x31, 0x95, 0x4a, 0x2d, 0xf8, 0xaf, 0xb5, 0x3e, 0x6a, 0xd2, 0x04, 0x81, 0xdd, 0xcd, 389 0x0a, 0x46, 0x7e, 0x57, 0x8b, 0xdc, 0x42, 0x6c, 0x3d, 0x85, 0x85, 0xb1, 0x04, 0xad, 0xc1, 0xdc, 390 0xbb, 0xce, 0x9b, 0xce, 0xde, 0x87, 0xce, 0x92, 0x91, 0x05, 0xdd, 0x1d, 0xf7, 0xfd, 0xab, 0x4e, 391 0x7b, 0x89, 0xd0, 0x45, 0xa8, 0x75, 0xf6, 0x7a, 0x07, 0x25, 0x50, 0x69, 0x7d, 0xab, 0x00, 0x68, 392 0x83, 0xdb, 0x59, 0x53, 0xfa, 0x04, 0xa0, 0x8d, 0xaa, 0x3c, 0x8b, 0x7f, 0x97, 0xd6, 0x5c, 0x1e, 393 0x85, 0x0a, 0x9e, 0x65, 0xd0, 0x4d, 0xa8, 0xef, 0x72, 0x59, 0x0a, 0x25, 0xbd, 0x37, 0x4a, 0xbb, 394 0x3e, 0xdc, 0x5b, 0xd4, 0x1b, 0x84, 0x6e, 0x42, 0xcd, 0x45, 0x4f, 0x24, 0x7d, 0xfd, 0x2f, 0x93, 395 0x1a, 0x37, 0xc6, 0x2a, 0x8e, 0x9c, 0x84, 0x65, 0xac, 0x11, 0xfa, 0xac, 0xb8, 0xbe, 0xed, 0x01, 396 0x53, 0x7f, 0x35, 0x2f, 0x8f, 0xb2, 0x39, 0x19, 0xce, 0xe4, 0x1b, 0xa4, 0xd5, 0x83, 0xd9, 0xdc, 397 0x70, 0xfa, 0x1a, 0x66, 0xb4, 0xe9, 0xd4, 0xbc, 0x75, 0x1b, 0x7a, 0xdf, 0xcd, 0x95, 0x3b, 0xb6, 398 0x65, 0x19, 0x5b, 0x1f, 0xcf, 0x2e, 0x4d, 0xe3, 0xe2, 0xd2, 0x34, 0xbe, 0x0e, 0x4d, 0x72, 0x36, 399 0x34, 0xc9, 0xf9, 0xd0, 0x24, 0xbf, 0x87, 0x26, 0xf9, 0x7e, 0x65, 0x1a, 0xe7, 0x57, 0xa6, 0x71, 400 0x71, 0x65, 0x1a, 0x70, 0x9f, 0x0b, 0xdb, 0x4f, 0x62, 0xcf, 0xc6, 0x13, 0x16, 0xc6, 0x01, 0xca, 401 0x91, 0xc2, 0x5b, 0x8b, 0x37, 0xdb, 0xd9, 0xcf, 0x1e, 0x96, 0x7d, 0xf2, 0xab, 0x32, 0xe5, 0xf6, 402 0xda, 0x87, 0xb3, 0xfa, 0x9d, 0x79, 0xfc, 0x27, 0x00, 0x00, 0xff, 0xff, 0x84, 0x3e, 0x31, 0x33, 403 0xb2, 0x04, 0x00, 0x00, 404 } 405 406 type authenticatedWrapperRouteGuideServer struct { 407 local RouteGuideServer 408 authorize func(context.Context, []string) error 409 } 410 411 func NewAuthenticatedWrapperRouteGuideServer(local RouteGuideServer, authorize func(context.Context, []string) error) RouteGuideServer { 412 return &authenticatedWrapperRouteGuideServer{ 413 local: local, 414 authorize: authorize, 415 } 416 } 417 418 func (p *authenticatedWrapperRouteGuideServer) GetFeature(ctx context.Context, r *Point) (*Feature, error) { 419 420 panic("no authorization information in protobuf") 421 } 422 423 func (p *authenticatedWrapperRouteGuideServer) ListFeatures(r *Rectangle, stream RouteGuide_ListFeaturesServer) error { 424 425 panic("no authorization information in protobuf") 426 } 427 428 func (p *authenticatedWrapperRouteGuideServer) RecordRoute(stream RouteGuide_RecordRouteServer) error { 429 430 panic("no authorization information in protobuf") 431 } 432 433 func (p *authenticatedWrapperRouteGuideServer) RouteChat(stream RouteGuide_RouteChatServer) error { 434 435 panic("no authorization information in protobuf") 436 } 437 438 type authenticatedWrapperHealthServer struct { 439 local HealthServer 440 authorize func(context.Context, []string) error 441 } 442 443 func NewAuthenticatedWrapperHealthServer(local HealthServer, authorize func(context.Context, []string) error) HealthServer { 444 return &authenticatedWrapperHealthServer{ 445 local: local, 446 authorize: authorize, 447 } 448 } 449 450 func (p *authenticatedWrapperHealthServer) Check(ctx context.Context, r *HealthCheckRequest) (*HealthCheckResponse, error) { 451 452 panic("no authorization information in protobuf") 453 } 454 455 func (m *Point) Copy() *Point { 456 if m == nil { 457 return nil 458 } 459 o := &Point{} 460 o.CopyFrom(m) 461 return o 462 } 463 464 func (m *Point) CopyFrom(src interface{}) { 465 466 o := src.(*Point) 467 *m = *o 468 } 469 470 func (m *Rectangle) Copy() *Rectangle { 471 if m == nil { 472 return nil 473 } 474 o := &Rectangle{} 475 o.CopyFrom(m) 476 return o 477 } 478 479 func (m *Rectangle) CopyFrom(src interface{}) { 480 481 o := src.(*Rectangle) 482 *m = *o 483 if o.Lo != nil { 484 m.Lo = &Point{} 485 github_com_docker_swarmkit_api_deepcopy.Copy(m.Lo, o.Lo) 486 } 487 if o.Hi != nil { 488 m.Hi = &Point{} 489 github_com_docker_swarmkit_api_deepcopy.Copy(m.Hi, o.Hi) 490 } 491 } 492 493 func (m *Feature) Copy() *Feature { 494 if m == nil { 495 return nil 496 } 497 o := &Feature{} 498 o.CopyFrom(m) 499 return o 500 } 501 502 func (m *Feature) CopyFrom(src interface{}) { 503 504 o := src.(*Feature) 505 *m = *o 506 if o.Location != nil { 507 m.Location = &Point{} 508 github_com_docker_swarmkit_api_deepcopy.Copy(m.Location, o.Location) 509 } 510 } 511 512 func (m *RouteNote) Copy() *RouteNote { 513 if m == nil { 514 return nil 515 } 516 o := &RouteNote{} 517 o.CopyFrom(m) 518 return o 519 } 520 521 func (m *RouteNote) CopyFrom(src interface{}) { 522 523 o := src.(*RouteNote) 524 *m = *o 525 if o.Location != nil { 526 m.Location = &Point{} 527 github_com_docker_swarmkit_api_deepcopy.Copy(m.Location, o.Location) 528 } 529 } 530 531 func (m *RouteSummary) Copy() *RouteSummary { 532 if m == nil { 533 return nil 534 } 535 o := &RouteSummary{} 536 o.CopyFrom(m) 537 return o 538 } 539 540 func (m *RouteSummary) CopyFrom(src interface{}) { 541 542 o := src.(*RouteSummary) 543 *m = *o 544 } 545 546 func (m *HealthCheckRequest) Copy() *HealthCheckRequest { 547 if m == nil { 548 return nil 549 } 550 o := &HealthCheckRequest{} 551 o.CopyFrom(m) 552 return o 553 } 554 555 func (m *HealthCheckRequest) CopyFrom(src interface{}) { 556 557 o := src.(*HealthCheckRequest) 558 *m = *o 559 } 560 561 func (m *HealthCheckResponse) Copy() *HealthCheckResponse { 562 if m == nil { 563 return nil 564 } 565 o := &HealthCheckResponse{} 566 o.CopyFrom(m) 567 return o 568 } 569 570 func (m *HealthCheckResponse) CopyFrom(src interface{}) { 571 572 o := src.(*HealthCheckResponse) 573 *m = *o 574 } 575 576 // Reference imports to suppress errors if they are not otherwise used. 577 var _ context.Context 578 var _ grpc.ClientConn 579 580 // This is a compile-time assertion to ensure that this generated file 581 // is compatible with the grpc package it is being compiled against. 582 const _ = grpc.SupportPackageIsVersion4 583 584 // RouteGuideClient is the client API for RouteGuide service. 585 // 586 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 587 type RouteGuideClient interface { 588 // A simple RPC. 589 // 590 // Obtains the feature at a given position. 591 // 592 // A feature with an empty name is returned if there's no feature at the given 593 // position. 594 GetFeature(ctx context.Context, in *Point, opts ...grpc.CallOption) (*Feature, error) 595 // A server-to-client streaming RPC. 596 // 597 // Obtains the Features available within the given Rectangle. Results are 598 // streamed rather than returned at once (e.g. in a response message with a 599 // repeated field), as the rectangle may cover a large area and contain a 600 // huge number of features. 601 ListFeatures(ctx context.Context, in *Rectangle, opts ...grpc.CallOption) (RouteGuide_ListFeaturesClient, error) 602 // A client-to-server streaming RPC. 603 // 604 // Accepts a stream of Points on a route being traversed, returning a 605 // RouteSummary when traversal is completed. 606 RecordRoute(ctx context.Context, opts ...grpc.CallOption) (RouteGuide_RecordRouteClient, error) 607 // A Bidirectional streaming RPC. 608 // 609 // Accepts a stream of RouteNotes sent while a route is being traversed, 610 // while receiving other RouteNotes (e.g. from other users). 611 RouteChat(ctx context.Context, opts ...grpc.CallOption) (RouteGuide_RouteChatClient, error) 612 } 613 614 type routeGuideClient struct { 615 cc *grpc.ClientConn 616 } 617 618 func NewRouteGuideClient(cc *grpc.ClientConn) RouteGuideClient { 619 return &routeGuideClient{cc} 620 } 621 622 func (c *routeGuideClient) GetFeature(ctx context.Context, in *Point, opts ...grpc.CallOption) (*Feature, error) { 623 out := new(Feature) 624 err := c.cc.Invoke(ctx, "/routeguide.RouteGuide/GetFeature", in, out, opts...) 625 if err != nil { 626 return nil, err 627 } 628 return out, nil 629 } 630 631 func (c *routeGuideClient) ListFeatures(ctx context.Context, in *Rectangle, opts ...grpc.CallOption) (RouteGuide_ListFeaturesClient, error) { 632 stream, err := c.cc.NewStream(ctx, &_RouteGuide_serviceDesc.Streams[0], "/routeguide.RouteGuide/ListFeatures", opts...) 633 if err != nil { 634 return nil, err 635 } 636 x := &routeGuideListFeaturesClient{stream} 637 if err := x.ClientStream.SendMsg(in); err != nil { 638 return nil, err 639 } 640 if err := x.ClientStream.CloseSend(); err != nil { 641 return nil, err 642 } 643 return x, nil 644 } 645 646 type RouteGuide_ListFeaturesClient interface { 647 Recv() (*Feature, error) 648 grpc.ClientStream 649 } 650 651 type routeGuideListFeaturesClient struct { 652 grpc.ClientStream 653 } 654 655 func (x *routeGuideListFeaturesClient) Recv() (*Feature, error) { 656 m := new(Feature) 657 if err := x.ClientStream.RecvMsg(m); err != nil { 658 return nil, err 659 } 660 return m, nil 661 } 662 663 func (c *routeGuideClient) RecordRoute(ctx context.Context, opts ...grpc.CallOption) (RouteGuide_RecordRouteClient, error) { 664 stream, err := c.cc.NewStream(ctx, &_RouteGuide_serviceDesc.Streams[1], "/routeguide.RouteGuide/RecordRoute", opts...) 665 if err != nil { 666 return nil, err 667 } 668 x := &routeGuideRecordRouteClient{stream} 669 return x, nil 670 } 671 672 type RouteGuide_RecordRouteClient interface { 673 Send(*Point) error 674 CloseAndRecv() (*RouteSummary, error) 675 grpc.ClientStream 676 } 677 678 type routeGuideRecordRouteClient struct { 679 grpc.ClientStream 680 } 681 682 func (x *routeGuideRecordRouteClient) Send(m *Point) error { 683 return x.ClientStream.SendMsg(m) 684 } 685 686 func (x *routeGuideRecordRouteClient) CloseAndRecv() (*RouteSummary, error) { 687 if err := x.ClientStream.CloseSend(); err != nil { 688 return nil, err 689 } 690 m := new(RouteSummary) 691 if err := x.ClientStream.RecvMsg(m); err != nil { 692 return nil, err 693 } 694 return m, nil 695 } 696 697 func (c *routeGuideClient) RouteChat(ctx context.Context, opts ...grpc.CallOption) (RouteGuide_RouteChatClient, error) { 698 stream, err := c.cc.NewStream(ctx, &_RouteGuide_serviceDesc.Streams[2], "/routeguide.RouteGuide/RouteChat", opts...) 699 if err != nil { 700 return nil, err 701 } 702 x := &routeGuideRouteChatClient{stream} 703 return x, nil 704 } 705 706 type RouteGuide_RouteChatClient interface { 707 Send(*RouteNote) error 708 Recv() (*RouteNote, error) 709 grpc.ClientStream 710 } 711 712 type routeGuideRouteChatClient struct { 713 grpc.ClientStream 714 } 715 716 func (x *routeGuideRouteChatClient) Send(m *RouteNote) error { 717 return x.ClientStream.SendMsg(m) 718 } 719 720 func (x *routeGuideRouteChatClient) Recv() (*RouteNote, error) { 721 m := new(RouteNote) 722 if err := x.ClientStream.RecvMsg(m); err != nil { 723 return nil, err 724 } 725 return m, nil 726 } 727 728 // RouteGuideServer is the server API for RouteGuide service. 729 type RouteGuideServer interface { 730 // A simple RPC. 731 // 732 // Obtains the feature at a given position. 733 // 734 // A feature with an empty name is returned if there's no feature at the given 735 // position. 736 GetFeature(context.Context, *Point) (*Feature, error) 737 // A server-to-client streaming RPC. 738 // 739 // Obtains the Features available within the given Rectangle. Results are 740 // streamed rather than returned at once (e.g. in a response message with a 741 // repeated field), as the rectangle may cover a large area and contain a 742 // huge number of features. 743 ListFeatures(*Rectangle, RouteGuide_ListFeaturesServer) error 744 // A client-to-server streaming RPC. 745 // 746 // Accepts a stream of Points on a route being traversed, returning a 747 // RouteSummary when traversal is completed. 748 RecordRoute(RouteGuide_RecordRouteServer) error 749 // A Bidirectional streaming RPC. 750 // 751 // Accepts a stream of RouteNotes sent while a route is being traversed, 752 // while receiving other RouteNotes (e.g. from other users). 753 RouteChat(RouteGuide_RouteChatServer) error 754 } 755 756 func RegisterRouteGuideServer(s *grpc.Server, srv RouteGuideServer) { 757 s.RegisterService(&_RouteGuide_serviceDesc, srv) 758 } 759 760 func _RouteGuide_GetFeature_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 761 in := new(Point) 762 if err := dec(in); err != nil { 763 return nil, err 764 } 765 if interceptor == nil { 766 return srv.(RouteGuideServer).GetFeature(ctx, in) 767 } 768 info := &grpc.UnaryServerInfo{ 769 Server: srv, 770 FullMethod: "/routeguide.RouteGuide/GetFeature", 771 } 772 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 773 return srv.(RouteGuideServer).GetFeature(ctx, req.(*Point)) 774 } 775 return interceptor(ctx, in, info, handler) 776 } 777 778 func _RouteGuide_ListFeatures_Handler(srv interface{}, stream grpc.ServerStream) error { 779 m := new(Rectangle) 780 if err := stream.RecvMsg(m); err != nil { 781 return err 782 } 783 return srv.(RouteGuideServer).ListFeatures(m, &routeGuideListFeaturesServer{stream}) 784 } 785 786 type RouteGuide_ListFeaturesServer interface { 787 Send(*Feature) error 788 grpc.ServerStream 789 } 790 791 type routeGuideListFeaturesServer struct { 792 grpc.ServerStream 793 } 794 795 func (x *routeGuideListFeaturesServer) Send(m *Feature) error { 796 return x.ServerStream.SendMsg(m) 797 } 798 799 func _RouteGuide_RecordRoute_Handler(srv interface{}, stream grpc.ServerStream) error { 800 return srv.(RouteGuideServer).RecordRoute(&routeGuideRecordRouteServer{stream}) 801 } 802 803 type RouteGuide_RecordRouteServer interface { 804 SendAndClose(*RouteSummary) error 805 Recv() (*Point, error) 806 grpc.ServerStream 807 } 808 809 type routeGuideRecordRouteServer struct { 810 grpc.ServerStream 811 } 812 813 func (x *routeGuideRecordRouteServer) SendAndClose(m *RouteSummary) error { 814 return x.ServerStream.SendMsg(m) 815 } 816 817 func (x *routeGuideRecordRouteServer) Recv() (*Point, error) { 818 m := new(Point) 819 if err := x.ServerStream.RecvMsg(m); err != nil { 820 return nil, err 821 } 822 return m, nil 823 } 824 825 func _RouteGuide_RouteChat_Handler(srv interface{}, stream grpc.ServerStream) error { 826 return srv.(RouteGuideServer).RouteChat(&routeGuideRouteChatServer{stream}) 827 } 828 829 type RouteGuide_RouteChatServer interface { 830 Send(*RouteNote) error 831 Recv() (*RouteNote, error) 832 grpc.ServerStream 833 } 834 835 type routeGuideRouteChatServer struct { 836 grpc.ServerStream 837 } 838 839 func (x *routeGuideRouteChatServer) Send(m *RouteNote) error { 840 return x.ServerStream.SendMsg(m) 841 } 842 843 func (x *routeGuideRouteChatServer) Recv() (*RouteNote, error) { 844 m := new(RouteNote) 845 if err := x.ServerStream.RecvMsg(m); err != nil { 846 return nil, err 847 } 848 return m, nil 849 } 850 851 var _RouteGuide_serviceDesc = grpc.ServiceDesc{ 852 ServiceName: "routeguide.RouteGuide", 853 HandlerType: (*RouteGuideServer)(nil), 854 Methods: []grpc.MethodDesc{ 855 { 856 MethodName: "GetFeature", 857 Handler: _RouteGuide_GetFeature_Handler, 858 }, 859 }, 860 Streams: []grpc.StreamDesc{ 861 { 862 StreamName: "ListFeatures", 863 Handler: _RouteGuide_ListFeatures_Handler, 864 ServerStreams: true, 865 }, 866 { 867 StreamName: "RecordRoute", 868 Handler: _RouteGuide_RecordRoute_Handler, 869 ClientStreams: true, 870 }, 871 { 872 StreamName: "RouteChat", 873 Handler: _RouteGuide_RouteChat_Handler, 874 ServerStreams: true, 875 ClientStreams: true, 876 }, 877 }, 878 Metadata: "github.com/docker/swarmkit/protobuf/plugin/raftproxy/test/service.proto", 879 } 880 881 // HealthClient is the client API for Health service. 882 // 883 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 884 type HealthClient interface { 885 Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) 886 } 887 888 type healthClient struct { 889 cc *grpc.ClientConn 890 } 891 892 func NewHealthClient(cc *grpc.ClientConn) HealthClient { 893 return &healthClient{cc} 894 } 895 896 func (c *healthClient) Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) { 897 out := new(HealthCheckResponse) 898 err := c.cc.Invoke(ctx, "/routeguide.Health/Check", in, out, opts...) 899 if err != nil { 900 return nil, err 901 } 902 return out, nil 903 } 904 905 // HealthServer is the server API for Health service. 906 type HealthServer interface { 907 Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) 908 } 909 910 func RegisterHealthServer(s *grpc.Server, srv HealthServer) { 911 s.RegisterService(&_Health_serviceDesc, srv) 912 } 913 914 func _Health_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 915 in := new(HealthCheckRequest) 916 if err := dec(in); err != nil { 917 return nil, err 918 } 919 if interceptor == nil { 920 return srv.(HealthServer).Check(ctx, in) 921 } 922 info := &grpc.UnaryServerInfo{ 923 Server: srv, 924 FullMethod: "/routeguide.Health/Check", 925 } 926 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 927 return srv.(HealthServer).Check(ctx, req.(*HealthCheckRequest)) 928 } 929 return interceptor(ctx, in, info, handler) 930 } 931 932 var _Health_serviceDesc = grpc.ServiceDesc{ 933 ServiceName: "routeguide.Health", 934 HandlerType: (*HealthServer)(nil), 935 Methods: []grpc.MethodDesc{ 936 { 937 MethodName: "Check", 938 Handler: _Health_Check_Handler, 939 }, 940 }, 941 Streams: []grpc.StreamDesc{}, 942 Metadata: "github.com/docker/swarmkit/protobuf/plugin/raftproxy/test/service.proto", 943 } 944 945 func (m *Point) Marshal() (dAtA []byte, err error) { 946 size := m.Size() 947 dAtA = make([]byte, size) 948 n, err := m.MarshalTo(dAtA) 949 if err != nil { 950 return nil, err 951 } 952 return dAtA[:n], nil 953 } 954 955 func (m *Point) MarshalTo(dAtA []byte) (int, error) { 956 var i int 957 _ = i 958 var l int 959 _ = l 960 if m.Latitude != 0 { 961 dAtA[i] = 0x8 962 i++ 963 i = encodeVarintService(dAtA, i, uint64(m.Latitude)) 964 } 965 if m.Longitude != 0 { 966 dAtA[i] = 0x10 967 i++ 968 i = encodeVarintService(dAtA, i, uint64(m.Longitude)) 969 } 970 return i, nil 971 } 972 973 func (m *Rectangle) Marshal() (dAtA []byte, err error) { 974 size := m.Size() 975 dAtA = make([]byte, size) 976 n, err := m.MarshalTo(dAtA) 977 if err != nil { 978 return nil, err 979 } 980 return dAtA[:n], nil 981 } 982 983 func (m *Rectangle) MarshalTo(dAtA []byte) (int, error) { 984 var i int 985 _ = i 986 var l int 987 _ = l 988 if m.Lo != nil { 989 dAtA[i] = 0xa 990 i++ 991 i = encodeVarintService(dAtA, i, uint64(m.Lo.Size())) 992 n1, err := m.Lo.MarshalTo(dAtA[i:]) 993 if err != nil { 994 return 0, err 995 } 996 i += n1 997 } 998 if m.Hi != nil { 999 dAtA[i] = 0x12 1000 i++ 1001 i = encodeVarintService(dAtA, i, uint64(m.Hi.Size())) 1002 n2, err := m.Hi.MarshalTo(dAtA[i:]) 1003 if err != nil { 1004 return 0, err 1005 } 1006 i += n2 1007 } 1008 return i, nil 1009 } 1010 1011 func (m *Feature) Marshal() (dAtA []byte, err error) { 1012 size := m.Size() 1013 dAtA = make([]byte, size) 1014 n, err := m.MarshalTo(dAtA) 1015 if err != nil { 1016 return nil, err 1017 } 1018 return dAtA[:n], nil 1019 } 1020 1021 func (m *Feature) MarshalTo(dAtA []byte) (int, error) { 1022 var i int 1023 _ = i 1024 var l int 1025 _ = l 1026 if len(m.Name) > 0 { 1027 dAtA[i] = 0xa 1028 i++ 1029 i = encodeVarintService(dAtA, i, uint64(len(m.Name))) 1030 i += copy(dAtA[i:], m.Name) 1031 } 1032 if m.Location != nil { 1033 dAtA[i] = 0x12 1034 i++ 1035 i = encodeVarintService(dAtA, i, uint64(m.Location.Size())) 1036 n3, err := m.Location.MarshalTo(dAtA[i:]) 1037 if err != nil { 1038 return 0, err 1039 } 1040 i += n3 1041 } 1042 return i, nil 1043 } 1044 1045 func (m *RouteNote) Marshal() (dAtA []byte, err error) { 1046 size := m.Size() 1047 dAtA = make([]byte, size) 1048 n, err := m.MarshalTo(dAtA) 1049 if err != nil { 1050 return nil, err 1051 } 1052 return dAtA[:n], nil 1053 } 1054 1055 func (m *RouteNote) MarshalTo(dAtA []byte) (int, error) { 1056 var i int 1057 _ = i 1058 var l int 1059 _ = l 1060 if m.Location != nil { 1061 dAtA[i] = 0xa 1062 i++ 1063 i = encodeVarintService(dAtA, i, uint64(m.Location.Size())) 1064 n4, err := m.Location.MarshalTo(dAtA[i:]) 1065 if err != nil { 1066 return 0, err 1067 } 1068 i += n4 1069 } 1070 if len(m.Message) > 0 { 1071 dAtA[i] = 0x12 1072 i++ 1073 i = encodeVarintService(dAtA, i, uint64(len(m.Message))) 1074 i += copy(dAtA[i:], m.Message) 1075 } 1076 return i, nil 1077 } 1078 1079 func (m *RouteSummary) Marshal() (dAtA []byte, err error) { 1080 size := m.Size() 1081 dAtA = make([]byte, size) 1082 n, err := m.MarshalTo(dAtA) 1083 if err != nil { 1084 return nil, err 1085 } 1086 return dAtA[:n], nil 1087 } 1088 1089 func (m *RouteSummary) MarshalTo(dAtA []byte) (int, error) { 1090 var i int 1091 _ = i 1092 var l int 1093 _ = l 1094 if m.PointCount != 0 { 1095 dAtA[i] = 0x8 1096 i++ 1097 i = encodeVarintService(dAtA, i, uint64(m.PointCount)) 1098 } 1099 if m.FeatureCount != 0 { 1100 dAtA[i] = 0x10 1101 i++ 1102 i = encodeVarintService(dAtA, i, uint64(m.FeatureCount)) 1103 } 1104 if m.Distance != 0 { 1105 dAtA[i] = 0x18 1106 i++ 1107 i = encodeVarintService(dAtA, i, uint64(m.Distance)) 1108 } 1109 if m.ElapsedTime != 0 { 1110 dAtA[i] = 0x20 1111 i++ 1112 i = encodeVarintService(dAtA, i, uint64(m.ElapsedTime)) 1113 } 1114 return i, nil 1115 } 1116 1117 func (m *HealthCheckRequest) Marshal() (dAtA []byte, err error) { 1118 size := m.Size() 1119 dAtA = make([]byte, size) 1120 n, err := m.MarshalTo(dAtA) 1121 if err != nil { 1122 return nil, err 1123 } 1124 return dAtA[:n], nil 1125 } 1126 1127 func (m *HealthCheckRequest) MarshalTo(dAtA []byte) (int, error) { 1128 var i int 1129 _ = i 1130 var l int 1131 _ = l 1132 if len(m.Service) > 0 { 1133 dAtA[i] = 0xa 1134 i++ 1135 i = encodeVarintService(dAtA, i, uint64(len(m.Service))) 1136 i += copy(dAtA[i:], m.Service) 1137 } 1138 return i, nil 1139 } 1140 1141 func (m *HealthCheckResponse) Marshal() (dAtA []byte, err error) { 1142 size := m.Size() 1143 dAtA = make([]byte, size) 1144 n, err := m.MarshalTo(dAtA) 1145 if err != nil { 1146 return nil, err 1147 } 1148 return dAtA[:n], nil 1149 } 1150 1151 func (m *HealthCheckResponse) MarshalTo(dAtA []byte) (int, error) { 1152 var i int 1153 _ = i 1154 var l int 1155 _ = l 1156 if m.Status != 0 { 1157 dAtA[i] = 0x8 1158 i++ 1159 i = encodeVarintService(dAtA, i, uint64(m.Status)) 1160 } 1161 return i, nil 1162 } 1163 1164 func encodeVarintService(dAtA []byte, offset int, v uint64) int { 1165 for v >= 1<<7 { 1166 dAtA[offset] = uint8(v&0x7f | 0x80) 1167 v >>= 7 1168 offset++ 1169 } 1170 dAtA[offset] = uint8(v) 1171 return offset + 1 1172 } 1173 1174 type raftProxyRouteGuideServer struct { 1175 local RouteGuideServer 1176 connSelector raftselector.ConnProvider 1177 localCtxMods, remoteCtxMods []func(context.Context) (context.Context, error) 1178 } 1179 1180 func NewRaftProxyRouteGuideServer(local RouteGuideServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) RouteGuideServer { 1181 redirectChecker := func(ctx context.Context) (context.Context, error) { 1182 p, ok := peer.FromContext(ctx) 1183 if !ok { 1184 return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context") 1185 } 1186 addr := p.Addr.String() 1187 md, ok := metadata.FromIncomingContext(ctx) 1188 if ok && len(md["redirect"]) != 0 { 1189 return ctx, status.Errorf(codes.ResourceExhausted, "more than one redirect to leader from: %s", md["redirect"]) 1190 } 1191 if !ok { 1192 md = metadata.New(map[string]string{}) 1193 } 1194 md["redirect"] = append(md["redirect"], addr) 1195 return metadata.NewOutgoingContext(ctx, md), nil 1196 } 1197 remoteMods := []func(context.Context) (context.Context, error){redirectChecker} 1198 remoteMods = append(remoteMods, remoteCtxMod) 1199 1200 var localMods []func(context.Context) (context.Context, error) 1201 if localCtxMod != nil { 1202 localMods = []func(context.Context) (context.Context, error){localCtxMod} 1203 } 1204 1205 return &raftProxyRouteGuideServer{ 1206 local: local, 1207 connSelector: connSelector, 1208 localCtxMods: localMods, 1209 remoteCtxMods: remoteMods, 1210 } 1211 } 1212 func (p *raftProxyRouteGuideServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) { 1213 var err error 1214 for _, mod := range ctxMods { 1215 ctx, err = mod(ctx) 1216 if err != nil { 1217 return ctx, err 1218 } 1219 } 1220 return ctx, nil 1221 } 1222 func (p *raftProxyRouteGuideServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) { 1223 ticker := rafttime.NewTicker(500 * rafttime.Millisecond) 1224 defer ticker.Stop() 1225 for { 1226 select { 1227 case <-ticker.C: 1228 conn, err := p.connSelector.LeaderConn(ctx) 1229 if err != nil { 1230 return nil, err 1231 } 1232 1233 client := NewHealthClient(conn) 1234 1235 resp, err := client.Check(ctx, &HealthCheckRequest{Service: "Raft"}) 1236 if err != nil || resp.Status != HealthCheckResponse_SERVING { 1237 continue 1238 } 1239 return conn, nil 1240 case <-ctx.Done(): 1241 return nil, ctx.Err() 1242 } 1243 } 1244 } 1245 1246 func (p *raftProxyRouteGuideServer) GetFeature(ctx context.Context, r *Point) (*Feature, error) { 1247 1248 conn, err := p.connSelector.LeaderConn(ctx) 1249 if err != nil { 1250 if err == raftselector.ErrIsLeader { 1251 ctx, err = p.runCtxMods(ctx, p.localCtxMods) 1252 if err != nil { 1253 return nil, err 1254 } 1255 return p.local.GetFeature(ctx, r) 1256 } 1257 return nil, err 1258 } 1259 modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) 1260 if err != nil { 1261 return nil, err 1262 } 1263 1264 resp, err := NewRouteGuideClient(conn).GetFeature(modCtx, r) 1265 if err != nil { 1266 if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { 1267 return resp, err 1268 } 1269 conn, err := p.pollNewLeaderConn(ctx) 1270 if err != nil { 1271 if err == raftselector.ErrIsLeader { 1272 return p.local.GetFeature(ctx, r) 1273 } 1274 return nil, err 1275 } 1276 return NewRouteGuideClient(conn).GetFeature(modCtx, r) 1277 } 1278 return resp, err 1279 } 1280 1281 type RouteGuide_ListFeaturesServerWrapper struct { 1282 RouteGuide_ListFeaturesServer 1283 ctx context.Context 1284 } 1285 1286 func (s RouteGuide_ListFeaturesServerWrapper) Context() context.Context { 1287 return s.ctx 1288 } 1289 1290 func (p *raftProxyRouteGuideServer) ListFeatures(r *Rectangle, stream RouteGuide_ListFeaturesServer) error { 1291 ctx := stream.Context() 1292 conn, err := p.connSelector.LeaderConn(ctx) 1293 if err != nil { 1294 if err == raftselector.ErrIsLeader { 1295 ctx, err = p.runCtxMods(ctx, p.localCtxMods) 1296 if err != nil { 1297 return err 1298 } 1299 streamWrapper := RouteGuide_ListFeaturesServerWrapper{ 1300 RouteGuide_ListFeaturesServer: stream, 1301 ctx: ctx, 1302 } 1303 return p.local.ListFeatures(r, streamWrapper) 1304 } 1305 return err 1306 } 1307 ctx, err = p.runCtxMods(ctx, p.remoteCtxMods) 1308 if err != nil { 1309 return err 1310 } 1311 clientStream, err := NewRouteGuideClient(conn).ListFeatures(ctx, r) 1312 1313 if err != nil { 1314 return err 1315 } 1316 1317 for { 1318 msg, err := clientStream.Recv() 1319 if err == io.EOF { 1320 break 1321 } 1322 if err != nil { 1323 return err 1324 } 1325 if err := stream.Send(msg); err != nil { 1326 return err 1327 } 1328 } 1329 return nil 1330 } 1331 1332 type RouteGuide_RecordRouteServerWrapper struct { 1333 RouteGuide_RecordRouteServer 1334 ctx context.Context 1335 } 1336 1337 func (s RouteGuide_RecordRouteServerWrapper) Context() context.Context { 1338 return s.ctx 1339 } 1340 1341 func (p *raftProxyRouteGuideServer) RecordRoute(stream RouteGuide_RecordRouteServer) error { 1342 ctx := stream.Context() 1343 conn, err := p.connSelector.LeaderConn(ctx) 1344 if err != nil { 1345 if err == raftselector.ErrIsLeader { 1346 ctx, err = p.runCtxMods(ctx, p.localCtxMods) 1347 if err != nil { 1348 return err 1349 } 1350 streamWrapper := RouteGuide_RecordRouteServerWrapper{ 1351 RouteGuide_RecordRouteServer: stream, 1352 ctx: ctx, 1353 } 1354 return p.local.RecordRoute(streamWrapper) 1355 } 1356 return err 1357 } 1358 ctx, err = p.runCtxMods(ctx, p.remoteCtxMods) 1359 if err != nil { 1360 return err 1361 } 1362 clientStream, err := NewRouteGuideClient(conn).RecordRoute(ctx) 1363 1364 if err != nil { 1365 return err 1366 } 1367 1368 for { 1369 msg, err := stream.Recv() 1370 if err == io.EOF { 1371 break 1372 } 1373 if err != nil { 1374 return err 1375 } 1376 if err := clientStream.Send(msg); err != nil { 1377 return err 1378 } 1379 } 1380 1381 reply, err := clientStream.CloseAndRecv() 1382 if err != nil { 1383 return err 1384 } 1385 1386 return stream.SendAndClose(reply) 1387 } 1388 1389 type RouteGuide_RouteChatServerWrapper struct { 1390 RouteGuide_RouteChatServer 1391 ctx context.Context 1392 } 1393 1394 func (s RouteGuide_RouteChatServerWrapper) Context() context.Context { 1395 return s.ctx 1396 } 1397 1398 func (p *raftProxyRouteGuideServer) RouteChat(stream RouteGuide_RouteChatServer) error { 1399 ctx := stream.Context() 1400 conn, err := p.connSelector.LeaderConn(ctx) 1401 if err != nil { 1402 if err == raftselector.ErrIsLeader { 1403 ctx, err = p.runCtxMods(ctx, p.localCtxMods) 1404 if err != nil { 1405 return err 1406 } 1407 streamWrapper := RouteGuide_RouteChatServerWrapper{ 1408 RouteGuide_RouteChatServer: stream, 1409 ctx: ctx, 1410 } 1411 return p.local.RouteChat(streamWrapper) 1412 } 1413 return err 1414 } 1415 ctx, err = p.runCtxMods(ctx, p.remoteCtxMods) 1416 if err != nil { 1417 return err 1418 } 1419 clientStream, err := NewRouteGuideClient(conn).RouteChat(ctx) 1420 1421 if err != nil { 1422 return err 1423 } 1424 errc := make(chan error, 1) 1425 go func() { 1426 msg, err := stream.Recv() 1427 if err == io.EOF { 1428 close(errc) 1429 return 1430 } 1431 if err != nil { 1432 errc <- err 1433 return 1434 } 1435 if err := clientStream.Send(msg); err != nil { 1436 errc <- err 1437 return 1438 } 1439 }() 1440 1441 for { 1442 msg, err := clientStream.Recv() 1443 if err == io.EOF { 1444 break 1445 } 1446 if err != nil { 1447 return err 1448 } 1449 if err := stream.Send(msg); err != nil { 1450 return err 1451 } 1452 } 1453 clientStream.CloseSend() 1454 return <-errc 1455 } 1456 1457 type raftProxyHealthServer struct { 1458 local HealthServer 1459 connSelector raftselector.ConnProvider 1460 localCtxMods, remoteCtxMods []func(context.Context) (context.Context, error) 1461 } 1462 1463 func NewRaftProxyHealthServer(local HealthServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) HealthServer { 1464 redirectChecker := func(ctx context.Context) (context.Context, error) { 1465 p, ok := peer.FromContext(ctx) 1466 if !ok { 1467 return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context") 1468 } 1469 addr := p.Addr.String() 1470 md, ok := metadata.FromIncomingContext(ctx) 1471 if ok && len(md["redirect"]) != 0 { 1472 return ctx, status.Errorf(codes.ResourceExhausted, "more than one redirect to leader from: %s", md["redirect"]) 1473 } 1474 if !ok { 1475 md = metadata.New(map[string]string{}) 1476 } 1477 md["redirect"] = append(md["redirect"], addr) 1478 return metadata.NewOutgoingContext(ctx, md), nil 1479 } 1480 remoteMods := []func(context.Context) (context.Context, error){redirectChecker} 1481 remoteMods = append(remoteMods, remoteCtxMod) 1482 1483 var localMods []func(context.Context) (context.Context, error) 1484 if localCtxMod != nil { 1485 localMods = []func(context.Context) (context.Context, error){localCtxMod} 1486 } 1487 1488 return &raftProxyHealthServer{ 1489 local: local, 1490 connSelector: connSelector, 1491 localCtxMods: localMods, 1492 remoteCtxMods: remoteMods, 1493 } 1494 } 1495 func (p *raftProxyHealthServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) { 1496 var err error 1497 for _, mod := range ctxMods { 1498 ctx, err = mod(ctx) 1499 if err != nil { 1500 return ctx, err 1501 } 1502 } 1503 return ctx, nil 1504 } 1505 func (p *raftProxyHealthServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) { 1506 ticker := rafttime.NewTicker(500 * rafttime.Millisecond) 1507 defer ticker.Stop() 1508 for { 1509 select { 1510 case <-ticker.C: 1511 conn, err := p.connSelector.LeaderConn(ctx) 1512 if err != nil { 1513 return nil, err 1514 } 1515 1516 client := NewHealthClient(conn) 1517 1518 resp, err := client.Check(ctx, &HealthCheckRequest{Service: "Raft"}) 1519 if err != nil || resp.Status != HealthCheckResponse_SERVING { 1520 continue 1521 } 1522 return conn, nil 1523 case <-ctx.Done(): 1524 return nil, ctx.Err() 1525 } 1526 } 1527 } 1528 1529 func (p *raftProxyHealthServer) Check(ctx context.Context, r *HealthCheckRequest) (*HealthCheckResponse, error) { 1530 1531 conn, err := p.connSelector.LeaderConn(ctx) 1532 if err != nil { 1533 if err == raftselector.ErrIsLeader { 1534 ctx, err = p.runCtxMods(ctx, p.localCtxMods) 1535 if err != nil { 1536 return nil, err 1537 } 1538 return p.local.Check(ctx, r) 1539 } 1540 return nil, err 1541 } 1542 modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) 1543 if err != nil { 1544 return nil, err 1545 } 1546 1547 resp, err := NewHealthClient(conn).Check(modCtx, r) 1548 if err != nil { 1549 if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { 1550 return resp, err 1551 } 1552 conn, err := p.pollNewLeaderConn(ctx) 1553 if err != nil { 1554 if err == raftselector.ErrIsLeader { 1555 return p.local.Check(ctx, r) 1556 } 1557 return nil, err 1558 } 1559 return NewHealthClient(conn).Check(modCtx, r) 1560 } 1561 return resp, err 1562 } 1563 1564 func (m *Point) Size() (n int) { 1565 if m == nil { 1566 return 0 1567 } 1568 var l int 1569 _ = l 1570 if m.Latitude != 0 { 1571 n += 1 + sovService(uint64(m.Latitude)) 1572 } 1573 if m.Longitude != 0 { 1574 n += 1 + sovService(uint64(m.Longitude)) 1575 } 1576 return n 1577 } 1578 1579 func (m *Rectangle) Size() (n int) { 1580 if m == nil { 1581 return 0 1582 } 1583 var l int 1584 _ = l 1585 if m.Lo != nil { 1586 l = m.Lo.Size() 1587 n += 1 + l + sovService(uint64(l)) 1588 } 1589 if m.Hi != nil { 1590 l = m.Hi.Size() 1591 n += 1 + l + sovService(uint64(l)) 1592 } 1593 return n 1594 } 1595 1596 func (m *Feature) Size() (n int) { 1597 if m == nil { 1598 return 0 1599 } 1600 var l int 1601 _ = l 1602 l = len(m.Name) 1603 if l > 0 { 1604 n += 1 + l + sovService(uint64(l)) 1605 } 1606 if m.Location != nil { 1607 l = m.Location.Size() 1608 n += 1 + l + sovService(uint64(l)) 1609 } 1610 return n 1611 } 1612 1613 func (m *RouteNote) Size() (n int) { 1614 if m == nil { 1615 return 0 1616 } 1617 var l int 1618 _ = l 1619 if m.Location != nil { 1620 l = m.Location.Size() 1621 n += 1 + l + sovService(uint64(l)) 1622 } 1623 l = len(m.Message) 1624 if l > 0 { 1625 n += 1 + l + sovService(uint64(l)) 1626 } 1627 return n 1628 } 1629 1630 func (m *RouteSummary) Size() (n int) { 1631 if m == nil { 1632 return 0 1633 } 1634 var l int 1635 _ = l 1636 if m.PointCount != 0 { 1637 n += 1 + sovService(uint64(m.PointCount)) 1638 } 1639 if m.FeatureCount != 0 { 1640 n += 1 + sovService(uint64(m.FeatureCount)) 1641 } 1642 if m.Distance != 0 { 1643 n += 1 + sovService(uint64(m.Distance)) 1644 } 1645 if m.ElapsedTime != 0 { 1646 n += 1 + sovService(uint64(m.ElapsedTime)) 1647 } 1648 return n 1649 } 1650 1651 func (m *HealthCheckRequest) Size() (n int) { 1652 if m == nil { 1653 return 0 1654 } 1655 var l int 1656 _ = l 1657 l = len(m.Service) 1658 if l > 0 { 1659 n += 1 + l + sovService(uint64(l)) 1660 } 1661 return n 1662 } 1663 1664 func (m *HealthCheckResponse) Size() (n int) { 1665 if m == nil { 1666 return 0 1667 } 1668 var l int 1669 _ = l 1670 if m.Status != 0 { 1671 n += 1 + sovService(uint64(m.Status)) 1672 } 1673 return n 1674 } 1675 1676 func sovService(x uint64) (n int) { 1677 for { 1678 n++ 1679 x >>= 7 1680 if x == 0 { 1681 break 1682 } 1683 } 1684 return n 1685 } 1686 func sozService(x uint64) (n int) { 1687 return sovService(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 1688 } 1689 func (this *Point) String() string { 1690 if this == nil { 1691 return "nil" 1692 } 1693 s := strings.Join([]string{`&Point{`, 1694 `Latitude:` + fmt.Sprintf("%v", this.Latitude) + `,`, 1695 `Longitude:` + fmt.Sprintf("%v", this.Longitude) + `,`, 1696 `}`, 1697 }, "") 1698 return s 1699 } 1700 func (this *Rectangle) String() string { 1701 if this == nil { 1702 return "nil" 1703 } 1704 s := strings.Join([]string{`&Rectangle{`, 1705 `Lo:` + strings.Replace(fmt.Sprintf("%v", this.Lo), "Point", "Point", 1) + `,`, 1706 `Hi:` + strings.Replace(fmt.Sprintf("%v", this.Hi), "Point", "Point", 1) + `,`, 1707 `}`, 1708 }, "") 1709 return s 1710 } 1711 func (this *Feature) String() string { 1712 if this == nil { 1713 return "nil" 1714 } 1715 s := strings.Join([]string{`&Feature{`, 1716 `Name:` + fmt.Sprintf("%v", this.Name) + `,`, 1717 `Location:` + strings.Replace(fmt.Sprintf("%v", this.Location), "Point", "Point", 1) + `,`, 1718 `}`, 1719 }, "") 1720 return s 1721 } 1722 func (this *RouteNote) String() string { 1723 if this == nil { 1724 return "nil" 1725 } 1726 s := strings.Join([]string{`&RouteNote{`, 1727 `Location:` + strings.Replace(fmt.Sprintf("%v", this.Location), "Point", "Point", 1) + `,`, 1728 `Message:` + fmt.Sprintf("%v", this.Message) + `,`, 1729 `}`, 1730 }, "") 1731 return s 1732 } 1733 func (this *RouteSummary) String() string { 1734 if this == nil { 1735 return "nil" 1736 } 1737 s := strings.Join([]string{`&RouteSummary{`, 1738 `PointCount:` + fmt.Sprintf("%v", this.PointCount) + `,`, 1739 `FeatureCount:` + fmt.Sprintf("%v", this.FeatureCount) + `,`, 1740 `Distance:` + fmt.Sprintf("%v", this.Distance) + `,`, 1741 `ElapsedTime:` + fmt.Sprintf("%v", this.ElapsedTime) + `,`, 1742 `}`, 1743 }, "") 1744 return s 1745 } 1746 func (this *HealthCheckRequest) String() string { 1747 if this == nil { 1748 return "nil" 1749 } 1750 s := strings.Join([]string{`&HealthCheckRequest{`, 1751 `Service:` + fmt.Sprintf("%v", this.Service) + `,`, 1752 `}`, 1753 }, "") 1754 return s 1755 } 1756 func (this *HealthCheckResponse) String() string { 1757 if this == nil { 1758 return "nil" 1759 } 1760 s := strings.Join([]string{`&HealthCheckResponse{`, 1761 `Status:` + fmt.Sprintf("%v", this.Status) + `,`, 1762 `}`, 1763 }, "") 1764 return s 1765 } 1766 func valueToStringService(v interface{}) string { 1767 rv := reflect.ValueOf(v) 1768 if rv.IsNil() { 1769 return "nil" 1770 } 1771 pv := reflect.Indirect(rv).Interface() 1772 return fmt.Sprintf("*%v", pv) 1773 } 1774 func (m *Point) Unmarshal(dAtA []byte) error { 1775 l := len(dAtA) 1776 iNdEx := 0 1777 for iNdEx < l { 1778 preIndex := iNdEx 1779 var wire uint64 1780 for shift := uint(0); ; shift += 7 { 1781 if shift >= 64 { 1782 return ErrIntOverflowService 1783 } 1784 if iNdEx >= l { 1785 return io.ErrUnexpectedEOF 1786 } 1787 b := dAtA[iNdEx] 1788 iNdEx++ 1789 wire |= uint64(b&0x7F) << shift 1790 if b < 0x80 { 1791 break 1792 } 1793 } 1794 fieldNum := int32(wire >> 3) 1795 wireType := int(wire & 0x7) 1796 if wireType == 4 { 1797 return fmt.Errorf("proto: Point: wiretype end group for non-group") 1798 } 1799 if fieldNum <= 0 { 1800 return fmt.Errorf("proto: Point: illegal tag %d (wire type %d)", fieldNum, wire) 1801 } 1802 switch fieldNum { 1803 case 1: 1804 if wireType != 0 { 1805 return fmt.Errorf("proto: wrong wireType = %d for field Latitude", wireType) 1806 } 1807 m.Latitude = 0 1808 for shift := uint(0); ; shift += 7 { 1809 if shift >= 64 { 1810 return ErrIntOverflowService 1811 } 1812 if iNdEx >= l { 1813 return io.ErrUnexpectedEOF 1814 } 1815 b := dAtA[iNdEx] 1816 iNdEx++ 1817 m.Latitude |= int32(b&0x7F) << shift 1818 if b < 0x80 { 1819 break 1820 } 1821 } 1822 case 2: 1823 if wireType != 0 { 1824 return fmt.Errorf("proto: wrong wireType = %d for field Longitude", wireType) 1825 } 1826 m.Longitude = 0 1827 for shift := uint(0); ; shift += 7 { 1828 if shift >= 64 { 1829 return ErrIntOverflowService 1830 } 1831 if iNdEx >= l { 1832 return io.ErrUnexpectedEOF 1833 } 1834 b := dAtA[iNdEx] 1835 iNdEx++ 1836 m.Longitude |= int32(b&0x7F) << shift 1837 if b < 0x80 { 1838 break 1839 } 1840 } 1841 default: 1842 iNdEx = preIndex 1843 skippy, err := skipService(dAtA[iNdEx:]) 1844 if err != nil { 1845 return err 1846 } 1847 if skippy < 0 { 1848 return ErrInvalidLengthService 1849 } 1850 if (iNdEx + skippy) < 0 { 1851 return ErrInvalidLengthService 1852 } 1853 if (iNdEx + skippy) > l { 1854 return io.ErrUnexpectedEOF 1855 } 1856 iNdEx += skippy 1857 } 1858 } 1859 1860 if iNdEx > l { 1861 return io.ErrUnexpectedEOF 1862 } 1863 return nil 1864 } 1865 func (m *Rectangle) Unmarshal(dAtA []byte) error { 1866 l := len(dAtA) 1867 iNdEx := 0 1868 for iNdEx < l { 1869 preIndex := iNdEx 1870 var wire uint64 1871 for shift := uint(0); ; shift += 7 { 1872 if shift >= 64 { 1873 return ErrIntOverflowService 1874 } 1875 if iNdEx >= l { 1876 return io.ErrUnexpectedEOF 1877 } 1878 b := dAtA[iNdEx] 1879 iNdEx++ 1880 wire |= uint64(b&0x7F) << shift 1881 if b < 0x80 { 1882 break 1883 } 1884 } 1885 fieldNum := int32(wire >> 3) 1886 wireType := int(wire & 0x7) 1887 if wireType == 4 { 1888 return fmt.Errorf("proto: Rectangle: wiretype end group for non-group") 1889 } 1890 if fieldNum <= 0 { 1891 return fmt.Errorf("proto: Rectangle: illegal tag %d (wire type %d)", fieldNum, wire) 1892 } 1893 switch fieldNum { 1894 case 1: 1895 if wireType != 2 { 1896 return fmt.Errorf("proto: wrong wireType = %d for field Lo", wireType) 1897 } 1898 var msglen int 1899 for shift := uint(0); ; shift += 7 { 1900 if shift >= 64 { 1901 return ErrIntOverflowService 1902 } 1903 if iNdEx >= l { 1904 return io.ErrUnexpectedEOF 1905 } 1906 b := dAtA[iNdEx] 1907 iNdEx++ 1908 msglen |= int(b&0x7F) << shift 1909 if b < 0x80 { 1910 break 1911 } 1912 } 1913 if msglen < 0 { 1914 return ErrInvalidLengthService 1915 } 1916 postIndex := iNdEx + msglen 1917 if postIndex < 0 { 1918 return ErrInvalidLengthService 1919 } 1920 if postIndex > l { 1921 return io.ErrUnexpectedEOF 1922 } 1923 if m.Lo == nil { 1924 m.Lo = &Point{} 1925 } 1926 if err := m.Lo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1927 return err 1928 } 1929 iNdEx = postIndex 1930 case 2: 1931 if wireType != 2 { 1932 return fmt.Errorf("proto: wrong wireType = %d for field Hi", wireType) 1933 } 1934 var msglen int 1935 for shift := uint(0); ; shift += 7 { 1936 if shift >= 64 { 1937 return ErrIntOverflowService 1938 } 1939 if iNdEx >= l { 1940 return io.ErrUnexpectedEOF 1941 } 1942 b := dAtA[iNdEx] 1943 iNdEx++ 1944 msglen |= int(b&0x7F) << shift 1945 if b < 0x80 { 1946 break 1947 } 1948 } 1949 if msglen < 0 { 1950 return ErrInvalidLengthService 1951 } 1952 postIndex := iNdEx + msglen 1953 if postIndex < 0 { 1954 return ErrInvalidLengthService 1955 } 1956 if postIndex > l { 1957 return io.ErrUnexpectedEOF 1958 } 1959 if m.Hi == nil { 1960 m.Hi = &Point{} 1961 } 1962 if err := m.Hi.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1963 return err 1964 } 1965 iNdEx = postIndex 1966 default: 1967 iNdEx = preIndex 1968 skippy, err := skipService(dAtA[iNdEx:]) 1969 if err != nil { 1970 return err 1971 } 1972 if skippy < 0 { 1973 return ErrInvalidLengthService 1974 } 1975 if (iNdEx + skippy) < 0 { 1976 return ErrInvalidLengthService 1977 } 1978 if (iNdEx + skippy) > l { 1979 return io.ErrUnexpectedEOF 1980 } 1981 iNdEx += skippy 1982 } 1983 } 1984 1985 if iNdEx > l { 1986 return io.ErrUnexpectedEOF 1987 } 1988 return nil 1989 } 1990 func (m *Feature) Unmarshal(dAtA []byte) error { 1991 l := len(dAtA) 1992 iNdEx := 0 1993 for iNdEx < l { 1994 preIndex := iNdEx 1995 var wire uint64 1996 for shift := uint(0); ; shift += 7 { 1997 if shift >= 64 { 1998 return ErrIntOverflowService 1999 } 2000 if iNdEx >= l { 2001 return io.ErrUnexpectedEOF 2002 } 2003 b := dAtA[iNdEx] 2004 iNdEx++ 2005 wire |= uint64(b&0x7F) << shift 2006 if b < 0x80 { 2007 break 2008 } 2009 } 2010 fieldNum := int32(wire >> 3) 2011 wireType := int(wire & 0x7) 2012 if wireType == 4 { 2013 return fmt.Errorf("proto: Feature: wiretype end group for non-group") 2014 } 2015 if fieldNum <= 0 { 2016 return fmt.Errorf("proto: Feature: illegal tag %d (wire type %d)", fieldNum, wire) 2017 } 2018 switch fieldNum { 2019 case 1: 2020 if wireType != 2 { 2021 return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) 2022 } 2023 var stringLen uint64 2024 for shift := uint(0); ; shift += 7 { 2025 if shift >= 64 { 2026 return ErrIntOverflowService 2027 } 2028 if iNdEx >= l { 2029 return io.ErrUnexpectedEOF 2030 } 2031 b := dAtA[iNdEx] 2032 iNdEx++ 2033 stringLen |= uint64(b&0x7F) << shift 2034 if b < 0x80 { 2035 break 2036 } 2037 } 2038 intStringLen := int(stringLen) 2039 if intStringLen < 0 { 2040 return ErrInvalidLengthService 2041 } 2042 postIndex := iNdEx + intStringLen 2043 if postIndex < 0 { 2044 return ErrInvalidLengthService 2045 } 2046 if postIndex > l { 2047 return io.ErrUnexpectedEOF 2048 } 2049 m.Name = string(dAtA[iNdEx:postIndex]) 2050 iNdEx = postIndex 2051 case 2: 2052 if wireType != 2 { 2053 return fmt.Errorf("proto: wrong wireType = %d for field Location", wireType) 2054 } 2055 var msglen int 2056 for shift := uint(0); ; shift += 7 { 2057 if shift >= 64 { 2058 return ErrIntOverflowService 2059 } 2060 if iNdEx >= l { 2061 return io.ErrUnexpectedEOF 2062 } 2063 b := dAtA[iNdEx] 2064 iNdEx++ 2065 msglen |= int(b&0x7F) << shift 2066 if b < 0x80 { 2067 break 2068 } 2069 } 2070 if msglen < 0 { 2071 return ErrInvalidLengthService 2072 } 2073 postIndex := iNdEx + msglen 2074 if postIndex < 0 { 2075 return ErrInvalidLengthService 2076 } 2077 if postIndex > l { 2078 return io.ErrUnexpectedEOF 2079 } 2080 if m.Location == nil { 2081 m.Location = &Point{} 2082 } 2083 if err := m.Location.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 2084 return err 2085 } 2086 iNdEx = postIndex 2087 default: 2088 iNdEx = preIndex 2089 skippy, err := skipService(dAtA[iNdEx:]) 2090 if err != nil { 2091 return err 2092 } 2093 if skippy < 0 { 2094 return ErrInvalidLengthService 2095 } 2096 if (iNdEx + skippy) < 0 { 2097 return ErrInvalidLengthService 2098 } 2099 if (iNdEx + skippy) > l { 2100 return io.ErrUnexpectedEOF 2101 } 2102 iNdEx += skippy 2103 } 2104 } 2105 2106 if iNdEx > l { 2107 return io.ErrUnexpectedEOF 2108 } 2109 return nil 2110 } 2111 func (m *RouteNote) Unmarshal(dAtA []byte) error { 2112 l := len(dAtA) 2113 iNdEx := 0 2114 for iNdEx < l { 2115 preIndex := iNdEx 2116 var wire uint64 2117 for shift := uint(0); ; shift += 7 { 2118 if shift >= 64 { 2119 return ErrIntOverflowService 2120 } 2121 if iNdEx >= l { 2122 return io.ErrUnexpectedEOF 2123 } 2124 b := dAtA[iNdEx] 2125 iNdEx++ 2126 wire |= uint64(b&0x7F) << shift 2127 if b < 0x80 { 2128 break 2129 } 2130 } 2131 fieldNum := int32(wire >> 3) 2132 wireType := int(wire & 0x7) 2133 if wireType == 4 { 2134 return fmt.Errorf("proto: RouteNote: wiretype end group for non-group") 2135 } 2136 if fieldNum <= 0 { 2137 return fmt.Errorf("proto: RouteNote: illegal tag %d (wire type %d)", fieldNum, wire) 2138 } 2139 switch fieldNum { 2140 case 1: 2141 if wireType != 2 { 2142 return fmt.Errorf("proto: wrong wireType = %d for field Location", wireType) 2143 } 2144 var msglen int 2145 for shift := uint(0); ; shift += 7 { 2146 if shift >= 64 { 2147 return ErrIntOverflowService 2148 } 2149 if iNdEx >= l { 2150 return io.ErrUnexpectedEOF 2151 } 2152 b := dAtA[iNdEx] 2153 iNdEx++ 2154 msglen |= int(b&0x7F) << shift 2155 if b < 0x80 { 2156 break 2157 } 2158 } 2159 if msglen < 0 { 2160 return ErrInvalidLengthService 2161 } 2162 postIndex := iNdEx + msglen 2163 if postIndex < 0 { 2164 return ErrInvalidLengthService 2165 } 2166 if postIndex > l { 2167 return io.ErrUnexpectedEOF 2168 } 2169 if m.Location == nil { 2170 m.Location = &Point{} 2171 } 2172 if err := m.Location.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 2173 return err 2174 } 2175 iNdEx = postIndex 2176 case 2: 2177 if wireType != 2 { 2178 return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) 2179 } 2180 var stringLen uint64 2181 for shift := uint(0); ; shift += 7 { 2182 if shift >= 64 { 2183 return ErrIntOverflowService 2184 } 2185 if iNdEx >= l { 2186 return io.ErrUnexpectedEOF 2187 } 2188 b := dAtA[iNdEx] 2189 iNdEx++ 2190 stringLen |= uint64(b&0x7F) << shift 2191 if b < 0x80 { 2192 break 2193 } 2194 } 2195 intStringLen := int(stringLen) 2196 if intStringLen < 0 { 2197 return ErrInvalidLengthService 2198 } 2199 postIndex := iNdEx + intStringLen 2200 if postIndex < 0 { 2201 return ErrInvalidLengthService 2202 } 2203 if postIndex > l { 2204 return io.ErrUnexpectedEOF 2205 } 2206 m.Message = string(dAtA[iNdEx:postIndex]) 2207 iNdEx = postIndex 2208 default: 2209 iNdEx = preIndex 2210 skippy, err := skipService(dAtA[iNdEx:]) 2211 if err != nil { 2212 return err 2213 } 2214 if skippy < 0 { 2215 return ErrInvalidLengthService 2216 } 2217 if (iNdEx + skippy) < 0 { 2218 return ErrInvalidLengthService 2219 } 2220 if (iNdEx + skippy) > l { 2221 return io.ErrUnexpectedEOF 2222 } 2223 iNdEx += skippy 2224 } 2225 } 2226 2227 if iNdEx > l { 2228 return io.ErrUnexpectedEOF 2229 } 2230 return nil 2231 } 2232 func (m *RouteSummary) Unmarshal(dAtA []byte) error { 2233 l := len(dAtA) 2234 iNdEx := 0 2235 for iNdEx < l { 2236 preIndex := iNdEx 2237 var wire uint64 2238 for shift := uint(0); ; shift += 7 { 2239 if shift >= 64 { 2240 return ErrIntOverflowService 2241 } 2242 if iNdEx >= l { 2243 return io.ErrUnexpectedEOF 2244 } 2245 b := dAtA[iNdEx] 2246 iNdEx++ 2247 wire |= uint64(b&0x7F) << shift 2248 if b < 0x80 { 2249 break 2250 } 2251 } 2252 fieldNum := int32(wire >> 3) 2253 wireType := int(wire & 0x7) 2254 if wireType == 4 { 2255 return fmt.Errorf("proto: RouteSummary: wiretype end group for non-group") 2256 } 2257 if fieldNum <= 0 { 2258 return fmt.Errorf("proto: RouteSummary: illegal tag %d (wire type %d)", fieldNum, wire) 2259 } 2260 switch fieldNum { 2261 case 1: 2262 if wireType != 0 { 2263 return fmt.Errorf("proto: wrong wireType = %d for field PointCount", wireType) 2264 } 2265 m.PointCount = 0 2266 for shift := uint(0); ; shift += 7 { 2267 if shift >= 64 { 2268 return ErrIntOverflowService 2269 } 2270 if iNdEx >= l { 2271 return io.ErrUnexpectedEOF 2272 } 2273 b := dAtA[iNdEx] 2274 iNdEx++ 2275 m.PointCount |= int32(b&0x7F) << shift 2276 if b < 0x80 { 2277 break 2278 } 2279 } 2280 case 2: 2281 if wireType != 0 { 2282 return fmt.Errorf("proto: wrong wireType = %d for field FeatureCount", wireType) 2283 } 2284 m.FeatureCount = 0 2285 for shift := uint(0); ; shift += 7 { 2286 if shift >= 64 { 2287 return ErrIntOverflowService 2288 } 2289 if iNdEx >= l { 2290 return io.ErrUnexpectedEOF 2291 } 2292 b := dAtA[iNdEx] 2293 iNdEx++ 2294 m.FeatureCount |= int32(b&0x7F) << shift 2295 if b < 0x80 { 2296 break 2297 } 2298 } 2299 case 3: 2300 if wireType != 0 { 2301 return fmt.Errorf("proto: wrong wireType = %d for field Distance", wireType) 2302 } 2303 m.Distance = 0 2304 for shift := uint(0); ; shift += 7 { 2305 if shift >= 64 { 2306 return ErrIntOverflowService 2307 } 2308 if iNdEx >= l { 2309 return io.ErrUnexpectedEOF 2310 } 2311 b := dAtA[iNdEx] 2312 iNdEx++ 2313 m.Distance |= int32(b&0x7F) << shift 2314 if b < 0x80 { 2315 break 2316 } 2317 } 2318 case 4: 2319 if wireType != 0 { 2320 return fmt.Errorf("proto: wrong wireType = %d for field ElapsedTime", wireType) 2321 } 2322 m.ElapsedTime = 0 2323 for shift := uint(0); ; shift += 7 { 2324 if shift >= 64 { 2325 return ErrIntOverflowService 2326 } 2327 if iNdEx >= l { 2328 return io.ErrUnexpectedEOF 2329 } 2330 b := dAtA[iNdEx] 2331 iNdEx++ 2332 m.ElapsedTime |= int32(b&0x7F) << shift 2333 if b < 0x80 { 2334 break 2335 } 2336 } 2337 default: 2338 iNdEx = preIndex 2339 skippy, err := skipService(dAtA[iNdEx:]) 2340 if err != nil { 2341 return err 2342 } 2343 if skippy < 0 { 2344 return ErrInvalidLengthService 2345 } 2346 if (iNdEx + skippy) < 0 { 2347 return ErrInvalidLengthService 2348 } 2349 if (iNdEx + skippy) > l { 2350 return io.ErrUnexpectedEOF 2351 } 2352 iNdEx += skippy 2353 } 2354 } 2355 2356 if iNdEx > l { 2357 return io.ErrUnexpectedEOF 2358 } 2359 return nil 2360 } 2361 func (m *HealthCheckRequest) Unmarshal(dAtA []byte) error { 2362 l := len(dAtA) 2363 iNdEx := 0 2364 for iNdEx < l { 2365 preIndex := iNdEx 2366 var wire uint64 2367 for shift := uint(0); ; shift += 7 { 2368 if shift >= 64 { 2369 return ErrIntOverflowService 2370 } 2371 if iNdEx >= l { 2372 return io.ErrUnexpectedEOF 2373 } 2374 b := dAtA[iNdEx] 2375 iNdEx++ 2376 wire |= uint64(b&0x7F) << shift 2377 if b < 0x80 { 2378 break 2379 } 2380 } 2381 fieldNum := int32(wire >> 3) 2382 wireType := int(wire & 0x7) 2383 if wireType == 4 { 2384 return fmt.Errorf("proto: HealthCheckRequest: wiretype end group for non-group") 2385 } 2386 if fieldNum <= 0 { 2387 return fmt.Errorf("proto: HealthCheckRequest: illegal tag %d (wire type %d)", fieldNum, wire) 2388 } 2389 switch fieldNum { 2390 case 1: 2391 if wireType != 2 { 2392 return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) 2393 } 2394 var stringLen uint64 2395 for shift := uint(0); ; shift += 7 { 2396 if shift >= 64 { 2397 return ErrIntOverflowService 2398 } 2399 if iNdEx >= l { 2400 return io.ErrUnexpectedEOF 2401 } 2402 b := dAtA[iNdEx] 2403 iNdEx++ 2404 stringLen |= uint64(b&0x7F) << shift 2405 if b < 0x80 { 2406 break 2407 } 2408 } 2409 intStringLen := int(stringLen) 2410 if intStringLen < 0 { 2411 return ErrInvalidLengthService 2412 } 2413 postIndex := iNdEx + intStringLen 2414 if postIndex < 0 { 2415 return ErrInvalidLengthService 2416 } 2417 if postIndex > l { 2418 return io.ErrUnexpectedEOF 2419 } 2420 m.Service = string(dAtA[iNdEx:postIndex]) 2421 iNdEx = postIndex 2422 default: 2423 iNdEx = preIndex 2424 skippy, err := skipService(dAtA[iNdEx:]) 2425 if err != nil { 2426 return err 2427 } 2428 if skippy < 0 { 2429 return ErrInvalidLengthService 2430 } 2431 if (iNdEx + skippy) < 0 { 2432 return ErrInvalidLengthService 2433 } 2434 if (iNdEx + skippy) > l { 2435 return io.ErrUnexpectedEOF 2436 } 2437 iNdEx += skippy 2438 } 2439 } 2440 2441 if iNdEx > l { 2442 return io.ErrUnexpectedEOF 2443 } 2444 return nil 2445 } 2446 func (m *HealthCheckResponse) Unmarshal(dAtA []byte) error { 2447 l := len(dAtA) 2448 iNdEx := 0 2449 for iNdEx < l { 2450 preIndex := iNdEx 2451 var wire uint64 2452 for shift := uint(0); ; shift += 7 { 2453 if shift >= 64 { 2454 return ErrIntOverflowService 2455 } 2456 if iNdEx >= l { 2457 return io.ErrUnexpectedEOF 2458 } 2459 b := dAtA[iNdEx] 2460 iNdEx++ 2461 wire |= uint64(b&0x7F) << shift 2462 if b < 0x80 { 2463 break 2464 } 2465 } 2466 fieldNum := int32(wire >> 3) 2467 wireType := int(wire & 0x7) 2468 if wireType == 4 { 2469 return fmt.Errorf("proto: HealthCheckResponse: wiretype end group for non-group") 2470 } 2471 if fieldNum <= 0 { 2472 return fmt.Errorf("proto: HealthCheckResponse: illegal tag %d (wire type %d)", fieldNum, wire) 2473 } 2474 switch fieldNum { 2475 case 1: 2476 if wireType != 0 { 2477 return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) 2478 } 2479 m.Status = 0 2480 for shift := uint(0); ; shift += 7 { 2481 if shift >= 64 { 2482 return ErrIntOverflowService 2483 } 2484 if iNdEx >= l { 2485 return io.ErrUnexpectedEOF 2486 } 2487 b := dAtA[iNdEx] 2488 iNdEx++ 2489 m.Status |= HealthCheckResponse_ServingStatus(b&0x7F) << shift 2490 if b < 0x80 { 2491 break 2492 } 2493 } 2494 default: 2495 iNdEx = preIndex 2496 skippy, err := skipService(dAtA[iNdEx:]) 2497 if err != nil { 2498 return err 2499 } 2500 if skippy < 0 { 2501 return ErrInvalidLengthService 2502 } 2503 if (iNdEx + skippy) < 0 { 2504 return ErrInvalidLengthService 2505 } 2506 if (iNdEx + skippy) > l { 2507 return io.ErrUnexpectedEOF 2508 } 2509 iNdEx += skippy 2510 } 2511 } 2512 2513 if iNdEx > l { 2514 return io.ErrUnexpectedEOF 2515 } 2516 return nil 2517 } 2518 func skipService(dAtA []byte) (n int, err error) { 2519 l := len(dAtA) 2520 iNdEx := 0 2521 for iNdEx < l { 2522 var wire uint64 2523 for shift := uint(0); ; shift += 7 { 2524 if shift >= 64 { 2525 return 0, ErrIntOverflowService 2526 } 2527 if iNdEx >= l { 2528 return 0, io.ErrUnexpectedEOF 2529 } 2530 b := dAtA[iNdEx] 2531 iNdEx++ 2532 wire |= (uint64(b) & 0x7F) << shift 2533 if b < 0x80 { 2534 break 2535 } 2536 } 2537 wireType := int(wire & 0x7) 2538 switch wireType { 2539 case 0: 2540 for shift := uint(0); ; shift += 7 { 2541 if shift >= 64 { 2542 return 0, ErrIntOverflowService 2543 } 2544 if iNdEx >= l { 2545 return 0, io.ErrUnexpectedEOF 2546 } 2547 iNdEx++ 2548 if dAtA[iNdEx-1] < 0x80 { 2549 break 2550 } 2551 } 2552 return iNdEx, nil 2553 case 1: 2554 iNdEx += 8 2555 return iNdEx, nil 2556 case 2: 2557 var length int 2558 for shift := uint(0); ; shift += 7 { 2559 if shift >= 64 { 2560 return 0, ErrIntOverflowService 2561 } 2562 if iNdEx >= l { 2563 return 0, io.ErrUnexpectedEOF 2564 } 2565 b := dAtA[iNdEx] 2566 iNdEx++ 2567 length |= (int(b) & 0x7F) << shift 2568 if b < 0x80 { 2569 break 2570 } 2571 } 2572 if length < 0 { 2573 return 0, ErrInvalidLengthService 2574 } 2575 iNdEx += length 2576 if iNdEx < 0 { 2577 return 0, ErrInvalidLengthService 2578 } 2579 return iNdEx, nil 2580 case 3: 2581 for { 2582 var innerWire uint64 2583 var start int = iNdEx 2584 for shift := uint(0); ; shift += 7 { 2585 if shift >= 64 { 2586 return 0, ErrIntOverflowService 2587 } 2588 if iNdEx >= l { 2589 return 0, io.ErrUnexpectedEOF 2590 } 2591 b := dAtA[iNdEx] 2592 iNdEx++ 2593 innerWire |= (uint64(b) & 0x7F) << shift 2594 if b < 0x80 { 2595 break 2596 } 2597 } 2598 innerWireType := int(innerWire & 0x7) 2599 if innerWireType == 4 { 2600 break 2601 } 2602 next, err := skipService(dAtA[start:]) 2603 if err != nil { 2604 return 0, err 2605 } 2606 iNdEx = start + next 2607 if iNdEx < 0 { 2608 return 0, ErrInvalidLengthService 2609 } 2610 } 2611 return iNdEx, nil 2612 case 4: 2613 return iNdEx, nil 2614 case 5: 2615 iNdEx += 4 2616 return iNdEx, nil 2617 default: 2618 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 2619 } 2620 } 2621 panic("unreachable") 2622 } 2623 2624 var ( 2625 ErrInvalidLengthService = fmt.Errorf("proto: negative length found during unmarshaling") 2626 ErrIntOverflowService = fmt.Errorf("proto: integer overflow") 2627 )