feat(discovery): implement P3 S-DISCOVERY-01..04 Discovery catalog and optional DiscoveryRpc adapter
This commit is contained in:
1 parent
0cf187d664
commit
ec8c0bd40a
12 files changed
+2686
No files matched your search
@@ -0,0 +1,24 @@
|
||||
#include <Void/Discovery/Catalog.hpp>
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
int main()
|
||||
{
|
||||
Void::Discovery::Catalog catalog{};
|
||||
Void::Discovery::EndpointRecord rec{};
|
||||
rec.service = "svc";
|
||||
rec.instance = "i-1";
|
||||
rec.endpoint.scheme = "http";
|
||||
rec.endpoint.host = "127.0.0.1";
|
||||
rec.endpoint.port = 8080;
|
||||
|
||||
auto rev = catalog.replace_static({rec});
|
||||
if (!rev.has_value() || *rev != 1U) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
auto snap = catalog.resolve("svc");
|
||||
if (!snap.has_value() || snap->records.size() != 1U) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Reference in new issue
Block a user