github.com/tickoalcantara12/micro/v3@v3.0.0-20221007104245-9d75b9bcbab9/service/network/mucp/proto/network.proto (about) 1 syntax = "proto3"; 2 3 package go.micro.network.mucp; 4 5 // AdvertType defines the type of advert 6 enum AdvertType { 7 AdvertAnnounce = 0; 8 AdvertUpdate = 1; 9 } 10 11 // Advert is router advertsement streamed by Watch 12 message Advert { 13 // id of the advertising router 14 string id = 1; 15 // type of advertisement 16 AdvertType type = 2; 17 // unix timestamp of the advertisement 18 int64 timestamp = 3; 19 // TTL of the Advert 20 int64 ttl = 4; 21 // events is a list of advertised events 22 repeated Event events = 5; 23 } 24 25 // EventType defines the type of event 26 enum EventType { 27 Create = 0; 28 Delete = 1; 29 Update = 2; 30 } 31 32 // Event is routing table event 33 message Event { 34 // the unique event id 35 string id = 1; 36 // type of event 37 EventType type = 2; 38 // unix timestamp of event 39 int64 timestamp = 3; 40 // service route 41 Route route = 4; 42 } 43 44 // Route is a service route 45 message Route { 46 // service for the route 47 string service = 1; 48 // the address that advertise this route 49 string address = 2; 50 // gateway as the next hop 51 string gateway = 3; 52 // the network for this destination 53 string network = 4; 54 // router if the router id 55 string router = 5; 56 // the network link 57 string link = 6; 58 // the metric / score of this route 59 int64 metric = 7; 60 // metadata for the route 61 map<string,string> metadata = 8; 62 } 63 64 // Error tracks network errors 65 message Error { 66 uint32 count = 1; 67 string msg = 2; 68 } 69 70 // Status is node status 71 message Status { 72 Error error = 1; 73 } 74 75 // Node is network node 76 message Node { 77 // node id 78 string id = 1; 79 // node address 80 string address = 2; 81 // the network 82 string network = 3; 83 // associated metadata 84 map<string,string> metadata = 4; 85 // node status 86 Status status = 5; 87 } 88 89 // Connect is sent when the node connects to the network 90 message Connect { 91 // network mode 92 Node node = 1; 93 } 94 95 // Close is sent when the node disconnects from the network 96 message Close { 97 // network node 98 Node node = 1; 99 } 100 101 // Peer is used to advertise node peers 102 message Peer { 103 // network node 104 Node node = 1; 105 // node peers 106 repeated Peer peers = 2; 107 } 108 109 // Sync is network sync message 110 message Sync { 111 // peer origin 112 Peer peer = 1; 113 // node routes 114 repeated Route routes = 2; 115 }