Skip to content

Commit c56847b

Browse files
committed
meta: Update from upstream.
1 parent 01f4a20 commit c56847b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+1888
-1789
lines changed

β€Žsrc/clis/dns/main.cppβ€Ž

Lines changed: 0 additions & 15 deletions
This file was deleted.

β€Žsrc/clis/fetch/main.cppβ€Ž

Lines changed: 0 additions & 7 deletions
This file was deleted.

β€Žsrc/clis/http-get/main.cppβ€Ž

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#include <karm-cli/args.h>
2+
#include <karm-sys/entry.h>
3+
#include <karm-sys/proc.h>
4+
5+
import Karm;
6+
7+
Async::Task<> entryPointAsync(Sys::Context& ctx) {
8+
auto urlArg = Cli::operand<Str>("url"s, "URL to fetch"s, "localhost"s);
9+
10+
Cli::Command cmd{
11+
"http-get"s,
12+
NONE,
13+
"Send a GET request to a URL and print the response body"s,
14+
{
15+
urlArg,
16+
}
17+
};
18+
19+
co_trya$(cmd.execAsync(ctx));
20+
21+
auto url = Mime::parseUrlOrPath(urlArg, co_try$(Sys::pwd()));
22+
auto resp = co_trya$(Http::getAsync(url));
23+
auto body = resp->body.unwrapOr(Http::Body::empty());
24+
25+
auto adaptedOut = Aio::adapt(Sys::out());
26+
co_trya$(Aio::copyAsync(*body, adaptedOut));
27+
28+
co_return Ok();
29+
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"$schema": "https://schemas.cute.engineering/stable/cutekit.manifest.component.v1",
3-
"id": "fetch",
3+
"id": "http-get",
4+
"description": "Send an HTTP GET request",
45
"type": "exe",
5-
"description": "A simple HTTP fetcher",
66
"requires": [
7-
"karm-net",
8-
"karm-sys"
7+
"karm-http",
8+
"karm-cli"
99
]
1010
}

β€Žsrc/clis/http-head/main.cppβ€Ž

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#include <karm-cli/args.h>
2+
#include <karm-sys/entry.h>
3+
#include <karm-sys/proc.h>
4+
5+
import Karm;
6+
7+
Async::Task<> entryPointAsync(Sys::Context& ctx) {
8+
auto urlArg = Cli::operand<Str>("url"s, "URL to fetch"s, "localhost"s);
9+
10+
Cli::Command cmd{
11+
"http-head"s,
12+
NONE,
13+
"Send a HEAD request to a URL and print the response headers"s,
14+
{
15+
urlArg,
16+
}
17+
};
18+
19+
co_trya$(cmd.execAsync(ctx));
20+
21+
auto url = Mime::parseUrlOrPath(urlArg, co_try$(Sys::pwd()));
22+
auto header = co_trya$(Http::headAsync(url))->header;
23+
co_try$(header.unparse(Sys::out()));
24+
25+
co_return Ok();
26+
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"$schema": "https://schemas.cute.engineering/stable/cutekit.manifest.component.v1",
3-
"id": "dns",
3+
"id": "http-head",
4+
"description": "Send an HTTP HEAD request",
45
"type": "exe",
5-
"description": "A command line interface for vaev-dns",
66
"requires": [
7-
"karm-net",
8-
"karm-sys"
7+
"karm-http",
8+
"karm-cli"
99
]
1010
}

β€Žsrc/clis/net-lookup/main.cppβ€Ž

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#include <karm-cli/args.h>
2+
#include <karm-sys/entry.h>
3+
#include <karm-sys/lookup.h>
4+
#include <karm-sys/proc.h>
5+
6+
import Karm;
7+
8+
Async::Task<> entryPointAsync(Sys::Context& ctx) {
9+
auto domainArg = Cli::operand<Str>("domain"s, "Domain name to lookup"s);
10+
11+
Cli::Command cmd{
12+
"net-lookup"s,
13+
NONE,
14+
"Do a domain name lookup"s,
15+
{
16+
domainArg,
17+
}
18+
};
19+
20+
co_trya$(cmd.execAsync(ctx));
21+
22+
auto ips = co_trya$(Sys::lookupAsync(domainArg));
23+
co_try$(Io::format(Sys::out(), "{}:\n", domainArg.unwrap()));
24+
for (auto& ip : ips) {
25+
co_try$(Io::format(Sys::out(), "{}\n", ip));
26+
}
27+
28+
co_return Ok();
29+
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
{
22
"$schema": "https://schemas.cute.engineering/stable/cutekit.manifest.component.v1",
3-
"id": "serv",
3+
"id": "net-lookup",
4+
"description": "Do a domain name lookup",
45
"type": "exe",
5-
"description": "A simple HTTP server",
66
"requires": [
7-
"karm-net",
8-
"karm-sys"
7+
"karm-cli"
98
]
109
}

β€Žsrc/clis/serv/main.cppβ€Ž

Lines changed: 0 additions & 99 deletions
This file was deleted.

β€Žsrc/clis/serv/res/private/localhost.crtβ€Ž

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
Β (0)