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