github.com/micro/go-micro/v2@v2.9.1/network/service/proto/network.pb.go (about) 1 // Code generated by protoc-gen-go. DO NOT EDIT. 2 // source: network/service/proto/network.proto 3 4 package go_micro_network 5 6 import ( 7 context "context" 8 fmt "fmt" 9 proto "github.com/golang/protobuf/proto" 10 proto1 "github.com/micro/go-micro/v2/router/service/proto" 11 grpc "google.golang.org/grpc" 12 codes "google.golang.org/grpc/codes" 13 status "google.golang.org/grpc/status" 14 math "math" 15 ) 16 17 // Reference imports to suppress errors if they are not otherwise used. 18 var _ = proto.Marshal 19 var _ = fmt.Errorf 20 var _ = math.Inf 21 22 // This is a compile-time assertion to ensure that this generated file 23 // is compatible with the proto package it is being compiled against. 24 // A compilation error at this line likely means your copy of the 25 // proto package needs to be updated. 26 const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package 27 28 // Query is passed in a LookupRequest 29 type Query struct { 30 Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` 31 Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` 32 Gateway string `protobuf:"bytes,3,opt,name=gateway,proto3" json:"gateway,omitempty"` 33 Router string `protobuf:"bytes,4,opt,name=router,proto3" json:"router,omitempty"` 34 Network string `protobuf:"bytes,5,opt,name=network,proto3" json:"network,omitempty"` 35 XXX_NoUnkeyedLiteral struct{} `json:"-"` 36 XXX_unrecognized []byte `json:"-"` 37 XXX_sizecache int32 `json:"-"` 38 } 39 40 func (m *Query) Reset() { *m = Query{} } 41 func (m *Query) String() string { return proto.CompactTextString(m) } 42 func (*Query) ProtoMessage() {} 43 func (*Query) Descriptor() ([]byte, []int) { 44 return fileDescriptor_1aab434177f140e0, []int{0} 45 } 46 47 func (m *Query) XXX_Unmarshal(b []byte) error { 48 return xxx_messageInfo_Query.Unmarshal(m, b) 49 } 50 func (m *Query) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 51 return xxx_messageInfo_Query.Marshal(b, m, deterministic) 52 } 53 func (m *Query) XXX_Merge(src proto.Message) { 54 xxx_messageInfo_Query.Merge(m, src) 55 } 56 func (m *Query) XXX_Size() int { 57 return xxx_messageInfo_Query.Size(m) 58 } 59 func (m *Query) XXX_DiscardUnknown() { 60 xxx_messageInfo_Query.DiscardUnknown(m) 61 } 62 63 var xxx_messageInfo_Query proto.InternalMessageInfo 64 65 func (m *Query) GetService() string { 66 if m != nil { 67 return m.Service 68 } 69 return "" 70 } 71 72 func (m *Query) GetAddress() string { 73 if m != nil { 74 return m.Address 75 } 76 return "" 77 } 78 79 func (m *Query) GetGateway() string { 80 if m != nil { 81 return m.Gateway 82 } 83 return "" 84 } 85 86 func (m *Query) GetRouter() string { 87 if m != nil { 88 return m.Router 89 } 90 return "" 91 } 92 93 func (m *Query) GetNetwork() string { 94 if m != nil { 95 return m.Network 96 } 97 return "" 98 } 99 100 type ConnectRequest struct { 101 Nodes []*Node `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` 102 XXX_NoUnkeyedLiteral struct{} `json:"-"` 103 XXX_unrecognized []byte `json:"-"` 104 XXX_sizecache int32 `json:"-"` 105 } 106 107 func (m *ConnectRequest) Reset() { *m = ConnectRequest{} } 108 func (m *ConnectRequest) String() string { return proto.CompactTextString(m) } 109 func (*ConnectRequest) ProtoMessage() {} 110 func (*ConnectRequest) Descriptor() ([]byte, []int) { 111 return fileDescriptor_1aab434177f140e0, []int{1} 112 } 113 114 func (m *ConnectRequest) XXX_Unmarshal(b []byte) error { 115 return xxx_messageInfo_ConnectRequest.Unmarshal(m, b) 116 } 117 func (m *ConnectRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 118 return xxx_messageInfo_ConnectRequest.Marshal(b, m, deterministic) 119 } 120 func (m *ConnectRequest) XXX_Merge(src proto.Message) { 121 xxx_messageInfo_ConnectRequest.Merge(m, src) 122 } 123 func (m *ConnectRequest) XXX_Size() int { 124 return xxx_messageInfo_ConnectRequest.Size(m) 125 } 126 func (m *ConnectRequest) XXX_DiscardUnknown() { 127 xxx_messageInfo_ConnectRequest.DiscardUnknown(m) 128 } 129 130 var xxx_messageInfo_ConnectRequest proto.InternalMessageInfo 131 132 func (m *ConnectRequest) GetNodes() []*Node { 133 if m != nil { 134 return m.Nodes 135 } 136 return nil 137 } 138 139 type ConnectResponse struct { 140 XXX_NoUnkeyedLiteral struct{} `json:"-"` 141 XXX_unrecognized []byte `json:"-"` 142 XXX_sizecache int32 `json:"-"` 143 } 144 145 func (m *ConnectResponse) Reset() { *m = ConnectResponse{} } 146 func (m *ConnectResponse) String() string { return proto.CompactTextString(m) } 147 func (*ConnectResponse) ProtoMessage() {} 148 func (*ConnectResponse) Descriptor() ([]byte, []int) { 149 return fileDescriptor_1aab434177f140e0, []int{2} 150 } 151 152 func (m *ConnectResponse) XXX_Unmarshal(b []byte) error { 153 return xxx_messageInfo_ConnectResponse.Unmarshal(m, b) 154 } 155 func (m *ConnectResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 156 return xxx_messageInfo_ConnectResponse.Marshal(b, m, deterministic) 157 } 158 func (m *ConnectResponse) XXX_Merge(src proto.Message) { 159 xxx_messageInfo_ConnectResponse.Merge(m, src) 160 } 161 func (m *ConnectResponse) XXX_Size() int { 162 return xxx_messageInfo_ConnectResponse.Size(m) 163 } 164 func (m *ConnectResponse) XXX_DiscardUnknown() { 165 xxx_messageInfo_ConnectResponse.DiscardUnknown(m) 166 } 167 168 var xxx_messageInfo_ConnectResponse proto.InternalMessageInfo 169 170 // PeerRequest requests list of peers 171 type NodesRequest struct { 172 // node topology depth 173 Depth uint32 `protobuf:"varint,1,opt,name=depth,proto3" json:"depth,omitempty"` 174 XXX_NoUnkeyedLiteral struct{} `json:"-"` 175 XXX_unrecognized []byte `json:"-"` 176 XXX_sizecache int32 `json:"-"` 177 } 178 179 func (m *NodesRequest) Reset() { *m = NodesRequest{} } 180 func (m *NodesRequest) String() string { return proto.CompactTextString(m) } 181 func (*NodesRequest) ProtoMessage() {} 182 func (*NodesRequest) Descriptor() ([]byte, []int) { 183 return fileDescriptor_1aab434177f140e0, []int{3} 184 } 185 186 func (m *NodesRequest) XXX_Unmarshal(b []byte) error { 187 return xxx_messageInfo_NodesRequest.Unmarshal(m, b) 188 } 189 func (m *NodesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 190 return xxx_messageInfo_NodesRequest.Marshal(b, m, deterministic) 191 } 192 func (m *NodesRequest) XXX_Merge(src proto.Message) { 193 xxx_messageInfo_NodesRequest.Merge(m, src) 194 } 195 func (m *NodesRequest) XXX_Size() int { 196 return xxx_messageInfo_NodesRequest.Size(m) 197 } 198 func (m *NodesRequest) XXX_DiscardUnknown() { 199 xxx_messageInfo_NodesRequest.DiscardUnknown(m) 200 } 201 202 var xxx_messageInfo_NodesRequest proto.InternalMessageInfo 203 204 func (m *NodesRequest) GetDepth() uint32 { 205 if m != nil { 206 return m.Depth 207 } 208 return 0 209 } 210 211 // PeerResponse is returned by ListPeers 212 type NodesResponse struct { 213 // return peer topology 214 Nodes []*Node `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` 215 XXX_NoUnkeyedLiteral struct{} `json:"-"` 216 XXX_unrecognized []byte `json:"-"` 217 XXX_sizecache int32 `json:"-"` 218 } 219 220 func (m *NodesResponse) Reset() { *m = NodesResponse{} } 221 func (m *NodesResponse) String() string { return proto.CompactTextString(m) } 222 func (*NodesResponse) ProtoMessage() {} 223 func (*NodesResponse) Descriptor() ([]byte, []int) { 224 return fileDescriptor_1aab434177f140e0, []int{4} 225 } 226 227 func (m *NodesResponse) XXX_Unmarshal(b []byte) error { 228 return xxx_messageInfo_NodesResponse.Unmarshal(m, b) 229 } 230 func (m *NodesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 231 return xxx_messageInfo_NodesResponse.Marshal(b, m, deterministic) 232 } 233 func (m *NodesResponse) XXX_Merge(src proto.Message) { 234 xxx_messageInfo_NodesResponse.Merge(m, src) 235 } 236 func (m *NodesResponse) XXX_Size() int { 237 return xxx_messageInfo_NodesResponse.Size(m) 238 } 239 func (m *NodesResponse) XXX_DiscardUnknown() { 240 xxx_messageInfo_NodesResponse.DiscardUnknown(m) 241 } 242 243 var xxx_messageInfo_NodesResponse proto.InternalMessageInfo 244 245 func (m *NodesResponse) GetNodes() []*Node { 246 if m != nil { 247 return m.Nodes 248 } 249 return nil 250 } 251 252 type GraphRequest struct { 253 // node topology depth 254 Depth uint32 `protobuf:"varint,1,opt,name=depth,proto3" json:"depth,omitempty"` 255 XXX_NoUnkeyedLiteral struct{} `json:"-"` 256 XXX_unrecognized []byte `json:"-"` 257 XXX_sizecache int32 `json:"-"` 258 } 259 260 func (m *GraphRequest) Reset() { *m = GraphRequest{} } 261 func (m *GraphRequest) String() string { return proto.CompactTextString(m) } 262 func (*GraphRequest) ProtoMessage() {} 263 func (*GraphRequest) Descriptor() ([]byte, []int) { 264 return fileDescriptor_1aab434177f140e0, []int{5} 265 } 266 267 func (m *GraphRequest) XXX_Unmarshal(b []byte) error { 268 return xxx_messageInfo_GraphRequest.Unmarshal(m, b) 269 } 270 func (m *GraphRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 271 return xxx_messageInfo_GraphRequest.Marshal(b, m, deterministic) 272 } 273 func (m *GraphRequest) XXX_Merge(src proto.Message) { 274 xxx_messageInfo_GraphRequest.Merge(m, src) 275 } 276 func (m *GraphRequest) XXX_Size() int { 277 return xxx_messageInfo_GraphRequest.Size(m) 278 } 279 func (m *GraphRequest) XXX_DiscardUnknown() { 280 xxx_messageInfo_GraphRequest.DiscardUnknown(m) 281 } 282 283 var xxx_messageInfo_GraphRequest proto.InternalMessageInfo 284 285 func (m *GraphRequest) GetDepth() uint32 { 286 if m != nil { 287 return m.Depth 288 } 289 return 0 290 } 291 292 type GraphResponse struct { 293 Root *Peer `protobuf:"bytes,1,opt,name=root,proto3" json:"root,omitempty"` 294 XXX_NoUnkeyedLiteral struct{} `json:"-"` 295 XXX_unrecognized []byte `json:"-"` 296 XXX_sizecache int32 `json:"-"` 297 } 298 299 func (m *GraphResponse) Reset() { *m = GraphResponse{} } 300 func (m *GraphResponse) String() string { return proto.CompactTextString(m) } 301 func (*GraphResponse) ProtoMessage() {} 302 func (*GraphResponse) Descriptor() ([]byte, []int) { 303 return fileDescriptor_1aab434177f140e0, []int{6} 304 } 305 306 func (m *GraphResponse) XXX_Unmarshal(b []byte) error { 307 return xxx_messageInfo_GraphResponse.Unmarshal(m, b) 308 } 309 func (m *GraphResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 310 return xxx_messageInfo_GraphResponse.Marshal(b, m, deterministic) 311 } 312 func (m *GraphResponse) XXX_Merge(src proto.Message) { 313 xxx_messageInfo_GraphResponse.Merge(m, src) 314 } 315 func (m *GraphResponse) XXX_Size() int { 316 return xxx_messageInfo_GraphResponse.Size(m) 317 } 318 func (m *GraphResponse) XXX_DiscardUnknown() { 319 xxx_messageInfo_GraphResponse.DiscardUnknown(m) 320 } 321 322 var xxx_messageInfo_GraphResponse proto.InternalMessageInfo 323 324 func (m *GraphResponse) GetRoot() *Peer { 325 if m != nil { 326 return m.Root 327 } 328 return nil 329 } 330 331 type RoutesRequest struct { 332 // filter based on 333 Query *Query `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` 334 XXX_NoUnkeyedLiteral struct{} `json:"-"` 335 XXX_unrecognized []byte `json:"-"` 336 XXX_sizecache int32 `json:"-"` 337 } 338 339 func (m *RoutesRequest) Reset() { *m = RoutesRequest{} } 340 func (m *RoutesRequest) String() string { return proto.CompactTextString(m) } 341 func (*RoutesRequest) ProtoMessage() {} 342 func (*RoutesRequest) Descriptor() ([]byte, []int) { 343 return fileDescriptor_1aab434177f140e0, []int{7} 344 } 345 346 func (m *RoutesRequest) XXX_Unmarshal(b []byte) error { 347 return xxx_messageInfo_RoutesRequest.Unmarshal(m, b) 348 } 349 func (m *RoutesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 350 return xxx_messageInfo_RoutesRequest.Marshal(b, m, deterministic) 351 } 352 func (m *RoutesRequest) XXX_Merge(src proto.Message) { 353 xxx_messageInfo_RoutesRequest.Merge(m, src) 354 } 355 func (m *RoutesRequest) XXX_Size() int { 356 return xxx_messageInfo_RoutesRequest.Size(m) 357 } 358 func (m *RoutesRequest) XXX_DiscardUnknown() { 359 xxx_messageInfo_RoutesRequest.DiscardUnknown(m) 360 } 361 362 var xxx_messageInfo_RoutesRequest proto.InternalMessageInfo 363 364 func (m *RoutesRequest) GetQuery() *Query { 365 if m != nil { 366 return m.Query 367 } 368 return nil 369 } 370 371 type RoutesResponse struct { 372 Routes []*proto1.Route `protobuf:"bytes,1,rep,name=routes,proto3" json:"routes,omitempty"` 373 XXX_NoUnkeyedLiteral struct{} `json:"-"` 374 XXX_unrecognized []byte `json:"-"` 375 XXX_sizecache int32 `json:"-"` 376 } 377 378 func (m *RoutesResponse) Reset() { *m = RoutesResponse{} } 379 func (m *RoutesResponse) String() string { return proto.CompactTextString(m) } 380 func (*RoutesResponse) ProtoMessage() {} 381 func (*RoutesResponse) Descriptor() ([]byte, []int) { 382 return fileDescriptor_1aab434177f140e0, []int{8} 383 } 384 385 func (m *RoutesResponse) XXX_Unmarshal(b []byte) error { 386 return xxx_messageInfo_RoutesResponse.Unmarshal(m, b) 387 } 388 func (m *RoutesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 389 return xxx_messageInfo_RoutesResponse.Marshal(b, m, deterministic) 390 } 391 func (m *RoutesResponse) XXX_Merge(src proto.Message) { 392 xxx_messageInfo_RoutesResponse.Merge(m, src) 393 } 394 func (m *RoutesResponse) XXX_Size() int { 395 return xxx_messageInfo_RoutesResponse.Size(m) 396 } 397 func (m *RoutesResponse) XXX_DiscardUnknown() { 398 xxx_messageInfo_RoutesResponse.DiscardUnknown(m) 399 } 400 401 var xxx_messageInfo_RoutesResponse proto.InternalMessageInfo 402 403 func (m *RoutesResponse) GetRoutes() []*proto1.Route { 404 if m != nil { 405 return m.Routes 406 } 407 return nil 408 } 409 410 type ServicesRequest struct { 411 XXX_NoUnkeyedLiteral struct{} `json:"-"` 412 XXX_unrecognized []byte `json:"-"` 413 XXX_sizecache int32 `json:"-"` 414 } 415 416 func (m *ServicesRequest) Reset() { *m = ServicesRequest{} } 417 func (m *ServicesRequest) String() string { return proto.CompactTextString(m) } 418 func (*ServicesRequest) ProtoMessage() {} 419 func (*ServicesRequest) Descriptor() ([]byte, []int) { 420 return fileDescriptor_1aab434177f140e0, []int{9} 421 } 422 423 func (m *ServicesRequest) XXX_Unmarshal(b []byte) error { 424 return xxx_messageInfo_ServicesRequest.Unmarshal(m, b) 425 } 426 func (m *ServicesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 427 return xxx_messageInfo_ServicesRequest.Marshal(b, m, deterministic) 428 } 429 func (m *ServicesRequest) XXX_Merge(src proto.Message) { 430 xxx_messageInfo_ServicesRequest.Merge(m, src) 431 } 432 func (m *ServicesRequest) XXX_Size() int { 433 return xxx_messageInfo_ServicesRequest.Size(m) 434 } 435 func (m *ServicesRequest) XXX_DiscardUnknown() { 436 xxx_messageInfo_ServicesRequest.DiscardUnknown(m) 437 } 438 439 var xxx_messageInfo_ServicesRequest proto.InternalMessageInfo 440 441 type ServicesResponse struct { 442 Services []string `protobuf:"bytes,1,rep,name=services,proto3" json:"services,omitempty"` 443 XXX_NoUnkeyedLiteral struct{} `json:"-"` 444 XXX_unrecognized []byte `json:"-"` 445 XXX_sizecache int32 `json:"-"` 446 } 447 448 func (m *ServicesResponse) Reset() { *m = ServicesResponse{} } 449 func (m *ServicesResponse) String() string { return proto.CompactTextString(m) } 450 func (*ServicesResponse) ProtoMessage() {} 451 func (*ServicesResponse) Descriptor() ([]byte, []int) { 452 return fileDescriptor_1aab434177f140e0, []int{10} 453 } 454 455 func (m *ServicesResponse) XXX_Unmarshal(b []byte) error { 456 return xxx_messageInfo_ServicesResponse.Unmarshal(m, b) 457 } 458 func (m *ServicesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 459 return xxx_messageInfo_ServicesResponse.Marshal(b, m, deterministic) 460 } 461 func (m *ServicesResponse) XXX_Merge(src proto.Message) { 462 xxx_messageInfo_ServicesResponse.Merge(m, src) 463 } 464 func (m *ServicesResponse) XXX_Size() int { 465 return xxx_messageInfo_ServicesResponse.Size(m) 466 } 467 func (m *ServicesResponse) XXX_DiscardUnknown() { 468 xxx_messageInfo_ServicesResponse.DiscardUnknown(m) 469 } 470 471 var xxx_messageInfo_ServicesResponse proto.InternalMessageInfo 472 473 func (m *ServicesResponse) GetServices() []string { 474 if m != nil { 475 return m.Services 476 } 477 return nil 478 } 479 480 type StatusRequest struct { 481 XXX_NoUnkeyedLiteral struct{} `json:"-"` 482 XXX_unrecognized []byte `json:"-"` 483 XXX_sizecache int32 `json:"-"` 484 } 485 486 func (m *StatusRequest) Reset() { *m = StatusRequest{} } 487 func (m *StatusRequest) String() string { return proto.CompactTextString(m) } 488 func (*StatusRequest) ProtoMessage() {} 489 func (*StatusRequest) Descriptor() ([]byte, []int) { 490 return fileDescriptor_1aab434177f140e0, []int{11} 491 } 492 493 func (m *StatusRequest) XXX_Unmarshal(b []byte) error { 494 return xxx_messageInfo_StatusRequest.Unmarshal(m, b) 495 } 496 func (m *StatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 497 return xxx_messageInfo_StatusRequest.Marshal(b, m, deterministic) 498 } 499 func (m *StatusRequest) XXX_Merge(src proto.Message) { 500 xxx_messageInfo_StatusRequest.Merge(m, src) 501 } 502 func (m *StatusRequest) XXX_Size() int { 503 return xxx_messageInfo_StatusRequest.Size(m) 504 } 505 func (m *StatusRequest) XXX_DiscardUnknown() { 506 xxx_messageInfo_StatusRequest.DiscardUnknown(m) 507 } 508 509 var xxx_messageInfo_StatusRequest proto.InternalMessageInfo 510 511 type StatusResponse struct { 512 Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` 513 XXX_NoUnkeyedLiteral struct{} `json:"-"` 514 XXX_unrecognized []byte `json:"-"` 515 XXX_sizecache int32 `json:"-"` 516 } 517 518 func (m *StatusResponse) Reset() { *m = StatusResponse{} } 519 func (m *StatusResponse) String() string { return proto.CompactTextString(m) } 520 func (*StatusResponse) ProtoMessage() {} 521 func (*StatusResponse) Descriptor() ([]byte, []int) { 522 return fileDescriptor_1aab434177f140e0, []int{12} 523 } 524 525 func (m *StatusResponse) XXX_Unmarshal(b []byte) error { 526 return xxx_messageInfo_StatusResponse.Unmarshal(m, b) 527 } 528 func (m *StatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 529 return xxx_messageInfo_StatusResponse.Marshal(b, m, deterministic) 530 } 531 func (m *StatusResponse) XXX_Merge(src proto.Message) { 532 xxx_messageInfo_StatusResponse.Merge(m, src) 533 } 534 func (m *StatusResponse) XXX_Size() int { 535 return xxx_messageInfo_StatusResponse.Size(m) 536 } 537 func (m *StatusResponse) XXX_DiscardUnknown() { 538 xxx_messageInfo_StatusResponse.DiscardUnknown(m) 539 } 540 541 var xxx_messageInfo_StatusResponse proto.InternalMessageInfo 542 543 func (m *StatusResponse) GetStatus() *Status { 544 if m != nil { 545 return m.Status 546 } 547 return nil 548 } 549 550 // Error tracks network errors 551 type Error struct { 552 Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` 553 Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` 554 XXX_NoUnkeyedLiteral struct{} `json:"-"` 555 XXX_unrecognized []byte `json:"-"` 556 XXX_sizecache int32 `json:"-"` 557 } 558 559 func (m *Error) Reset() { *m = Error{} } 560 func (m *Error) String() string { return proto.CompactTextString(m) } 561 func (*Error) ProtoMessage() {} 562 func (*Error) Descriptor() ([]byte, []int) { 563 return fileDescriptor_1aab434177f140e0, []int{13} 564 } 565 566 func (m *Error) XXX_Unmarshal(b []byte) error { 567 return xxx_messageInfo_Error.Unmarshal(m, b) 568 } 569 func (m *Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 570 return xxx_messageInfo_Error.Marshal(b, m, deterministic) 571 } 572 func (m *Error) XXX_Merge(src proto.Message) { 573 xxx_messageInfo_Error.Merge(m, src) 574 } 575 func (m *Error) XXX_Size() int { 576 return xxx_messageInfo_Error.Size(m) 577 } 578 func (m *Error) XXX_DiscardUnknown() { 579 xxx_messageInfo_Error.DiscardUnknown(m) 580 } 581 582 var xxx_messageInfo_Error proto.InternalMessageInfo 583 584 func (m *Error) GetCount() uint32 { 585 if m != nil { 586 return m.Count 587 } 588 return 0 589 } 590 591 func (m *Error) GetMsg() string { 592 if m != nil { 593 return m.Msg 594 } 595 return "" 596 } 597 598 // Status is node status 599 type Status struct { 600 Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` 601 XXX_NoUnkeyedLiteral struct{} `json:"-"` 602 XXX_unrecognized []byte `json:"-"` 603 XXX_sizecache int32 `json:"-"` 604 } 605 606 func (m *Status) Reset() { *m = Status{} } 607 func (m *Status) String() string { return proto.CompactTextString(m) } 608 func (*Status) ProtoMessage() {} 609 func (*Status) Descriptor() ([]byte, []int) { 610 return fileDescriptor_1aab434177f140e0, []int{14} 611 } 612 613 func (m *Status) XXX_Unmarshal(b []byte) error { 614 return xxx_messageInfo_Status.Unmarshal(m, b) 615 } 616 func (m *Status) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 617 return xxx_messageInfo_Status.Marshal(b, m, deterministic) 618 } 619 func (m *Status) XXX_Merge(src proto.Message) { 620 xxx_messageInfo_Status.Merge(m, src) 621 } 622 func (m *Status) XXX_Size() int { 623 return xxx_messageInfo_Status.Size(m) 624 } 625 func (m *Status) XXX_DiscardUnknown() { 626 xxx_messageInfo_Status.DiscardUnknown(m) 627 } 628 629 var xxx_messageInfo_Status proto.InternalMessageInfo 630 631 func (m *Status) GetError() *Error { 632 if m != nil { 633 return m.Error 634 } 635 return nil 636 } 637 638 // Node is network node 639 type Node struct { 640 // node id 641 Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` 642 // node address 643 Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` 644 // the network 645 Network string `protobuf:"bytes,3,opt,name=network,proto3" json:"network,omitempty"` 646 // associated metadata 647 Metadata map[string]string `protobuf:"bytes,4,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` 648 // node status 649 Status *Status `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` 650 XXX_NoUnkeyedLiteral struct{} `json:"-"` 651 XXX_unrecognized []byte `json:"-"` 652 XXX_sizecache int32 `json:"-"` 653 } 654 655 func (m *Node) Reset() { *m = Node{} } 656 func (m *Node) String() string { return proto.CompactTextString(m) } 657 func (*Node) ProtoMessage() {} 658 func (*Node) Descriptor() ([]byte, []int) { 659 return fileDescriptor_1aab434177f140e0, []int{15} 660 } 661 662 func (m *Node) XXX_Unmarshal(b []byte) error { 663 return xxx_messageInfo_Node.Unmarshal(m, b) 664 } 665 func (m *Node) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 666 return xxx_messageInfo_Node.Marshal(b, m, deterministic) 667 } 668 func (m *Node) XXX_Merge(src proto.Message) { 669 xxx_messageInfo_Node.Merge(m, src) 670 } 671 func (m *Node) XXX_Size() int { 672 return xxx_messageInfo_Node.Size(m) 673 } 674 func (m *Node) XXX_DiscardUnknown() { 675 xxx_messageInfo_Node.DiscardUnknown(m) 676 } 677 678 var xxx_messageInfo_Node proto.InternalMessageInfo 679 680 func (m *Node) GetId() string { 681 if m != nil { 682 return m.Id 683 } 684 return "" 685 } 686 687 func (m *Node) GetAddress() string { 688 if m != nil { 689 return m.Address 690 } 691 return "" 692 } 693 694 func (m *Node) GetNetwork() string { 695 if m != nil { 696 return m.Network 697 } 698 return "" 699 } 700 701 func (m *Node) GetMetadata() map[string]string { 702 if m != nil { 703 return m.Metadata 704 } 705 return nil 706 } 707 708 func (m *Node) GetStatus() *Status { 709 if m != nil { 710 return m.Status 711 } 712 return nil 713 } 714 715 // Connect is sent when the node connects to the network 716 type Connect struct { 717 // network mode 718 Node *Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` 719 XXX_NoUnkeyedLiteral struct{} `json:"-"` 720 XXX_unrecognized []byte `json:"-"` 721 XXX_sizecache int32 `json:"-"` 722 } 723 724 func (m *Connect) Reset() { *m = Connect{} } 725 func (m *Connect) String() string { return proto.CompactTextString(m) } 726 func (*Connect) ProtoMessage() {} 727 func (*Connect) Descriptor() ([]byte, []int) { 728 return fileDescriptor_1aab434177f140e0, []int{16} 729 } 730 731 func (m *Connect) XXX_Unmarshal(b []byte) error { 732 return xxx_messageInfo_Connect.Unmarshal(m, b) 733 } 734 func (m *Connect) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 735 return xxx_messageInfo_Connect.Marshal(b, m, deterministic) 736 } 737 func (m *Connect) XXX_Merge(src proto.Message) { 738 xxx_messageInfo_Connect.Merge(m, src) 739 } 740 func (m *Connect) XXX_Size() int { 741 return xxx_messageInfo_Connect.Size(m) 742 } 743 func (m *Connect) XXX_DiscardUnknown() { 744 xxx_messageInfo_Connect.DiscardUnknown(m) 745 } 746 747 var xxx_messageInfo_Connect proto.InternalMessageInfo 748 749 func (m *Connect) GetNode() *Node { 750 if m != nil { 751 return m.Node 752 } 753 return nil 754 } 755 756 // Close is sent when the node disconnects from the network 757 type Close struct { 758 // network node 759 Node *Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` 760 XXX_NoUnkeyedLiteral struct{} `json:"-"` 761 XXX_unrecognized []byte `json:"-"` 762 XXX_sizecache int32 `json:"-"` 763 } 764 765 func (m *Close) Reset() { *m = Close{} } 766 func (m *Close) String() string { return proto.CompactTextString(m) } 767 func (*Close) ProtoMessage() {} 768 func (*Close) Descriptor() ([]byte, []int) { 769 return fileDescriptor_1aab434177f140e0, []int{17} 770 } 771 772 func (m *Close) XXX_Unmarshal(b []byte) error { 773 return xxx_messageInfo_Close.Unmarshal(m, b) 774 } 775 func (m *Close) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 776 return xxx_messageInfo_Close.Marshal(b, m, deterministic) 777 } 778 func (m *Close) XXX_Merge(src proto.Message) { 779 xxx_messageInfo_Close.Merge(m, src) 780 } 781 func (m *Close) XXX_Size() int { 782 return xxx_messageInfo_Close.Size(m) 783 } 784 func (m *Close) XXX_DiscardUnknown() { 785 xxx_messageInfo_Close.DiscardUnknown(m) 786 } 787 788 var xxx_messageInfo_Close proto.InternalMessageInfo 789 790 func (m *Close) GetNode() *Node { 791 if m != nil { 792 return m.Node 793 } 794 return nil 795 } 796 797 // Peer is used to advertise node peers 798 type Peer struct { 799 // network node 800 Node *Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` 801 // node peers 802 Peers []*Peer `protobuf:"bytes,2,rep,name=peers,proto3" json:"peers,omitempty"` 803 XXX_NoUnkeyedLiteral struct{} `json:"-"` 804 XXX_unrecognized []byte `json:"-"` 805 XXX_sizecache int32 `json:"-"` 806 } 807 808 func (m *Peer) Reset() { *m = Peer{} } 809 func (m *Peer) String() string { return proto.CompactTextString(m) } 810 func (*Peer) ProtoMessage() {} 811 func (*Peer) Descriptor() ([]byte, []int) { 812 return fileDescriptor_1aab434177f140e0, []int{18} 813 } 814 815 func (m *Peer) XXX_Unmarshal(b []byte) error { 816 return xxx_messageInfo_Peer.Unmarshal(m, b) 817 } 818 func (m *Peer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 819 return xxx_messageInfo_Peer.Marshal(b, m, deterministic) 820 } 821 func (m *Peer) XXX_Merge(src proto.Message) { 822 xxx_messageInfo_Peer.Merge(m, src) 823 } 824 func (m *Peer) XXX_Size() int { 825 return xxx_messageInfo_Peer.Size(m) 826 } 827 func (m *Peer) XXX_DiscardUnknown() { 828 xxx_messageInfo_Peer.DiscardUnknown(m) 829 } 830 831 var xxx_messageInfo_Peer proto.InternalMessageInfo 832 833 func (m *Peer) GetNode() *Node { 834 if m != nil { 835 return m.Node 836 } 837 return nil 838 } 839 840 func (m *Peer) GetPeers() []*Peer { 841 if m != nil { 842 return m.Peers 843 } 844 return nil 845 } 846 847 // Sync is network sync message 848 type Sync struct { 849 // peer origin 850 Peer *Peer `protobuf:"bytes,1,opt,name=peer,proto3" json:"peer,omitempty"` 851 // node routes 852 Routes []*proto1.Route `protobuf:"bytes,2,rep,name=routes,proto3" json:"routes,omitempty"` 853 XXX_NoUnkeyedLiteral struct{} `json:"-"` 854 XXX_unrecognized []byte `json:"-"` 855 XXX_sizecache int32 `json:"-"` 856 } 857 858 func (m *Sync) Reset() { *m = Sync{} } 859 func (m *Sync) String() string { return proto.CompactTextString(m) } 860 func (*Sync) ProtoMessage() {} 861 func (*Sync) Descriptor() ([]byte, []int) { 862 return fileDescriptor_1aab434177f140e0, []int{19} 863 } 864 865 func (m *Sync) XXX_Unmarshal(b []byte) error { 866 return xxx_messageInfo_Sync.Unmarshal(m, b) 867 } 868 func (m *Sync) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 869 return xxx_messageInfo_Sync.Marshal(b, m, deterministic) 870 } 871 func (m *Sync) XXX_Merge(src proto.Message) { 872 xxx_messageInfo_Sync.Merge(m, src) 873 } 874 func (m *Sync) XXX_Size() int { 875 return xxx_messageInfo_Sync.Size(m) 876 } 877 func (m *Sync) XXX_DiscardUnknown() { 878 xxx_messageInfo_Sync.DiscardUnknown(m) 879 } 880 881 var xxx_messageInfo_Sync proto.InternalMessageInfo 882 883 func (m *Sync) GetPeer() *Peer { 884 if m != nil { 885 return m.Peer 886 } 887 return nil 888 } 889 890 func (m *Sync) GetRoutes() []*proto1.Route { 891 if m != nil { 892 return m.Routes 893 } 894 return nil 895 } 896 897 func init() { 898 proto.RegisterType((*Query)(nil), "go.micro.network.Query") 899 proto.RegisterType((*ConnectRequest)(nil), "go.micro.network.ConnectRequest") 900 proto.RegisterType((*ConnectResponse)(nil), "go.micro.network.ConnectResponse") 901 proto.RegisterType((*NodesRequest)(nil), "go.micro.network.NodesRequest") 902 proto.RegisterType((*NodesResponse)(nil), "go.micro.network.NodesResponse") 903 proto.RegisterType((*GraphRequest)(nil), "go.micro.network.GraphRequest") 904 proto.RegisterType((*GraphResponse)(nil), "go.micro.network.GraphResponse") 905 proto.RegisterType((*RoutesRequest)(nil), "go.micro.network.RoutesRequest") 906 proto.RegisterType((*RoutesResponse)(nil), "go.micro.network.RoutesResponse") 907 proto.RegisterType((*ServicesRequest)(nil), "go.micro.network.ServicesRequest") 908 proto.RegisterType((*ServicesResponse)(nil), "go.micro.network.ServicesResponse") 909 proto.RegisterType((*StatusRequest)(nil), "go.micro.network.StatusRequest") 910 proto.RegisterType((*StatusResponse)(nil), "go.micro.network.StatusResponse") 911 proto.RegisterType((*Error)(nil), "go.micro.network.Error") 912 proto.RegisterType((*Status)(nil), "go.micro.network.Status") 913 proto.RegisterType((*Node)(nil), "go.micro.network.Node") 914 proto.RegisterMapType((map[string]string)(nil), "go.micro.network.Node.MetadataEntry") 915 proto.RegisterType((*Connect)(nil), "go.micro.network.Connect") 916 proto.RegisterType((*Close)(nil), "go.micro.network.Close") 917 proto.RegisterType((*Peer)(nil), "go.micro.network.Peer") 918 proto.RegisterType((*Sync)(nil), "go.micro.network.Sync") 919 } 920 921 func init() { 922 proto.RegisterFile("network/service/proto/network.proto", fileDescriptor_1aab434177f140e0) 923 } 924 925 var fileDescriptor_1aab434177f140e0 = []byte{ 926 // 667 bytes of a gzipped FileDescriptorProto 927 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xdd, 0x4e, 0xdb, 0x4c, 928 0x10, 0xc5, 0xb1, 0x1d, 0x60, 0x3e, 0x1c, 0xf8, 0x56, 0x15, 0xb5, 0x7c, 0x51, 0xc2, 0x96, 0x0b, 929 0x54, 0xb5, 0x4e, 0x05, 0xaa, 0x5a, 0x15, 0x15, 0xa1, 0x22, 0x54, 0xa9, 0x12, 0x88, 0x3a, 0x2f, 930 0x50, 0x13, 0xaf, 0x20, 0x02, 0xbc, 0x61, 0xbd, 0x06, 0xe5, 0x09, 0xfa, 0xa6, 0x7d, 0x89, 0xde, 931 0x54, 0xbb, 0x3b, 0x36, 0x36, 0xb1, 0xd3, 0x70, 0x97, 0x99, 0x3d, 0x67, 0xc6, 0xf3, 0x77, 0x02, 932 0xaf, 0x53, 0x26, 0x1f, 0xb8, 0xb8, 0x1e, 0x64, 0x4c, 0xdc, 0x8f, 0x47, 0x6c, 0x30, 0x11, 0x5c, 933 0xf2, 0x01, 0x7a, 0x43, 0x6d, 0x91, 0x8d, 0x4b, 0x1e, 0xde, 0x8e, 0x47, 0x82, 0x87, 0xe8, 0x0f, 934 0xb6, 0x05, 0xcf, 0x25, 0x13, 0x4f, 0x58, 0xc6, 0x69, 0x48, 0xf4, 0x97, 0x05, 0xee, 0x8f, 0x9c, 935 0x89, 0x29, 0xf1, 0x61, 0x19, 0x71, 0xbe, 0xd5, 0xb7, 0x76, 0x57, 0xa3, 0xc2, 0x54, 0x2f, 0x71, 936 0x92, 0x08, 0x96, 0x65, 0x7e, 0xc7, 0xbc, 0xa0, 0xa9, 0x5e, 0x2e, 0x63, 0xc9, 0x1e, 0xe2, 0xa9, 937 0x6f, 0x9b, 0x17, 0x34, 0xc9, 0x26, 0x74, 0x4d, 0x1e, 0xdf, 0xd1, 0x0f, 0x68, 0x29, 0x06, 0x7e, 938 0x9d, 0xef, 0x1a, 0x06, 0x9a, 0xf4, 0x10, 0x7a, 0xc7, 0x3c, 0x4d, 0xd9, 0x48, 0x46, 0xec, 0x2e, 939 0x67, 0x99, 0x24, 0x6f, 0xc1, 0x4d, 0x79, 0xc2, 0x32, 0xdf, 0xea, 0xdb, 0xbb, 0xff, 0xed, 0x6d, 940 0x86, 0x4f, 0x0b, 0x0c, 0xcf, 0x78, 0xc2, 0x22, 0x03, 0xa2, 0xff, 0xc3, 0x7a, 0xc9, 0xcf, 0x26, 941 0x3c, 0xcd, 0x18, 0xdd, 0x81, 0x35, 0x85, 0xc8, 0x8a, 0x80, 0x2f, 0xc0, 0x4d, 0xd8, 0x44, 0x5e, 942 0xe9, 0x02, 0xbd, 0xc8, 0x18, 0xf4, 0x0b, 0x78, 0x88, 0x32, 0xb4, 0x67, 0xe6, 0xdd, 0x81, 0xb5, 943 0x6f, 0x22, 0x9e, 0x5c, 0xcd, 0x4f, 0x72, 0x00, 0x1e, 0xa2, 0x30, 0xc9, 0x1b, 0x70, 0x04, 0xe7, 944 0x52, 0xa3, 0x1a, 0x73, 0x9c, 0x33, 0x26, 0x22, 0x8d, 0xa1, 0x87, 0xe0, 0x45, 0xaa, 0x7d, 0x65, 945 0x21, 0xef, 0xc0, 0xbd, 0x53, 0x43, 0x43, 0xf6, 0xcb, 0x59, 0xb6, 0x9e, 0x69, 0x64, 0x50, 0xf4, 946 0x08, 0x7a, 0x05, 0x1f, 0xb3, 0x87, 0x38, 0x9e, 0x86, 0x1a, 0x71, 0x3d, 0x34, 0x01, 0xc7, 0xa6, 947 0x9b, 0x3b, 0x34, 0xdb, 0x50, 0x7c, 0x03, 0x0d, 0x61, 0xe3, 0xd1, 0x85, 0x61, 0x03, 0x58, 0xc1, 948 0xa5, 0x31, 0x81, 0x57, 0xa3, 0xd2, 0xa6, 0xeb, 0xe0, 0x0d, 0x65, 0x2c, 0xf3, 0x32, 0xc0, 0x57, 949 0xe8, 0x15, 0x0e, 0xa4, 0xbf, 0x87, 0x6e, 0xa6, 0x3d, 0x58, 0x97, 0x3f, 0x5b, 0x17, 0x32, 0x10, 950 0x47, 0x07, 0xe0, 0x9e, 0x08, 0xc1, 0x85, 0xea, 0xfa, 0x88, 0xe7, 0xa9, 0x2c, 0xba, 0xae, 0x0d, 951 0xb2, 0x01, 0xf6, 0x6d, 0x76, 0x89, 0x5b, 0xab, 0x7e, 0xd2, 0x8f, 0xd0, 0x35, 0x21, 0x54, 0x0f, 952 0x99, 0xa2, 0xb6, 0xf7, 0x50, 0x47, 0x8e, 0x0c, 0x8a, 0xfe, 0xb1, 0xc0, 0x51, 0x63, 0x27, 0x3d, 953 0xe8, 0x8c, 0x13, 0x3c, 0x91, 0xce, 0x38, 0x99, 0x7f, 0x1d, 0xc5, 0xae, 0xdb, 0xb5, 0x5d, 0x27, 954 0x47, 0xb0, 0x72, 0xcb, 0x64, 0x9c, 0xc4, 0x32, 0xf6, 0x1d, 0x3d, 0x80, 0x9d, 0xe6, 0x25, 0x0b, 955 0x4f, 0x11, 0x76, 0x92, 0x4a, 0x31, 0x8d, 0x4a, 0x56, 0xa5, 0x55, 0xee, 0x62, 0xad, 0x0a, 0x0e, 956 0xc0, 0xab, 0x05, 0x53, 0xcd, 0xb9, 0x66, 0x53, 0xac, 0x44, 0xfd, 0x54, 0x4d, 0xbc, 0x8f, 0x6f, 957 0x72, 0x86, 0x85, 0x18, 0xe3, 0x73, 0xe7, 0x93, 0x45, 0x3f, 0xc0, 0x32, 0x1e, 0x97, 0x5a, 0x5c, 958 0xb5, 0xf8, 0xed, 0x8b, 0xab, 0x8f, 0x43, 0x63, 0xe8, 0x3e, 0xb8, 0xc7, 0x37, 0xdc, 0x6c, 0xfb, 959 0xc2, 0xa4, 0x9f, 0xe0, 0xa8, 0xdd, 0x7f, 0x0e, 0x47, 0x9d, 0xec, 0x84, 0x31, 0xa1, 0x46, 0x60, 960 0xcf, 0x39, 0x27, 0x03, 0xa2, 0x17, 0xe0, 0x0c, 0xa7, 0xe9, 0x48, 0x65, 0x50, 0x8e, 0x7f, 0xdd, 961 0xa0, 0xc2, 0x54, 0x2e, 0xa6, 0xb3, 0xc8, 0xc5, 0xec, 0xfd, 0xb6, 0x61, 0xf9, 0x0c, 0xc7, 0x7d, 962 0xfe, 0xd8, 0xbd, 0xfe, 0x6c, 0x92, 0xba, 0xea, 0x05, 0xdb, 0x73, 0x10, 0xa8, 0x6b, 0x4b, 0xe4, 963 0x3b, 0xb8, 0x5a, 0x4e, 0xc8, 0xab, 0x59, 0x74, 0x55, 0x8d, 0x82, 0xad, 0xd6, 0xf7, 0x6a, 0x2c, 964 0xad, 0x7f, 0x4d, 0xb1, 0xaa, 0xf2, 0xd9, 0x14, 0xab, 0x26, 0x9c, 0x74, 0x89, 0x9c, 0x42, 0xd7, 965 0x28, 0x0d, 0x69, 0x00, 0xd7, 0x34, 0x2c, 0xe8, 0xb7, 0x03, 0xca, 0x70, 0x43, 0x58, 0x29, 0x34, 966 0x86, 0x34, 0xf4, 0xe5, 0x89, 0x24, 0x05, 0x74, 0x1e, 0xa4, 0xfa, 0x8d, 0x28, 0x01, 0x5b, 0xad, 967 0x47, 0xd3, 0xfe, 0x8d, 0x75, 0xc9, 0xa2, 0x4b, 0x17, 0x5d, 0xfd, 0x47, 0xba, 0xff, 0x37, 0x00, 968 0x00, 0xff, 0xff, 0x13, 0x9f, 0x0c, 0xc2, 0xa4, 0x07, 0x00, 0x00, 969 } 970 971 // Reference imports to suppress errors if they are not otherwise used. 972 var _ context.Context 973 var _ grpc.ClientConn 974 975 // This is a compile-time assertion to ensure that this generated file 976 // is compatible with the grpc package it is being compiled against. 977 const _ = grpc.SupportPackageIsVersion4 978 979 // NetworkClient is the client API for Network service. 980 // 981 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 982 type NetworkClient interface { 983 // Connect to the network 984 Connect(ctx context.Context, in *ConnectRequest, opts ...grpc.CallOption) (*ConnectResponse, error) 985 // Returns the entire network graph 986 Graph(ctx context.Context, in *GraphRequest, opts ...grpc.CallOption) (*GraphResponse, error) 987 // Returns a list of known nodes in the network 988 Nodes(ctx context.Context, in *NodesRequest, opts ...grpc.CallOption) (*NodesResponse, error) 989 // Returns a list of known routes in the network 990 Routes(ctx context.Context, in *RoutesRequest, opts ...grpc.CallOption) (*RoutesResponse, error) 991 // Returns a list of known services based on routes 992 Services(ctx context.Context, in *ServicesRequest, opts ...grpc.CallOption) (*ServicesResponse, error) 993 // Status returns network status 994 Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) 995 } 996 997 type networkClient struct { 998 cc *grpc.ClientConn 999 } 1000 1001 func NewNetworkClient(cc *grpc.ClientConn) NetworkClient { 1002 return &networkClient{cc} 1003 } 1004 1005 func (c *networkClient) Connect(ctx context.Context, in *ConnectRequest, opts ...grpc.CallOption) (*ConnectResponse, error) { 1006 out := new(ConnectResponse) 1007 err := c.cc.Invoke(ctx, "/go.micro.network.Network/Connect", in, out, opts...) 1008 if err != nil { 1009 return nil, err 1010 } 1011 return out, nil 1012 } 1013 1014 func (c *networkClient) Graph(ctx context.Context, in *GraphRequest, opts ...grpc.CallOption) (*GraphResponse, error) { 1015 out := new(GraphResponse) 1016 err := c.cc.Invoke(ctx, "/go.micro.network.Network/Graph", in, out, opts...) 1017 if err != nil { 1018 return nil, err 1019 } 1020 return out, nil 1021 } 1022 1023 func (c *networkClient) Nodes(ctx context.Context, in *NodesRequest, opts ...grpc.CallOption) (*NodesResponse, error) { 1024 out := new(NodesResponse) 1025 err := c.cc.Invoke(ctx, "/go.micro.network.Network/Nodes", in, out, opts...) 1026 if err != nil { 1027 return nil, err 1028 } 1029 return out, nil 1030 } 1031 1032 func (c *networkClient) Routes(ctx context.Context, in *RoutesRequest, opts ...grpc.CallOption) (*RoutesResponse, error) { 1033 out := new(RoutesResponse) 1034 err := c.cc.Invoke(ctx, "/go.micro.network.Network/Routes", in, out, opts...) 1035 if err != nil { 1036 return nil, err 1037 } 1038 return out, nil 1039 } 1040 1041 func (c *networkClient) Services(ctx context.Context, in *ServicesRequest, opts ...grpc.CallOption) (*ServicesResponse, error) { 1042 out := new(ServicesResponse) 1043 err := c.cc.Invoke(ctx, "/go.micro.network.Network/Services", in, out, opts...) 1044 if err != nil { 1045 return nil, err 1046 } 1047 return out, nil 1048 } 1049 1050 func (c *networkClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { 1051 out := new(StatusResponse) 1052 err := c.cc.Invoke(ctx, "/go.micro.network.Network/Status", in, out, opts...) 1053 if err != nil { 1054 return nil, err 1055 } 1056 return out, nil 1057 } 1058 1059 // NetworkServer is the server API for Network service. 1060 type NetworkServer interface { 1061 // Connect to the network 1062 Connect(context.Context, *ConnectRequest) (*ConnectResponse, error) 1063 // Returns the entire network graph 1064 Graph(context.Context, *GraphRequest) (*GraphResponse, error) 1065 // Returns a list of known nodes in the network 1066 Nodes(context.Context, *NodesRequest) (*NodesResponse, error) 1067 // Returns a list of known routes in the network 1068 Routes(context.Context, *RoutesRequest) (*RoutesResponse, error) 1069 // Returns a list of known services based on routes 1070 Services(context.Context, *ServicesRequest) (*ServicesResponse, error) 1071 // Status returns network status 1072 Status(context.Context, *StatusRequest) (*StatusResponse, error) 1073 } 1074 1075 // UnimplementedNetworkServer can be embedded to have forward compatible implementations. 1076 type UnimplementedNetworkServer struct { 1077 } 1078 1079 func (*UnimplementedNetworkServer) Connect(ctx context.Context, req *ConnectRequest) (*ConnectResponse, error) { 1080 return nil, status.Errorf(codes.Unimplemented, "method Connect not implemented") 1081 } 1082 func (*UnimplementedNetworkServer) Graph(ctx context.Context, req *GraphRequest) (*GraphResponse, error) { 1083 return nil, status.Errorf(codes.Unimplemented, "method Graph not implemented") 1084 } 1085 func (*UnimplementedNetworkServer) Nodes(ctx context.Context, req *NodesRequest) (*NodesResponse, error) { 1086 return nil, status.Errorf(codes.Unimplemented, "method Nodes not implemented") 1087 } 1088 func (*UnimplementedNetworkServer) Routes(ctx context.Context, req *RoutesRequest) (*RoutesResponse, error) { 1089 return nil, status.Errorf(codes.Unimplemented, "method Routes not implemented") 1090 } 1091 func (*UnimplementedNetworkServer) Services(ctx context.Context, req *ServicesRequest) (*ServicesResponse, error) { 1092 return nil, status.Errorf(codes.Unimplemented, "method Services not implemented") 1093 } 1094 func (*UnimplementedNetworkServer) Status(ctx context.Context, req *StatusRequest) (*StatusResponse, error) { 1095 return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") 1096 } 1097 1098 func RegisterNetworkServer(s *grpc.Server, srv NetworkServer) { 1099 s.RegisterService(&_Network_serviceDesc, srv) 1100 } 1101 1102 func _Network_Connect_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 1103 in := new(ConnectRequest) 1104 if err := dec(in); err != nil { 1105 return nil, err 1106 } 1107 if interceptor == nil { 1108 return srv.(NetworkServer).Connect(ctx, in) 1109 } 1110 info := &grpc.UnaryServerInfo{ 1111 Server: srv, 1112 FullMethod: "/go.micro.network.Network/Connect", 1113 } 1114 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 1115 return srv.(NetworkServer).Connect(ctx, req.(*ConnectRequest)) 1116 } 1117 return interceptor(ctx, in, info, handler) 1118 } 1119 1120 func _Network_Graph_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 1121 in := new(GraphRequest) 1122 if err := dec(in); err != nil { 1123 return nil, err 1124 } 1125 if interceptor == nil { 1126 return srv.(NetworkServer).Graph(ctx, in) 1127 } 1128 info := &grpc.UnaryServerInfo{ 1129 Server: srv, 1130 FullMethod: "/go.micro.network.Network/Graph", 1131 } 1132 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 1133 return srv.(NetworkServer).Graph(ctx, req.(*GraphRequest)) 1134 } 1135 return interceptor(ctx, in, info, handler) 1136 } 1137 1138 func _Network_Nodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 1139 in := new(NodesRequest) 1140 if err := dec(in); err != nil { 1141 return nil, err 1142 } 1143 if interceptor == nil { 1144 return srv.(NetworkServer).Nodes(ctx, in) 1145 } 1146 info := &grpc.UnaryServerInfo{ 1147 Server: srv, 1148 FullMethod: "/go.micro.network.Network/Nodes", 1149 } 1150 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 1151 return srv.(NetworkServer).Nodes(ctx, req.(*NodesRequest)) 1152 } 1153 return interceptor(ctx, in, info, handler) 1154 } 1155 1156 func _Network_Routes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 1157 in := new(RoutesRequest) 1158 if err := dec(in); err != nil { 1159 return nil, err 1160 } 1161 if interceptor == nil { 1162 return srv.(NetworkServer).Routes(ctx, in) 1163 } 1164 info := &grpc.UnaryServerInfo{ 1165 Server: srv, 1166 FullMethod: "/go.micro.network.Network/Routes", 1167 } 1168 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 1169 return srv.(NetworkServer).Routes(ctx, req.(*RoutesRequest)) 1170 } 1171 return interceptor(ctx, in, info, handler) 1172 } 1173 1174 func _Network_Services_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 1175 in := new(ServicesRequest) 1176 if err := dec(in); err != nil { 1177 return nil, err 1178 } 1179 if interceptor == nil { 1180 return srv.(NetworkServer).Services(ctx, in) 1181 } 1182 info := &grpc.UnaryServerInfo{ 1183 Server: srv, 1184 FullMethod: "/go.micro.network.Network/Services", 1185 } 1186 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 1187 return srv.(NetworkServer).Services(ctx, req.(*ServicesRequest)) 1188 } 1189 return interceptor(ctx, in, info, handler) 1190 } 1191 1192 func _Network_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 1193 in := new(StatusRequest) 1194 if err := dec(in); err != nil { 1195 return nil, err 1196 } 1197 if interceptor == nil { 1198 return srv.(NetworkServer).Status(ctx, in) 1199 } 1200 info := &grpc.UnaryServerInfo{ 1201 Server: srv, 1202 FullMethod: "/go.micro.network.Network/Status", 1203 } 1204 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 1205 return srv.(NetworkServer).Status(ctx, req.(*StatusRequest)) 1206 } 1207 return interceptor(ctx, in, info, handler) 1208 } 1209 1210 var _Network_serviceDesc = grpc.ServiceDesc{ 1211 ServiceName: "go.micro.network.Network", 1212 HandlerType: (*NetworkServer)(nil), 1213 Methods: []grpc.MethodDesc{ 1214 { 1215 MethodName: "Connect", 1216 Handler: _Network_Connect_Handler, 1217 }, 1218 { 1219 MethodName: "Graph", 1220 Handler: _Network_Graph_Handler, 1221 }, 1222 { 1223 MethodName: "Nodes", 1224 Handler: _Network_Nodes_Handler, 1225 }, 1226 { 1227 MethodName: "Routes", 1228 Handler: _Network_Routes_Handler, 1229 }, 1230 { 1231 MethodName: "Services", 1232 Handler: _Network_Services_Handler, 1233 }, 1234 { 1235 MethodName: "Status", 1236 Handler: _Network_Status_Handler, 1237 }, 1238 }, 1239 Streams: []grpc.StreamDesc{}, 1240 Metadata: "network/service/proto/network.proto", 1241 }