25 lines
538 B
C++
25 lines
538 B
C++
#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;
|
|
}
|