feat(shorturl): complete P2 M-SHORTURL-01..04 V2 local, storage, and remote providers with frozen V1
This commit is contained in:
1 parent
658c21a2fa
commit
691808eab6
13 files changed
+2317
-1
No files matched your search
@@ -0,0 +1,21 @@
|
||||
#include <Void/ShortUrl/ShortUrl.hpp>
|
||||
#include <Void/ShortUrl/V2.hpp>
|
||||
|
||||
#include <memory>
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace Void::ShortUrl::V2;
|
||||
auto repo = std::make_shared<InMemoryLinkRepository>();
|
||||
auto provider = std::make_shared<LocalProvider>(repo);
|
||||
V1Adapter v1{provider};
|
||||
auto s = v1.shorten({.target_url = "https://example.com/pkg"});
|
||||
if (!s.ok()) {
|
||||
return 1;
|
||||
}
|
||||
auto r = v1.resolve({.key = s.key});
|
||||
if (!r.ok() || r.target_url != "https://example.com/pkg") {
|
||||
return 2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user