| module discovery; |
| |
| // Copied from v.io/v23/discovery/types.vdl |
| struct Service { |
| // The 128 bit (16 byte) universal unique identifier of a service instance. |
| // If this is not specified, a random UUID will be used. |
| array<uint8> InstanceUuid; |
| // The interface that the service implements. |
| // E.g., 'v.io/v23/services/vtrace.Store'. |
| string InterfaceName; |
| // The service attributes. |
| // E.g., {'resolution': '1024x768'}. |
| map<string, string> Attrs; |
| // The addresses that the service is served on. |
| // E.g., '/host:port/a/b/c'. |
| array<string> Addrs; |
| }; |
| |
| struct Error { |
| string id; |
| int32 action; |
| string msg; |
| }; |
| |
| interface Discoverer { |
| Advertise(Service s, array<string> pattern) => (int32 Handle, Error? Err); |
| |
| StopAdvertising(int32 h); |
| |
| Scan(string query, ScanHandler scanHandler) => (int32 Handle, Error? Err); |
| |
| StopScan(int32 h); |
| }; |
| |
| interface ScanHandler { |
| Found(Service s); |
| |
| Lost(Service s); |
| }; |