From 4dccf14a24aff32ae5679246ef8c0a7773edd5df Mon Sep 17 00:00:00 2001 From: Eric Gregory Date: Tue, 15 Jul 2025 16:24:35 -0400 Subject: [PATCH 1/2] chore: update readmes for example components Signed-off-by: Eric Gregory --- .gitignore | 7 + examples/component/http-client/README.md | 11 +- .../wasi/cli/environment/environment.wasm.go | 10 +- .../wasi/cli/environment/environment.wit.go | 22 +- .../gen/wasi/cli/stderr/stderr.wasm.go | 2 +- .../gen/wasi/cli/stderr/stderr.wit.go | 8 +- .../gen/wasi/cli/stdin/stdin.wasm.go | 2 +- .../gen/wasi/cli/stdin/stdin.wit.go | 8 +- .../gen/wasi/cli/stdout/stdout.wasm.go | 2 +- .../gen/wasi/cli/stdout/stdout.wit.go | 8 +- .../terminal-stderr/terminal-stderr.wit.go | 7 +- .../terminal-stderr/terminalstderr.wasm.go | 6 +- .../cli/terminal-stdin/terminal-stdin.wit.go | 7 +- .../cli/terminal-stdin/terminalstdin.wasm.go | 6 +- .../terminal-stdout/terminal-stdout.wit.go | 7 +- .../terminal-stdout/terminalstdout.wasm.go | 6 +- .../monotonic-clock/monotonic-clock.wit.go | 29 +- .../monotonic-clock/monotonicclock.wasm.go | 8 +- .../wasi/clocks/wall-clock/wall-clock.wit.go | 12 +- .../wasi/clocks/wall-clock/wallclock.wasm.go | 4 +- .../gen/wasi/config/runtime/runtime.wasm.go | 8 +- .../gen/wasi/config/runtime/runtime.wit.go | 12 +- .../wasi/filesystem/preopens/preopens.wasm.go | 6 +- .../wasi/filesystem/preopens/preopens.wit.go | 7 +- .../gen/wasi/filesystem/types/abi.go | 25 -- .../gen/wasi/filesystem/types/types.wasm.go | 62 ++-- .../gen/wasi/filesystem/types/types.wit.go | 178 +++++----- .../gen/wasi/http/outgoing-handler/abi.go | 8 - .../outgoing-handler/outgoing-handler.wit.go | 7 +- .../outgoing-handler/outgoinghandler.wasm.go | 6 +- .../gen/wasi/http/types/types.wasm.go | 100 +++--- .../gen/wasi/http/types/types.wit.go | 317 ++++++++---------- .../gen/wasi/io/error/error.wit.go | 6 +- .../gen/wasi/io/error/ioerror.wasm.go | 2 +- .../http-client/gen/wasi/io/poll/poll.wasm.go | 8 +- .../http-client/gen/wasi/io/poll/poll.wit.go | 13 +- .../gen/wasi/io/streams/streams.wasm.go | 34 +- .../gen/wasi/io/streams/streams.wit.go | 92 +++-- .../random/insecure-seed/insecure-seed.wit.go | 6 +- .../random/insecure-seed/insecureseed.wasm.go | 2 +- .../gen/wasi/random/insecure/insecure.wasm.go | 8 +- .../gen/wasi/random/insecure/insecure.wit.go | 17 +- .../gen/wasi/random/random/random.wasm.go | 8 +- .../gen/wasi/random/random/random.wit.go | 17 +- .../instance-network/instance-network.wit.go | 8 +- .../instance-network/instancenetwork.wasm.go | 2 +- .../ip-name-lookup/ip-name-lookup.wit.go | 20 +- .../ip-name-lookup/ipnamelookup.wasm.go | 10 +- .../tcp-create-socket.wit.go | 8 +- .../tcp-create-socket/tcpcreatesocket.wasm.go | 6 +- .../http-client/gen/wasi/sockets/tcp/abi.go | 19 -- .../gen/wasi/sockets/tcp/tcp.wasm.go | 60 ++-- .../gen/wasi/sockets/tcp/tcp.wit.go | 171 +++++----- .../udp-create-socket.wit.go | 8 +- .../udp-create-socket/udpcreatesocket.wasm.go | 6 +- .../http-client/gen/wasi/sockets/udp/abi.go | 13 - .../gen/wasi/sockets/udp/udp.wasm.go | 40 +-- .../gen/wasi/sockets/udp/udp.wit.go | 114 +++---- .../gen/wasmcloud/bus/lattice/lattice.wasm.go | 2 +- .../gen/wasmcloud/bus/lattice/lattice.wit.go | 5 +- .../wasmcloud/secrets/reveal/reveal.wasm.go | 2 +- .../wasmcloud/secrets/reveal/reveal.wit.go | 6 +- .../gen/wasmcloud/secrets/store/store.wasm.go | 6 +- .../gen/wasmcloud/secrets/store/store.wit.go | 6 +- examples/component/http-keyvalue-crud/go.mod | 3 + .../component/http-password-checker/README.md | 11 +- .../wasi/cli/environment/environment.wasm.go | 10 +- .../wasi/cli/environment/environment.wit.go | 22 +- .../gen/wasi/cli/stderr/stderr.wasm.go | 2 +- .../gen/wasi/cli/stderr/stderr.wit.go | 8 +- .../gen/wasi/cli/stdin/stdin.wasm.go | 2 +- .../gen/wasi/cli/stdin/stdin.wit.go | 8 +- .../gen/wasi/cli/stdout/stdout.wasm.go | 2 +- .../gen/wasi/cli/stdout/stdout.wit.go | 8 +- .../terminal-stderr/terminal-stderr.wit.go | 7 +- .../terminal-stderr/terminalstderr.wasm.go | 6 +- .../cli/terminal-stdin/terminal-stdin.wit.go | 7 +- .../cli/terminal-stdin/terminalstdin.wasm.go | 6 +- .../terminal-stdout/terminal-stdout.wit.go | 7 +- .../terminal-stdout/terminalstdout.wasm.go | 6 +- .../monotonic-clock/monotonic-clock.wit.go | 29 +- .../monotonic-clock/monotonicclock.wasm.go | 8 +- .../wasi/clocks/wall-clock/wall-clock.wit.go | 12 +- .../wasi/clocks/wall-clock/wallclock.wasm.go | 4 +- .../gen/wasi/config/runtime/runtime.wasm.go | 8 +- .../gen/wasi/config/runtime/runtime.wit.go | 12 +- .../wasi/filesystem/preopens/preopens.wasm.go | 6 +- .../wasi/filesystem/preopens/preopens.wit.go | 7 +- .../gen/wasi/filesystem/types/abi.go | 25 -- .../gen/wasi/filesystem/types/types.wasm.go | 62 ++-- .../gen/wasi/filesystem/types/types.wit.go | 178 +++++----- .../gen/wasi/http/outgoing-handler/abi.go | 8 - .../outgoing-handler/outgoing-handler.wit.go | 7 +- .../outgoing-handler/outgoinghandler.wasm.go | 6 +- .../gen/wasi/http/types/types.wasm.go | 100 +++--- .../gen/wasi/http/types/types.wit.go | 317 ++++++++---------- .../gen/wasi/io/error/error.wit.go | 6 +- .../gen/wasi/io/error/ioerror.wasm.go | 2 +- .../gen/wasi/io/poll/poll.wasm.go | 8 +- .../gen/wasi/io/poll/poll.wit.go | 13 +- .../gen/wasi/io/streams/streams.wasm.go | 34 +- .../gen/wasi/io/streams/streams.wit.go | 92 +++-- .../random/insecure-seed/insecure-seed.wit.go | 6 +- .../random/insecure-seed/insecureseed.wasm.go | 2 +- .../gen/wasi/random/insecure/insecure.wasm.go | 8 +- .../gen/wasi/random/insecure/insecure.wit.go | 17 +- .../gen/wasi/random/random/random.wasm.go | 8 +- .../gen/wasi/random/random/random.wit.go | 17 +- .../instance-network/instance-network.wit.go | 8 +- .../instance-network/instancenetwork.wasm.go | 2 +- .../ip-name-lookup/ip-name-lookup.wit.go | 20 +- .../ip-name-lookup/ipnamelookup.wasm.go | 10 +- .../tcp-create-socket.wit.go | 8 +- .../tcp-create-socket/tcpcreatesocket.wasm.go | 6 +- .../gen/wasi/sockets/tcp/abi.go | 19 -- .../gen/wasi/sockets/tcp/tcp.wasm.go | 60 ++-- .../gen/wasi/sockets/tcp/tcp.wit.go | 171 +++++----- .../udp-create-socket.wit.go | 8 +- .../udp-create-socket/udpcreatesocket.wasm.go | 6 +- .../gen/wasi/sockets/udp/abi.go | 13 - .../gen/wasi/sockets/udp/udp.wasm.go | 40 +-- .../gen/wasi/sockets/udp/udp.wit.go | 114 +++---- .../gen/wasmcloud/bus/lattice/lattice.wasm.go | 2 +- .../gen/wasmcloud/bus/lattice/lattice.wit.go | 5 +- .../wasmcloud/secrets/reveal/reveal.wasm.go | 2 +- .../wasmcloud/secrets/reveal/reveal.wit.go | 6 +- .../gen/wasmcloud/secrets/store/store.wasm.go | 6 +- .../gen/wasmcloud/secrets/store/store.wit.go | 6 +- examples/component/http-server/README.md | 11 +- .../wasi/cli/environment/environment.wasm.go | 10 +- .../wasi/cli/environment/environment.wit.go | 22 +- .../gen/wasi/cli/stderr/stderr.wasm.go | 2 +- .../gen/wasi/cli/stderr/stderr.wit.go | 8 +- .../gen/wasi/cli/stdin/stdin.wasm.go | 2 +- .../gen/wasi/cli/stdin/stdin.wit.go | 8 +- .../gen/wasi/cli/stdout/stdout.wasm.go | 2 +- .../gen/wasi/cli/stdout/stdout.wit.go | 8 +- .../terminal-stderr/terminal-stderr.wit.go | 7 +- .../terminal-stderr/terminalstderr.wasm.go | 6 +- .../cli/terminal-stdin/terminal-stdin.wit.go | 7 +- .../cli/terminal-stdin/terminalstdin.wasm.go | 6 +- .../terminal-stdout/terminal-stdout.wit.go | 7 +- .../terminal-stdout/terminalstdout.wasm.go | 6 +- .../monotonic-clock/monotonic-clock.wit.go | 29 +- .../monotonic-clock/monotonicclock.wasm.go | 8 +- .../wasi/clocks/wall-clock/wall-clock.wit.go | 12 +- .../wasi/clocks/wall-clock/wallclock.wasm.go | 4 +- .../gen/wasi/config/runtime/runtime.wasm.go | 8 +- .../gen/wasi/config/runtime/runtime.wit.go | 12 +- .../wasi/filesystem/preopens/preopens.wasm.go | 6 +- .../wasi/filesystem/preopens/preopens.wit.go | 7 +- .../gen/wasi/filesystem/types/abi.go | 25 -- .../gen/wasi/filesystem/types/types.wasm.go | 62 ++-- .../gen/wasi/filesystem/types/types.wit.go | 178 +++++----- .../gen/wasi/http/outgoing-handler/abi.go | 8 - .../outgoing-handler/outgoing-handler.wit.go | 7 +- .../outgoing-handler/outgoinghandler.wasm.go | 6 +- .../gen/wasi/http/types/types.wasm.go | 100 +++--- .../gen/wasi/http/types/types.wit.go | 317 ++++++++---------- .../gen/wasi/io/error/error.wit.go | 6 +- .../gen/wasi/io/error/ioerror.wasm.go | 2 +- .../http-server/gen/wasi/io/poll/poll.wasm.go | 8 +- .../http-server/gen/wasi/io/poll/poll.wit.go | 13 +- .../gen/wasi/io/streams/streams.wasm.go | 34 +- .../gen/wasi/io/streams/streams.wit.go | 92 +++-- .../random/insecure-seed/insecure-seed.wit.go | 6 +- .../random/insecure-seed/insecureseed.wasm.go | 2 +- .../gen/wasi/random/insecure/insecure.wasm.go | 8 +- .../gen/wasi/random/insecure/insecure.wit.go | 17 +- .../gen/wasi/random/random/random.wasm.go | 8 +- .../gen/wasi/random/random/random.wit.go | 17 +- .../instance-network/instance-network.wit.go | 8 +- .../instance-network/instancenetwork.wasm.go | 2 +- .../ip-name-lookup/ip-name-lookup.wit.go | 20 +- .../ip-name-lookup/ipnamelookup.wasm.go | 10 +- .../tcp-create-socket.wit.go | 8 +- .../tcp-create-socket/tcpcreatesocket.wasm.go | 6 +- .../http-server/gen/wasi/sockets/tcp/abi.go | 19 -- .../gen/wasi/sockets/tcp/tcp.wasm.go | 60 ++-- .../gen/wasi/sockets/tcp/tcp.wit.go | 171 +++++----- .../udp-create-socket.wit.go | 8 +- .../udp-create-socket/udpcreatesocket.wasm.go | 6 +- .../http-server/gen/wasi/sockets/udp/abi.go | 13 - .../gen/wasi/sockets/udp/udp.wasm.go | 40 +-- .../gen/wasi/sockets/udp/udp.wit.go | 114 +++---- .../gen/wasmcloud/bus/lattice/lattice.wasm.go | 2 +- .../gen/wasmcloud/bus/lattice/lattice.wit.go | 5 +- .../wasmcloud/secrets/reveal/reveal.wasm.go | 2 +- .../wasmcloud/secrets/reveal/reveal.wit.go | 6 +- .../gen/wasmcloud/secrets/store/store.wasm.go | 6 +- .../gen/wasmcloud/secrets/store/store.wit.go | 6 +- .../bindings.wadge_test.go | 14 +- examples/component/wasitel-http/README.md | 15 + .../wasi/cli/environment/environment.wasm.go | 10 +- .../wasi/cli/environment/environment.wit.go | 22 +- .../gen/wasi/cli/stderr/stderr.wasm.go | 2 +- .../gen/wasi/cli/stderr/stderr.wit.go | 8 +- .../gen/wasi/cli/stdin/stdin.wasm.go | 2 +- .../gen/wasi/cli/stdin/stdin.wit.go | 8 +- .../gen/wasi/cli/stdout/stdout.wasm.go | 2 +- .../gen/wasi/cli/stdout/stdout.wit.go | 8 +- .../terminal-stderr/terminal-stderr.wit.go | 7 +- .../terminal-stderr/terminalstderr.wasm.go | 6 +- .../cli/terminal-stdin/terminal-stdin.wit.go | 7 +- .../cli/terminal-stdin/terminalstdin.wasm.go | 6 +- .../terminal-stdout/terminal-stdout.wit.go | 7 +- .../terminal-stdout/terminalstdout.wasm.go | 6 +- .../monotonic-clock/monotonic-clock.wit.go | 29 +- .../monotonic-clock/monotonicclock.wasm.go | 8 +- .../wasi/clocks/wall-clock/wall-clock.wit.go | 12 +- .../wasi/clocks/wall-clock/wallclock.wasm.go | 4 +- .../gen/wasi/config/runtime/runtime.wasm.go | 8 +- .../gen/wasi/config/runtime/runtime.wit.go | 12 +- .../wasi/filesystem/preopens/preopens.wasm.go | 6 +- .../wasi/filesystem/preopens/preopens.wit.go | 7 +- .../gen/wasi/filesystem/types/abi.go | 25 -- .../gen/wasi/filesystem/types/types.wasm.go | 62 ++-- .../gen/wasi/filesystem/types/types.wit.go | 178 +++++----- .../gen/wasi/http/outgoing-handler/abi.go | 8 - .../outgoing-handler/outgoing-handler.wit.go | 7 +- .../outgoing-handler/outgoinghandler.wasm.go | 6 +- .../gen/wasi/http/types/types.wasm.go | 100 +++--- .../gen/wasi/http/types/types.wit.go | 317 ++++++++---------- .../gen/wasi/io/error/error.wit.go | 6 +- .../gen/wasi/io/error/ioerror.wasm.go | 2 +- .../gen/wasi/io/poll/poll.wasm.go | 8 +- .../wasitel-http/gen/wasi/io/poll/poll.wit.go | 13 +- .../gen/wasi/io/streams/streams.wasm.go | 34 +- .../gen/wasi/io/streams/streams.wit.go | 92 +++-- .../random/insecure-seed/insecure-seed.wit.go | 6 +- .../random/insecure-seed/insecureseed.wasm.go | 2 +- .../gen/wasi/random/insecure/insecure.wasm.go | 8 +- .../gen/wasi/random/insecure/insecure.wit.go | 17 +- .../gen/wasi/random/random/random.wasm.go | 8 +- .../gen/wasi/random/random/random.wit.go | 17 +- .../instance-network/instance-network.wit.go | 8 +- .../instance-network/instancenetwork.wasm.go | 2 +- .../ip-name-lookup/ip-name-lookup.wit.go | 20 +- .../ip-name-lookup/ipnamelookup.wasm.go | 10 +- .../tcp-create-socket.wit.go | 8 +- .../tcp-create-socket/tcpcreatesocket.wasm.go | 6 +- .../wasitel-http/gen/wasi/sockets/tcp/abi.go | 19 -- .../gen/wasi/sockets/tcp/tcp.wasm.go | 60 ++-- .../gen/wasi/sockets/tcp/tcp.wit.go | 171 +++++----- .../udp-create-socket.wit.go | 8 +- .../udp-create-socket/udpcreatesocket.wasm.go | 6 +- .../wasitel-http/gen/wasi/sockets/udp/abi.go | 13 - .../gen/wasi/sockets/udp/udp.wasm.go | 40 +-- .../gen/wasi/sockets/udp/udp.wit.go | 114 +++---- .../gen/wasmcloud/bus/lattice/lattice.wasm.go | 2 +- .../gen/wasmcloud/bus/lattice/lattice.wit.go | 5 +- .../wasmcloud/secrets/reveal/reveal.wasm.go | 2 +- .../wasmcloud/secrets/reveal/reveal.wit.go | 6 +- .../gen/wasmcloud/secrets/store/store.wasm.go | 6 +- .../gen/wasmcloud/secrets/store/store.wit.go | 6 +- 255 files changed, 2841 insertions(+), 3691 deletions(-) create mode 100644 examples/component/wasitel-http/README.md diff --git a/.gitignore b/.gitignore index 0405be52..1dfcd6e0 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ *.dll *.so *.dylib +*.wasm # Test binary, built with `go test -c` *.test @@ -24,3 +25,9 @@ go.work.sum # env file .env .envrc + +# Junk +.DS_Store + +# Go +gen/ \ No newline at end of file diff --git a/examples/component/http-client/README.md b/examples/component/http-client/README.md index 09ff3c66..e42f183b 100644 --- a/examples/component/http-client/README.md +++ b/examples/component/http-client/README.md @@ -18,13 +18,6 @@ The application... ## 📦 Dependencies -> [!WARNING] -> Due to incompatibilities introduced in `wasm-tools` v1.226.0, a version of -> `wasm-tools` <= 1.225.0 is **required** for running this example. -> -> You can install `wasm-tools` [v1.225.0 from upstream releases](https://github.com/bytecodealliance/wasm-tools/releases/tag/v1.225.0), or use -> `cargo` ([Rust toolchain](https://doc.rust-lang.org/cargo/getting-started/installation.html)) -- (i.e. `cargo install --locked wasm-tools@1.225.0`) - Before starting, ensure that you have the following installed in addition to the Go (1.23+) toolchain: - [`tinygo`](https://tinygo.org/getting-started/install/) for compiling Go (always use the latest version) @@ -97,6 +90,10 @@ You can stop the `wash dev` process with `Ctrl-C`. ## ⚠️ Issues/FAQ +### Build errors + +New releases of `wasm-tools` may introduce compatibility issues that can result in build errors. If you encounter issues, try using v1.225.0, which is currently the most consistent for Go builds. You can install `wasm-tools` [v1.225.0 from upstream releases](https://github.com/bytecodealliance/wasm-tools/releases/tag/v1.225.0), or use `cargo` ([Rust toolchain](https://doc.rust-lang.org/cargo/getting-started/installation.html)) -- (i.e. `cargo install --locked wasm-tools@1.225.0`) + ### `curl` produces a "failed to invoke" error If `curl`ing produces... diff --git a/examples/component/http-client/gen/wasi/cli/environment/environment.wasm.go b/examples/component/http-client/gen/wasi/cli/environment/environment.wasm.go index 89bb596b..b4c02ba4 100755 --- a/examples/component/http-client/gen/wasi/cli/environment/environment.wasm.go +++ b/examples/component/http-client/gen/wasi/cli/environment/environment.wasm.go @@ -2,20 +2,16 @@ package environment -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". //go:wasmimport wasi:cli/environment@0.2.0 get-environment //go:noescape -func wasmimport_GetEnvironment(result *cm.List[[2]string]) +func wasmimport_GetEnvironment() //go:wasmimport wasi:cli/environment@0.2.0 get-arguments //go:noescape -func wasmimport_GetArguments(result *cm.List[string]) +func wasmimport_GetArguments() //go:wasmimport wasi:cli/environment@0.2.0 initial-cwd //go:noescape -func wasmimport_InitialCWD(result *cm.Option[string]) +func wasmimport_InitialCWD() diff --git a/examples/component/http-client/gen/wasi/cli/environment/environment.wit.go b/examples/component/http-client/gen/wasi/cli/environment/environment.wit.go index 068bed33..7d1f8133 100755 --- a/examples/component/http-client/gen/wasi/cli/environment/environment.wit.go +++ b/examples/component/http-client/gen/wasi/cli/environment/environment.wit.go @@ -3,36 +3,32 @@ // Package environment represents the imported interface "wasi:cli/environment@0.2.0". package environment -import ( - "go.bytecodealliance.org/cm" -) - // GetEnvironment represents the imported function "get-environment". // -// get-environment: func() -> list> +// get-environment: func() // //go:nosplit -func GetEnvironment() (result cm.List[[2]string]) { - wasmimport_GetEnvironment(&result) +func GetEnvironment() { + wasmimport_GetEnvironment() return } // GetArguments represents the imported function "get-arguments". // -// get-arguments: func() -> list +// get-arguments: func() // //go:nosplit -func GetArguments() (result cm.List[string]) { - wasmimport_GetArguments(&result) +func GetArguments() { + wasmimport_GetArguments() return } // InitialCWD represents the imported function "initial-cwd". // -// initial-cwd: func() -> option +// initial-cwd: func() // //go:nosplit -func InitialCWD() (result cm.Option[string]) { - wasmimport_InitialCWD(&result) +func InitialCWD() { + wasmimport_InitialCWD() return } diff --git a/examples/component/http-client/gen/wasi/cli/stderr/stderr.wasm.go b/examples/component/http-client/gen/wasi/cli/stderr/stderr.wasm.go index 462cf172..9c5bcdb9 100755 --- a/examples/component/http-client/gen/wasi/cli/stderr/stderr.wasm.go +++ b/examples/component/http-client/gen/wasi/cli/stderr/stderr.wasm.go @@ -6,4 +6,4 @@ package stderr //go:wasmimport wasi:cli/stderr@0.2.0 get-stderr //go:noescape -func wasmimport_GetStderr() (result0 uint32) +func wasmimport_GetStderr() diff --git a/examples/component/http-client/gen/wasi/cli/stderr/stderr.wit.go b/examples/component/http-client/gen/wasi/cli/stderr/stderr.wit.go index d00a972a..c124719e 100755 --- a/examples/component/http-client/gen/wasi/cli/stderr/stderr.wit.go +++ b/examples/component/http-client/gen/wasi/cli/stderr/stderr.wit.go @@ -5,7 +5,6 @@ package stderr import ( "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/io/streams" - "go.bytecodealliance.org/cm" ) // OutputStream represents the imported type alias "wasi:cli/stderr@0.2.0#output-stream". @@ -15,11 +14,10 @@ type OutputStream = streams.OutputStream // GetStderr represents the imported function "get-stderr". // -// get-stderr: func() -> output-stream +// get-stderr: func() // //go:nosplit -func GetStderr() (result OutputStream) { - result0 := wasmimport_GetStderr() - result = cm.Reinterpret[OutputStream]((uint32)(result0)) +func GetStderr() { + wasmimport_GetStderr() return } diff --git a/examples/component/http-client/gen/wasi/cli/stdin/stdin.wasm.go b/examples/component/http-client/gen/wasi/cli/stdin/stdin.wasm.go index 374eb253..090f2e31 100755 --- a/examples/component/http-client/gen/wasi/cli/stdin/stdin.wasm.go +++ b/examples/component/http-client/gen/wasi/cli/stdin/stdin.wasm.go @@ -6,4 +6,4 @@ package stdin //go:wasmimport wasi:cli/stdin@0.2.0 get-stdin //go:noescape -func wasmimport_GetStdin() (result0 uint32) +func wasmimport_GetStdin() diff --git a/examples/component/http-client/gen/wasi/cli/stdin/stdin.wit.go b/examples/component/http-client/gen/wasi/cli/stdin/stdin.wit.go index 2d7cfd2d..4fb261bf 100755 --- a/examples/component/http-client/gen/wasi/cli/stdin/stdin.wit.go +++ b/examples/component/http-client/gen/wasi/cli/stdin/stdin.wit.go @@ -5,7 +5,6 @@ package stdin import ( "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/io/streams" - "go.bytecodealliance.org/cm" ) // InputStream represents the imported type alias "wasi:cli/stdin@0.2.0#input-stream". @@ -15,11 +14,10 @@ type InputStream = streams.InputStream // GetStdin represents the imported function "get-stdin". // -// get-stdin: func() -> input-stream +// get-stdin: func() // //go:nosplit -func GetStdin() (result InputStream) { - result0 := wasmimport_GetStdin() - result = cm.Reinterpret[InputStream]((uint32)(result0)) +func GetStdin() { + wasmimport_GetStdin() return } diff --git a/examples/component/http-client/gen/wasi/cli/stdout/stdout.wasm.go b/examples/component/http-client/gen/wasi/cli/stdout/stdout.wasm.go index 68e4a3da..1a1a2650 100755 --- a/examples/component/http-client/gen/wasi/cli/stdout/stdout.wasm.go +++ b/examples/component/http-client/gen/wasi/cli/stdout/stdout.wasm.go @@ -6,4 +6,4 @@ package stdout //go:wasmimport wasi:cli/stdout@0.2.0 get-stdout //go:noescape -func wasmimport_GetStdout() (result0 uint32) +func wasmimport_GetStdout() diff --git a/examples/component/http-client/gen/wasi/cli/stdout/stdout.wit.go b/examples/component/http-client/gen/wasi/cli/stdout/stdout.wit.go index 9564b8ae..a0a16fb0 100755 --- a/examples/component/http-client/gen/wasi/cli/stdout/stdout.wit.go +++ b/examples/component/http-client/gen/wasi/cli/stdout/stdout.wit.go @@ -5,7 +5,6 @@ package stdout import ( "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/io/streams" - "go.bytecodealliance.org/cm" ) // OutputStream represents the imported type alias "wasi:cli/stdout@0.2.0#output-stream". @@ -15,11 +14,10 @@ type OutputStream = streams.OutputStream // GetStdout represents the imported function "get-stdout". // -// get-stdout: func() -> output-stream +// get-stdout: func() // //go:nosplit -func GetStdout() (result OutputStream) { - result0 := wasmimport_GetStdout() - result = cm.Reinterpret[OutputStream]((uint32)(result0)) +func GetStdout() { + wasmimport_GetStdout() return } diff --git a/examples/component/http-client/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go b/examples/component/http-client/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go index 3f1c4e28..76a4b8cb 100755 --- a/examples/component/http-client/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go +++ b/examples/component/http-client/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go @@ -5,7 +5,6 @@ package terminalstderr import ( terminaloutput "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/cli/terminal-output" - "go.bytecodealliance.org/cm" ) // TerminalOutput represents the imported type alias "wasi:cli/terminal-stderr@0.2.0#terminal-output". @@ -15,10 +14,10 @@ type TerminalOutput = terminaloutput.TerminalOutput // GetTerminalStderr represents the imported function "get-terminal-stderr". // -// get-terminal-stderr: func() -> option +// get-terminal-stderr: func() // //go:nosplit -func GetTerminalStderr() (result cm.Option[TerminalOutput]) { - wasmimport_GetTerminalStderr(&result) +func GetTerminalStderr() { + wasmimport_GetTerminalStderr() return } diff --git a/examples/component/http-client/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go b/examples/component/http-client/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go index be9af72f..03cbe909 100755 --- a/examples/component/http-client/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go +++ b/examples/component/http-client/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go @@ -2,12 +2,8 @@ package terminalstderr -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". //go:wasmimport wasi:cli/terminal-stderr@0.2.0 get-terminal-stderr //go:noescape -func wasmimport_GetTerminalStderr(result *cm.Option[TerminalOutput]) +func wasmimport_GetTerminalStderr() diff --git a/examples/component/http-client/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go b/examples/component/http-client/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go index c5e5aea1..8f74fdb2 100755 --- a/examples/component/http-client/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go +++ b/examples/component/http-client/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go @@ -5,7 +5,6 @@ package terminalstdin import ( terminalinput "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/cli/terminal-input" - "go.bytecodealliance.org/cm" ) // TerminalInput represents the imported type alias "wasi:cli/terminal-stdin@0.2.0#terminal-input". @@ -15,10 +14,10 @@ type TerminalInput = terminalinput.TerminalInput // GetTerminalStdin represents the imported function "get-terminal-stdin". // -// get-terminal-stdin: func() -> option +// get-terminal-stdin: func() // //go:nosplit -func GetTerminalStdin() (result cm.Option[TerminalInput]) { - wasmimport_GetTerminalStdin(&result) +func GetTerminalStdin() { + wasmimport_GetTerminalStdin() return } diff --git a/examples/component/http-client/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go b/examples/component/http-client/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go index e3b3ac61..1a59d9fd 100755 --- a/examples/component/http-client/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go +++ b/examples/component/http-client/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go @@ -2,12 +2,8 @@ package terminalstdin -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". //go:wasmimport wasi:cli/terminal-stdin@0.2.0 get-terminal-stdin //go:noescape -func wasmimport_GetTerminalStdin(result *cm.Option[TerminalInput]) +func wasmimport_GetTerminalStdin() diff --git a/examples/component/http-client/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go b/examples/component/http-client/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go index 533f1f18..088721c1 100755 --- a/examples/component/http-client/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go +++ b/examples/component/http-client/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go @@ -5,7 +5,6 @@ package terminalstdout import ( terminaloutput "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/cli/terminal-output" - "go.bytecodealliance.org/cm" ) // TerminalOutput represents the imported type alias "wasi:cli/terminal-stdout@0.2.0#terminal-output". @@ -15,10 +14,10 @@ type TerminalOutput = terminaloutput.TerminalOutput // GetTerminalStdout represents the imported function "get-terminal-stdout". // -// get-terminal-stdout: func() -> option +// get-terminal-stdout: func() // //go:nosplit -func GetTerminalStdout() (result cm.Option[TerminalOutput]) { - wasmimport_GetTerminalStdout(&result) +func GetTerminalStdout() { + wasmimport_GetTerminalStdout() return } diff --git a/examples/component/http-client/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go b/examples/component/http-client/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go index fa750ad9..c45db1d2 100755 --- a/examples/component/http-client/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go +++ b/examples/component/http-client/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go @@ -2,12 +2,8 @@ package terminalstdout -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". //go:wasmimport wasi:cli/terminal-stdout@0.2.0 get-terminal-stdout //go:noescape -func wasmimport_GetTerminalStdout(result *cm.Option[TerminalOutput]) +func wasmimport_GetTerminalStdout() diff --git a/examples/component/http-client/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go b/examples/component/http-client/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go index 2a2ffcb7..d7e40039 100755 --- a/examples/component/http-client/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go +++ b/examples/component/http-client/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go @@ -5,7 +5,6 @@ package monotonicclock import ( "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/io/poll" - "go.bytecodealliance.org/cm" ) // Pollable represents the imported type alias "wasi:clocks/monotonic-clock@0.2.0#pollable". @@ -25,46 +24,42 @@ type Duration uint64 // Now represents the imported function "now". // -// now: func() -> instant +// now: func() // //go:nosplit -func Now() (result Instant) { - result0 := wasmimport_Now() - result = (Instant)((uint64)(result0)) +func Now() { + wasmimport_Now() return } // Resolution represents the imported function "resolution". // -// resolution: func() -> duration +// resolution: func() // //go:nosplit -func Resolution() (result Duration) { - result0 := wasmimport_Resolution() - result = (Duration)((uint64)(result0)) +func Resolution() { + wasmimport_Resolution() return } // SubscribeInstant represents the imported function "subscribe-instant". // -// subscribe-instant: func(when: instant) -> pollable +// subscribe-instant: func(when: instant) // //go:nosplit -func SubscribeInstant(when Instant) (result Pollable) { +func SubscribeInstant(when Instant) { when0 := (uint64)(when) - result0 := wasmimport_SubscribeInstant((uint64)(when0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_SubscribeInstant((uint64)(when0)) return } // SubscribeDuration represents the imported function "subscribe-duration". // -// subscribe-duration: func(when: duration) -> pollable +// subscribe-duration: func(when: duration) // //go:nosplit -func SubscribeDuration(when Duration) (result Pollable) { +func SubscribeDuration(when Duration) { when0 := (uint64)(when) - result0 := wasmimport_SubscribeDuration((uint64)(when0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_SubscribeDuration((uint64)(when0)) return } diff --git a/examples/component/http-client/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go b/examples/component/http-client/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go index 36a1720a..4494c61a 100755 --- a/examples/component/http-client/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go +++ b/examples/component/http-client/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go @@ -6,16 +6,16 @@ package monotonicclock //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 now //go:noescape -func wasmimport_Now() (result0 uint64) +func wasmimport_Now() //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 resolution //go:noescape -func wasmimport_Resolution() (result0 uint64) +func wasmimport_Resolution() //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 subscribe-instant //go:noescape -func wasmimport_SubscribeInstant(when0 uint64) (result0 uint32) +func wasmimport_SubscribeInstant(when0 uint64) //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 subscribe-duration //go:noescape -func wasmimport_SubscribeDuration(when0 uint64) (result0 uint32) +func wasmimport_SubscribeDuration(when0 uint64) diff --git a/examples/component/http-client/gen/wasi/clocks/wall-clock/wall-clock.wit.go b/examples/component/http-client/gen/wasi/clocks/wall-clock/wall-clock.wit.go index e3f35395..308f0910 100755 --- a/examples/component/http-client/gen/wasi/clocks/wall-clock/wall-clock.wit.go +++ b/examples/component/http-client/gen/wasi/clocks/wall-clock/wall-clock.wit.go @@ -21,20 +21,20 @@ type DateTime struct { // Now represents the imported function "now". // -// now: func() -> datetime +// now: func() // //go:nosplit -func Now() (result DateTime) { - wasmimport_Now(&result) +func Now() { + wasmimport_Now() return } // Resolution represents the imported function "resolution". // -// resolution: func() -> datetime +// resolution: func() // //go:nosplit -func Resolution() (result DateTime) { - wasmimport_Resolution(&result) +func Resolution() { + wasmimport_Resolution() return } diff --git a/examples/component/http-client/gen/wasi/clocks/wall-clock/wallclock.wasm.go b/examples/component/http-client/gen/wasi/clocks/wall-clock/wallclock.wasm.go index 321ff3f1..4efbaf84 100755 --- a/examples/component/http-client/gen/wasi/clocks/wall-clock/wallclock.wasm.go +++ b/examples/component/http-client/gen/wasi/clocks/wall-clock/wallclock.wasm.go @@ -6,8 +6,8 @@ package wallclock //go:wasmimport wasi:clocks/wall-clock@0.2.0 now //go:noescape -func wasmimport_Now(result *DateTime) +func wasmimport_Now() //go:wasmimport wasi:clocks/wall-clock@0.2.0 resolution //go:noescape -func wasmimport_Resolution(result *DateTime) +func wasmimport_Resolution() diff --git a/examples/component/http-client/gen/wasi/config/runtime/runtime.wasm.go b/examples/component/http-client/gen/wasi/config/runtime/runtime.wasm.go index 8ce17d5e..4abfb286 100755 --- a/examples/component/http-client/gen/wasi/config/runtime/runtime.wasm.go +++ b/examples/component/http-client/gen/wasi/config/runtime/runtime.wasm.go @@ -2,16 +2,12 @@ package runtime -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:config@0.2.0-draft". //go:wasmimport wasi:config/runtime@0.2.0-draft get //go:noescape -func wasmimport_Get(key0 *uint8, key1 uint32, result *cm.Result[OptionStringShape, cm.Option[string], ConfigError]) +func wasmimport_Get(key0 *uint8, key1 uint32) //go:wasmimport wasi:config/runtime@0.2.0-draft get-all //go:noescape -func wasmimport_GetAll(result *cm.Result[ConfigErrorShape, cm.List[[2]string], ConfigError]) +func wasmimport_GetAll() diff --git a/examples/component/http-client/gen/wasi/config/runtime/runtime.wit.go b/examples/component/http-client/gen/wasi/config/runtime/runtime.wit.go index 99a739d1..204a5c0c 100755 --- a/examples/component/http-client/gen/wasi/config/runtime/runtime.wit.go +++ b/examples/component/http-client/gen/wasi/config/runtime/runtime.wit.go @@ -47,21 +47,21 @@ func (v ConfigError) String() string { // Get represents the imported function "get". // -// get: func(key: string) -> result, config-error> +// get: func(key: string) // //go:nosplit -func Get(key string) (result cm.Result[OptionStringShape, cm.Option[string], ConfigError]) { +func Get(key string) { key0, key1 := cm.LowerString(key) - wasmimport_Get((*uint8)(key0), (uint32)(key1), &result) + wasmimport_Get((*uint8)(key0), (uint32)(key1)) return } // GetAll represents the imported function "get-all". // -// get-all: func() -> result>, config-error> +// get-all: func() // //go:nosplit -func GetAll() (result cm.Result[ConfigErrorShape, cm.List[[2]string], ConfigError]) { - wasmimport_GetAll(&result) +func GetAll() { + wasmimport_GetAll() return } diff --git a/examples/component/http-client/gen/wasi/filesystem/preopens/preopens.wasm.go b/examples/component/http-client/gen/wasi/filesystem/preopens/preopens.wasm.go index 1bcd416a..50885ee0 100755 --- a/examples/component/http-client/gen/wasi/filesystem/preopens/preopens.wasm.go +++ b/examples/component/http-client/gen/wasi/filesystem/preopens/preopens.wasm.go @@ -2,12 +2,8 @@ package preopens -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:filesystem@0.2.0". //go:wasmimport wasi:filesystem/preopens@0.2.0 get-directories //go:noescape -func wasmimport_GetDirectories(result *cm.List[cm.Tuple[Descriptor, string]]) +func wasmimport_GetDirectories() diff --git a/examples/component/http-client/gen/wasi/filesystem/preopens/preopens.wit.go b/examples/component/http-client/gen/wasi/filesystem/preopens/preopens.wit.go index 628f25e1..edbff5a2 100755 --- a/examples/component/http-client/gen/wasi/filesystem/preopens/preopens.wit.go +++ b/examples/component/http-client/gen/wasi/filesystem/preopens/preopens.wit.go @@ -5,7 +5,6 @@ package preopens import ( "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/filesystem/types" - "go.bytecodealliance.org/cm" ) // Descriptor represents the imported type alias "wasi:filesystem/preopens@0.2.0#descriptor". @@ -15,10 +14,10 @@ type Descriptor = types.Descriptor // GetDirectories represents the imported function "get-directories". // -// get-directories: func() -> list> +// get-directories: func() // //go:nosplit -func GetDirectories() (result cm.List[cm.Tuple[Descriptor, string]]) { - wasmimport_GetDirectories(&result) +func GetDirectories() { + wasmimport_GetDirectories() return } diff --git a/examples/component/http-client/gen/wasi/filesystem/types/abi.go b/examples/component/http-client/gen/wasi/filesystem/types/abi.go index 4ef3d4c2..fd744592 100755 --- a/examples/component/http-client/gen/wasi/filesystem/types/abi.go +++ b/examples/component/http-client/gen/wasi/filesystem/types/abi.go @@ -5,21 +5,8 @@ package types import ( wallclock "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/clocks/wall-clock" "go.bytecodealliance.org/cm" - "unsafe" ) -// MetadataHashValueShape is used for storage in variant or result types. -type MetadataHashValueShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(MetadataHashValue{})]byte -} - -// TupleListU8BoolShape is used for storage in variant or result types. -type TupleListU8BoolShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Tuple[cm.List[uint8], bool]{})]byte -} - func lower_DateTime(v wallclock.DateTime) (f0 uint64, f1 uint32) { f0 = (uint64)(v.Seconds) f1 = (uint32)(v.Nanoseconds) @@ -36,15 +23,3 @@ func lower_NewTimestamp(v NewTimestamp) (f0 uint32, f1 uint64, f2 uint32) { } return } - -// DescriptorStatShape is used for storage in variant or result types. -type DescriptorStatShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(DescriptorStat{})]byte -} - -// OptionDirectoryEntryShape is used for storage in variant or result types. -type OptionDirectoryEntryShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Option[DirectoryEntry]{})]byte -} diff --git a/examples/component/http-client/gen/wasi/filesystem/types/types.wasm.go b/examples/component/http-client/gen/wasi/filesystem/types/types.wasm.go index b97dad84..7a2b9993 100755 --- a/examples/component/http-client/gen/wasi/filesystem/types/types.wasm.go +++ b/examples/component/http-client/gen/wasi/filesystem/types/types.wasm.go @@ -2,10 +2,6 @@ package types -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:filesystem@0.2.0". //go:wasmimport wasi:filesystem/types@0.2.0 [resource-drop]descriptor @@ -14,111 +10,111 @@ func wasmimport_DescriptorResourceDrop(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.advise //go:noescape -func wasmimport_DescriptorAdvise(self0 uint32, offset0 uint64, length0 uint64, advice0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorAdvise(self0 uint32, offset0 uint64, length0 uint64, advice0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.append-via-stream //go:noescape -func wasmimport_DescriptorAppendViaStream(self0 uint32, result *cm.Result[OutputStream, OutputStream, ErrorCode]) +func wasmimport_DescriptorAppendViaStream(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.create-directory-at //go:noescape -func wasmimport_DescriptorCreateDirectoryAt(self0 uint32, path0 *uint8, path1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorCreateDirectoryAt(self0 uint32, path0 *uint8, path1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.get-flags //go:noescape -func wasmimport_DescriptorGetFlags(self0 uint32, result *cm.Result[DescriptorFlags, DescriptorFlags, ErrorCode]) +func wasmimport_DescriptorGetFlags(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.get-type //go:noescape -func wasmimport_DescriptorGetType(self0 uint32, result *cm.Result[DescriptorType, DescriptorType, ErrorCode]) +func wasmimport_DescriptorGetType(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.is-same-object //go:noescape -func wasmimport_DescriptorIsSameObject(self0 uint32, other0 uint32) (result0 uint32) +func wasmimport_DescriptorIsSameObject(self0 uint32, other0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.link-at //go:noescape -func wasmimport_DescriptorLinkAt(self0 uint32, oldPathFlags0 uint32, oldPath0 *uint8, oldPath1 uint32, newDescriptor0 uint32, newPath0 *uint8, newPath1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorLinkAt(self0 uint32, oldPathFlags0 uint32, oldPath0 *uint8, oldPath1 uint32, newDescriptor0 uint32, newPath0 *uint8, newPath1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.metadata-hash //go:noescape -func wasmimport_DescriptorMetadataHash(self0 uint32, result *cm.Result[MetadataHashValueShape, MetadataHashValue, ErrorCode]) +func wasmimport_DescriptorMetadataHash(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.metadata-hash-at //go:noescape -func wasmimport_DescriptorMetadataHashAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, result *cm.Result[MetadataHashValueShape, MetadataHashValue, ErrorCode]) +func wasmimport_DescriptorMetadataHashAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.open-at //go:noescape -func wasmimport_DescriptorOpenAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, openFlags0 uint32, flags0 uint32, result *cm.Result[Descriptor, Descriptor, ErrorCode]) +func wasmimport_DescriptorOpenAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, openFlags0 uint32, flags0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.read //go:noescape -func wasmimport_DescriptorRead(self0 uint32, length0 uint64, offset0 uint64, result *cm.Result[TupleListU8BoolShape, cm.Tuple[cm.List[uint8], bool], ErrorCode]) +func wasmimport_DescriptorRead(self0 uint32, length0 uint64, offset0 uint64) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.read-directory //go:noescape -func wasmimport_DescriptorReadDirectory(self0 uint32, result *cm.Result[DirectoryEntryStream, DirectoryEntryStream, ErrorCode]) +func wasmimport_DescriptorReadDirectory(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.read-via-stream //go:noescape -func wasmimport_DescriptorReadViaStream(self0 uint32, offset0 uint64, result *cm.Result[InputStream, InputStream, ErrorCode]) +func wasmimport_DescriptorReadViaStream(self0 uint32, offset0 uint64) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.readlink-at //go:noescape -func wasmimport_DescriptorReadLinkAt(self0 uint32, path0 *uint8, path1 uint32, result *cm.Result[string, string, ErrorCode]) +func wasmimport_DescriptorReadLinkAt(self0 uint32, path0 *uint8, path1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.remove-directory-at //go:noescape -func wasmimport_DescriptorRemoveDirectoryAt(self0 uint32, path0 *uint8, path1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorRemoveDirectoryAt(self0 uint32, path0 *uint8, path1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.rename-at //go:noescape -func wasmimport_DescriptorRenameAt(self0 uint32, oldPath0 *uint8, oldPath1 uint32, newDescriptor0 uint32, newPath0 *uint8, newPath1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorRenameAt(self0 uint32, oldPath0 *uint8, oldPath1 uint32, newDescriptor0 uint32, newPath0 *uint8, newPath1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.set-size //go:noescape -func wasmimport_DescriptorSetSize(self0 uint32, size0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorSetSize(self0 uint32, size0 uint64) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.set-times //go:noescape -func wasmimport_DescriptorSetTimes(self0 uint32, dataAccessTimestamp0 uint32, dataAccessTimestamp1 uint64, dataAccessTimestamp2 uint32, dataModificationTimestamp0 uint32, dataModificationTimestamp1 uint64, dataModificationTimestamp2 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorSetTimes(self0 uint32, dataAccessTimestamp0 uint32, dataAccessTimestamp1 uint64, dataAccessTimestamp2 uint32, dataModificationTimestamp0 uint32, dataModificationTimestamp1 uint64, dataModificationTimestamp2 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.set-times-at //go:noescape -func wasmimport_DescriptorSetTimesAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, dataAccessTimestamp0 uint32, dataAccessTimestamp1 uint64, dataAccessTimestamp2 uint32, dataModificationTimestamp0 uint32, dataModificationTimestamp1 uint64, dataModificationTimestamp2 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorSetTimesAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, dataAccessTimestamp0 uint32, dataAccessTimestamp1 uint64, dataAccessTimestamp2 uint32, dataModificationTimestamp0 uint32, dataModificationTimestamp1 uint64, dataModificationTimestamp2 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.stat //go:noescape -func wasmimport_DescriptorStat(self0 uint32, result *cm.Result[DescriptorStatShape, DescriptorStat, ErrorCode]) +func wasmimport_DescriptorStat(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.stat-at //go:noescape -func wasmimport_DescriptorStatAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, result *cm.Result[DescriptorStatShape, DescriptorStat, ErrorCode]) +func wasmimport_DescriptorStatAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.symlink-at //go:noescape -func wasmimport_DescriptorSymlinkAt(self0 uint32, oldPath0 *uint8, oldPath1 uint32, newPath0 *uint8, newPath1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorSymlinkAt(self0 uint32, oldPath0 *uint8, oldPath1 uint32, newPath0 *uint8, newPath1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.sync //go:noescape -func wasmimport_DescriptorSync(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorSync(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.sync-data //go:noescape -func wasmimport_DescriptorSyncData(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorSyncData(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.unlink-file-at //go:noescape -func wasmimport_DescriptorUnlinkFileAt(self0 uint32, path0 *uint8, path1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorUnlinkFileAt(self0 uint32, path0 *uint8, path1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.write //go:noescape -func wasmimport_DescriptorWrite(self0 uint32, buffer0 *uint8, buffer1 uint32, offset0 uint64, result *cm.Result[uint64, FileSize, ErrorCode]) +func wasmimport_DescriptorWrite(self0 uint32, buffer0 *uint8, buffer1 uint32, offset0 uint64) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.write-via-stream //go:noescape -func wasmimport_DescriptorWriteViaStream(self0 uint32, offset0 uint64, result *cm.Result[OutputStream, OutputStream, ErrorCode]) +func wasmimport_DescriptorWriteViaStream(self0 uint32, offset0 uint64) //go:wasmimport wasi:filesystem/types@0.2.0 [resource-drop]directory-entry-stream //go:noescape @@ -126,8 +122,8 @@ func wasmimport_DirectoryEntryStreamResourceDrop(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]directory-entry-stream.read-directory-entry //go:noescape -func wasmimport_DirectoryEntryStreamReadDirectoryEntry(self0 uint32, result *cm.Result[OptionDirectoryEntryShape, cm.Option[DirectoryEntry], ErrorCode]) +func wasmimport_DirectoryEntryStreamReadDirectoryEntry(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 filesystem-error-code //go:noescape -func wasmimport_FilesystemErrorCode(err0 uint32, result *cm.Option[ErrorCode]) +func wasmimport_FilesystemErrorCode(err0 uint32) diff --git a/examples/component/http-client/gen/wasi/filesystem/types/types.wit.go b/examples/component/http-client/gen/wasi/filesystem/types/types.wit.go index d47ee607..7e4f8ee7 100755 --- a/examples/component/http-client/gen/wasi/filesystem/types/types.wit.go +++ b/examples/component/http-client/gen/wasi/filesystem/types/types.wit.go @@ -406,345 +406,341 @@ func (self Descriptor) ResourceDrop() { // Advise represents the imported method "advise". // -// advise: func(offset: filesize, length: filesize, advice: advice) -> result<_, error-code> +// advise: func(offset: filesize, length: filesize, advice: advice) // //go:nosplit -func (self Descriptor) Advise(offset FileSize, length FileSize, advice Advice) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) Advise(offset FileSize, length FileSize, advice Advice) { self0 := cm.Reinterpret[uint32](self) offset0 := (uint64)(offset) length0 := (uint64)(length) advice0 := (uint32)(advice) - wasmimport_DescriptorAdvise((uint32)(self0), (uint64)(offset0), (uint64)(length0), (uint32)(advice0), &result) + wasmimport_DescriptorAdvise((uint32)(self0), (uint64)(offset0), (uint64)(length0), (uint32)(advice0)) return } // AppendViaStream represents the imported method "append-via-stream". // -// append-via-stream: func() -> result +// append-via-stream: func() // //go:nosplit -func (self Descriptor) AppendViaStream() (result cm.Result[OutputStream, OutputStream, ErrorCode]) { +func (self Descriptor) AppendViaStream() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorAppendViaStream((uint32)(self0), &result) + wasmimport_DescriptorAppendViaStream((uint32)(self0)) return } // CreateDirectoryAt represents the imported method "create-directory-at". // -// create-directory-at: func(path: string) -> result<_, error-code> +// create-directory-at: func(path: string) // //go:nosplit -func (self Descriptor) CreateDirectoryAt(path string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) CreateDirectoryAt(path string) { self0 := cm.Reinterpret[uint32](self) path0, path1 := cm.LowerString(path) - wasmimport_DescriptorCreateDirectoryAt((uint32)(self0), (*uint8)(path0), (uint32)(path1), &result) + wasmimport_DescriptorCreateDirectoryAt((uint32)(self0), (*uint8)(path0), (uint32)(path1)) return } // GetFlags represents the imported method "get-flags". // -// get-flags: func() -> result +// get-flags: func() // //go:nosplit -func (self Descriptor) GetFlags() (result cm.Result[DescriptorFlags, DescriptorFlags, ErrorCode]) { +func (self Descriptor) GetFlags() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorGetFlags((uint32)(self0), &result) + wasmimport_DescriptorGetFlags((uint32)(self0)) return } // GetType represents the imported method "get-type". // -// get-type: func() -> result +// get-type: func() // //go:nosplit -func (self Descriptor) GetType() (result cm.Result[DescriptorType, DescriptorType, ErrorCode]) { +func (self Descriptor) GetType() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorGetType((uint32)(self0), &result) + wasmimport_DescriptorGetType((uint32)(self0)) return } // IsSameObject represents the imported method "is-same-object". // -// is-same-object: func(other: borrow) -> bool +// is-same-object: func(other: borrow) // //go:nosplit -func (self Descriptor) IsSameObject(other Descriptor) (result bool) { +func (self Descriptor) IsSameObject(other Descriptor) { self0 := cm.Reinterpret[uint32](self) other0 := cm.Reinterpret[uint32](other) - result0 := wasmimport_DescriptorIsSameObject((uint32)(self0), (uint32)(other0)) - result = (bool)(cm.U32ToBool((uint32)(result0))) + wasmimport_DescriptorIsSameObject((uint32)(self0), (uint32)(other0)) return } // LinkAt represents the imported method "link-at". // // link-at: func(old-path-flags: path-flags, old-path: string, new-descriptor: borrow, -// new-path: string) -> result<_, error-code> +// new-path: string) // //go:nosplit -func (self Descriptor) LinkAt(oldPathFlags PathFlags, oldPath string, newDescriptor Descriptor, newPath string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) LinkAt(oldPathFlags PathFlags, oldPath string, newDescriptor Descriptor, newPath string) { self0 := cm.Reinterpret[uint32](self) oldPathFlags0 := (uint32)(oldPathFlags) oldPath0, oldPath1 := cm.LowerString(oldPath) newDescriptor0 := cm.Reinterpret[uint32](newDescriptor) newPath0, newPath1 := cm.LowerString(newPath) - wasmimport_DescriptorLinkAt((uint32)(self0), (uint32)(oldPathFlags0), (*uint8)(oldPath0), (uint32)(oldPath1), (uint32)(newDescriptor0), (*uint8)(newPath0), (uint32)(newPath1), &result) + wasmimport_DescriptorLinkAt((uint32)(self0), (uint32)(oldPathFlags0), (*uint8)(oldPath0), (uint32)(oldPath1), (uint32)(newDescriptor0), (*uint8)(newPath0), (uint32)(newPath1)) return } // MetadataHash represents the imported method "metadata-hash". // -// metadata-hash: func() -> result +// metadata-hash: func() // //go:nosplit -func (self Descriptor) MetadataHash() (result cm.Result[MetadataHashValueShape, MetadataHashValue, ErrorCode]) { +func (self Descriptor) MetadataHash() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorMetadataHash((uint32)(self0), &result) + wasmimport_DescriptorMetadataHash((uint32)(self0)) return } // MetadataHashAt represents the imported method "metadata-hash-at". // -// metadata-hash-at: func(path-flags: path-flags, path: string) -> result +// metadata-hash-at: func(path-flags: path-flags, path: string) // //go:nosplit -func (self Descriptor) MetadataHashAt(pathFlags PathFlags, path string) (result cm.Result[MetadataHashValueShape, MetadataHashValue, ErrorCode]) { +func (self Descriptor) MetadataHashAt(pathFlags PathFlags, path string) { self0 := cm.Reinterpret[uint32](self) pathFlags0 := (uint32)(pathFlags) path0, path1 := cm.LowerString(path) - wasmimport_DescriptorMetadataHashAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), &result) + wasmimport_DescriptorMetadataHashAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1)) return } // OpenAt represents the imported method "open-at". // // open-at: func(path-flags: path-flags, path: string, open-flags: open-flags, %flags: -// descriptor-flags) -> result +// descriptor-flags) // //go:nosplit -func (self Descriptor) OpenAt(pathFlags PathFlags, path string, openFlags OpenFlags, flags DescriptorFlags) (result cm.Result[Descriptor, Descriptor, ErrorCode]) { +func (self Descriptor) OpenAt(pathFlags PathFlags, path string, openFlags OpenFlags, flags DescriptorFlags) { self0 := cm.Reinterpret[uint32](self) pathFlags0 := (uint32)(pathFlags) path0, path1 := cm.LowerString(path) openFlags0 := (uint32)(openFlags) flags0 := (uint32)(flags) - wasmimport_DescriptorOpenAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), (uint32)(openFlags0), (uint32)(flags0), &result) + wasmimport_DescriptorOpenAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), (uint32)(openFlags0), (uint32)(flags0)) return } // Read represents the imported method "read". // -// read: func(length: filesize, offset: filesize) -> result, bool>, -// error-code> +// read: func(length: filesize, offset: filesize) // //go:nosplit -func (self Descriptor) Read(length FileSize, offset FileSize) (result cm.Result[TupleListU8BoolShape, cm.Tuple[cm.List[uint8], bool], ErrorCode]) { +func (self Descriptor) Read(length FileSize, offset FileSize) { self0 := cm.Reinterpret[uint32](self) length0 := (uint64)(length) offset0 := (uint64)(offset) - wasmimport_DescriptorRead((uint32)(self0), (uint64)(length0), (uint64)(offset0), &result) + wasmimport_DescriptorRead((uint32)(self0), (uint64)(length0), (uint64)(offset0)) return } // ReadDirectory represents the imported method "read-directory". // -// read-directory: func() -> result +// read-directory: func() // //go:nosplit -func (self Descriptor) ReadDirectory() (result cm.Result[DirectoryEntryStream, DirectoryEntryStream, ErrorCode]) { +func (self Descriptor) ReadDirectory() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorReadDirectory((uint32)(self0), &result) + wasmimport_DescriptorReadDirectory((uint32)(self0)) return } // ReadViaStream represents the imported method "read-via-stream". // -// read-via-stream: func(offset: filesize) -> result +// read-via-stream: func(offset: filesize) // //go:nosplit -func (self Descriptor) ReadViaStream(offset FileSize) (result cm.Result[InputStream, InputStream, ErrorCode]) { +func (self Descriptor) ReadViaStream(offset FileSize) { self0 := cm.Reinterpret[uint32](self) offset0 := (uint64)(offset) - wasmimport_DescriptorReadViaStream((uint32)(self0), (uint64)(offset0), &result) + wasmimport_DescriptorReadViaStream((uint32)(self0), (uint64)(offset0)) return } // ReadLinkAt represents the imported method "readlink-at". // -// readlink-at: func(path: string) -> result +// readlink-at: func(path: string) // //go:nosplit -func (self Descriptor) ReadLinkAt(path string) (result cm.Result[string, string, ErrorCode]) { +func (self Descriptor) ReadLinkAt(path string) { self0 := cm.Reinterpret[uint32](self) path0, path1 := cm.LowerString(path) - wasmimport_DescriptorReadLinkAt((uint32)(self0), (*uint8)(path0), (uint32)(path1), &result) + wasmimport_DescriptorReadLinkAt((uint32)(self0), (*uint8)(path0), (uint32)(path1)) return } // RemoveDirectoryAt represents the imported method "remove-directory-at". // -// remove-directory-at: func(path: string) -> result<_, error-code> +// remove-directory-at: func(path: string) // //go:nosplit -func (self Descriptor) RemoveDirectoryAt(path string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) RemoveDirectoryAt(path string) { self0 := cm.Reinterpret[uint32](self) path0, path1 := cm.LowerString(path) - wasmimport_DescriptorRemoveDirectoryAt((uint32)(self0), (*uint8)(path0), (uint32)(path1), &result) + wasmimport_DescriptorRemoveDirectoryAt((uint32)(self0), (*uint8)(path0), (uint32)(path1)) return } // RenameAt represents the imported method "rename-at". // // rename-at: func(old-path: string, new-descriptor: borrow, new-path: -// string) -> result<_, error-code> +// string) // //go:nosplit -func (self Descriptor) RenameAt(oldPath string, newDescriptor Descriptor, newPath string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) RenameAt(oldPath string, newDescriptor Descriptor, newPath string) { self0 := cm.Reinterpret[uint32](self) oldPath0, oldPath1 := cm.LowerString(oldPath) newDescriptor0 := cm.Reinterpret[uint32](newDescriptor) newPath0, newPath1 := cm.LowerString(newPath) - wasmimport_DescriptorRenameAt((uint32)(self0), (*uint8)(oldPath0), (uint32)(oldPath1), (uint32)(newDescriptor0), (*uint8)(newPath0), (uint32)(newPath1), &result) + wasmimport_DescriptorRenameAt((uint32)(self0), (*uint8)(oldPath0), (uint32)(oldPath1), (uint32)(newDescriptor0), (*uint8)(newPath0), (uint32)(newPath1)) return } // SetSize represents the imported method "set-size". // -// set-size: func(size: filesize) -> result<_, error-code> +// set-size: func(size: filesize) // //go:nosplit -func (self Descriptor) SetSize(size FileSize) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) SetSize(size FileSize) { self0 := cm.Reinterpret[uint32](self) size0 := (uint64)(size) - wasmimport_DescriptorSetSize((uint32)(self0), (uint64)(size0), &result) + wasmimport_DescriptorSetSize((uint32)(self0), (uint64)(size0)) return } // SetTimes represents the imported method "set-times". // // set-times: func(data-access-timestamp: new-timestamp, data-modification-timestamp: -// new-timestamp) -> result<_, error-code> +// new-timestamp) // //go:nosplit -func (self Descriptor) SetTimes(dataAccessTimestamp NewTimestamp, dataModificationTimestamp NewTimestamp) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) SetTimes(dataAccessTimestamp NewTimestamp, dataModificationTimestamp NewTimestamp) { self0 := cm.Reinterpret[uint32](self) dataAccessTimestamp0, dataAccessTimestamp1, dataAccessTimestamp2 := lower_NewTimestamp(dataAccessTimestamp) dataModificationTimestamp0, dataModificationTimestamp1, dataModificationTimestamp2 := lower_NewTimestamp(dataModificationTimestamp) - wasmimport_DescriptorSetTimes((uint32)(self0), (uint32)(dataAccessTimestamp0), (uint64)(dataAccessTimestamp1), (uint32)(dataAccessTimestamp2), (uint32)(dataModificationTimestamp0), (uint64)(dataModificationTimestamp1), (uint32)(dataModificationTimestamp2), &result) + wasmimport_DescriptorSetTimes((uint32)(self0), (uint32)(dataAccessTimestamp0), (uint64)(dataAccessTimestamp1), (uint32)(dataAccessTimestamp2), (uint32)(dataModificationTimestamp0), (uint64)(dataModificationTimestamp1), (uint32)(dataModificationTimestamp2)) return } // SetTimesAt represents the imported method "set-times-at". // // set-times-at: func(path-flags: path-flags, path: string, data-access-timestamp: -// new-timestamp, data-modification-timestamp: new-timestamp) -> result<_, error-code> +// new-timestamp, data-modification-timestamp: new-timestamp) // //go:nosplit -func (self Descriptor) SetTimesAt(pathFlags PathFlags, path string, dataAccessTimestamp NewTimestamp, dataModificationTimestamp NewTimestamp) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) SetTimesAt(pathFlags PathFlags, path string, dataAccessTimestamp NewTimestamp, dataModificationTimestamp NewTimestamp) { self0 := cm.Reinterpret[uint32](self) pathFlags0 := (uint32)(pathFlags) path0, path1 := cm.LowerString(path) dataAccessTimestamp0, dataAccessTimestamp1, dataAccessTimestamp2 := lower_NewTimestamp(dataAccessTimestamp) dataModificationTimestamp0, dataModificationTimestamp1, dataModificationTimestamp2 := lower_NewTimestamp(dataModificationTimestamp) - wasmimport_DescriptorSetTimesAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), (uint32)(dataAccessTimestamp0), (uint64)(dataAccessTimestamp1), (uint32)(dataAccessTimestamp2), (uint32)(dataModificationTimestamp0), (uint64)(dataModificationTimestamp1), (uint32)(dataModificationTimestamp2), &result) + wasmimport_DescriptorSetTimesAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), (uint32)(dataAccessTimestamp0), (uint64)(dataAccessTimestamp1), (uint32)(dataAccessTimestamp2), (uint32)(dataModificationTimestamp0), (uint64)(dataModificationTimestamp1), (uint32)(dataModificationTimestamp2)) return } // Stat represents the imported method "stat". // -// stat: func() -> result +// stat: func() // //go:nosplit -func (self Descriptor) Stat() (result cm.Result[DescriptorStatShape, DescriptorStat, ErrorCode]) { +func (self Descriptor) Stat() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorStat((uint32)(self0), &result) + wasmimport_DescriptorStat((uint32)(self0)) return } // StatAt represents the imported method "stat-at". // -// stat-at: func(path-flags: path-flags, path: string) -> result +// stat-at: func(path-flags: path-flags, path: string) // //go:nosplit -func (self Descriptor) StatAt(pathFlags PathFlags, path string) (result cm.Result[DescriptorStatShape, DescriptorStat, ErrorCode]) { +func (self Descriptor) StatAt(pathFlags PathFlags, path string) { self0 := cm.Reinterpret[uint32](self) pathFlags0 := (uint32)(pathFlags) path0, path1 := cm.LowerString(path) - wasmimport_DescriptorStatAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), &result) + wasmimport_DescriptorStatAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1)) return } // SymlinkAt represents the imported method "symlink-at". // -// symlink-at: func(old-path: string, new-path: string) -> result<_, error-code> +// symlink-at: func(old-path: string, new-path: string) // //go:nosplit -func (self Descriptor) SymlinkAt(oldPath string, newPath string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) SymlinkAt(oldPath string, newPath string) { self0 := cm.Reinterpret[uint32](self) oldPath0, oldPath1 := cm.LowerString(oldPath) newPath0, newPath1 := cm.LowerString(newPath) - wasmimport_DescriptorSymlinkAt((uint32)(self0), (*uint8)(oldPath0), (uint32)(oldPath1), (*uint8)(newPath0), (uint32)(newPath1), &result) + wasmimport_DescriptorSymlinkAt((uint32)(self0), (*uint8)(oldPath0), (uint32)(oldPath1), (*uint8)(newPath0), (uint32)(newPath1)) return } // Sync represents the imported method "sync". // -// sync: func() -> result<_, error-code> +// sync: func() // //go:nosplit -func (self Descriptor) Sync() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) Sync() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorSync((uint32)(self0), &result) + wasmimport_DescriptorSync((uint32)(self0)) return } // SyncData represents the imported method "sync-data". // -// sync-data: func() -> result<_, error-code> +// sync-data: func() // //go:nosplit -func (self Descriptor) SyncData() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) SyncData() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorSyncData((uint32)(self0), &result) + wasmimport_DescriptorSyncData((uint32)(self0)) return } // UnlinkFileAt represents the imported method "unlink-file-at". // -// unlink-file-at: func(path: string) -> result<_, error-code> +// unlink-file-at: func(path: string) // //go:nosplit -func (self Descriptor) UnlinkFileAt(path string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) UnlinkFileAt(path string) { self0 := cm.Reinterpret[uint32](self) path0, path1 := cm.LowerString(path) - wasmimport_DescriptorUnlinkFileAt((uint32)(self0), (*uint8)(path0), (uint32)(path1), &result) + wasmimport_DescriptorUnlinkFileAt((uint32)(self0), (*uint8)(path0), (uint32)(path1)) return } // Write represents the imported method "write". // -// write: func(buffer: list, offset: filesize) -> result +// write: func(buffer: list, offset: filesize) // //go:nosplit -func (self Descriptor) Write(buffer cm.List[uint8], offset FileSize) (result cm.Result[uint64, FileSize, ErrorCode]) { +func (self Descriptor) Write(buffer cm.List[uint8], offset FileSize) { self0 := cm.Reinterpret[uint32](self) buffer0, buffer1 := cm.LowerList(buffer) offset0 := (uint64)(offset) - wasmimport_DescriptorWrite((uint32)(self0), (*uint8)(buffer0), (uint32)(buffer1), (uint64)(offset0), &result) + wasmimport_DescriptorWrite((uint32)(self0), (*uint8)(buffer0), (uint32)(buffer1), (uint64)(offset0)) return } // WriteViaStream represents the imported method "write-via-stream". // -// write-via-stream: func(offset: filesize) -> result +// write-via-stream: func(offset: filesize) // //go:nosplit -func (self Descriptor) WriteViaStream(offset FileSize) (result cm.Result[OutputStream, OutputStream, ErrorCode]) { +func (self Descriptor) WriteViaStream(offset FileSize) { self0 := cm.Reinterpret[uint32](self) offset0 := (uint64)(offset) - wasmimport_DescriptorWriteViaStream((uint32)(self0), (uint64)(offset0), &result) + wasmimport_DescriptorWriteViaStream((uint32)(self0), (uint64)(offset0)) return } @@ -766,22 +762,22 @@ func (self DirectoryEntryStream) ResourceDrop() { // ReadDirectoryEntry represents the imported method "read-directory-entry". // -// read-directory-entry: func() -> result, error-code> +// read-directory-entry: func() // //go:nosplit -func (self DirectoryEntryStream) ReadDirectoryEntry() (result cm.Result[OptionDirectoryEntryShape, cm.Option[DirectoryEntry], ErrorCode]) { +func (self DirectoryEntryStream) ReadDirectoryEntry() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DirectoryEntryStreamReadDirectoryEntry((uint32)(self0), &result) + wasmimport_DirectoryEntryStreamReadDirectoryEntry((uint32)(self0)) return } // FilesystemErrorCode represents the imported function "filesystem-error-code". // -// filesystem-error-code: func(err: borrow) -> option +// filesystem-error-code: func(err: borrow) // //go:nosplit -func FilesystemErrorCode(err Error) (result cm.Option[ErrorCode]) { +func FilesystemErrorCode(err Error) { err0 := cm.Reinterpret[uint32](err) - wasmimport_FilesystemErrorCode((uint32)(err0), &result) + wasmimport_FilesystemErrorCode((uint32)(err0)) return } diff --git a/examples/component/http-client/gen/wasi/http/outgoing-handler/abi.go b/examples/component/http-client/gen/wasi/http/outgoing-handler/abi.go index 7f91a7ac..5c6a7b48 100755 --- a/examples/component/http-client/gen/wasi/http/outgoing-handler/abi.go +++ b/examples/component/http-client/gen/wasi/http/outgoing-handler/abi.go @@ -3,17 +3,9 @@ package outgoinghandler import ( - "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/http/types" "go.bytecodealliance.org/cm" - "unsafe" ) -// ErrorCodeShape is used for storage in variant or result types. -type ErrorCodeShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(types.ErrorCode{})]byte -} - func lower_OptionRequestOptions(v cm.Option[RequestOptions]) (f0 uint32, f1 uint32) { some := v.Some() if some != nil { diff --git a/examples/component/http-client/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go b/examples/component/http-client/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go index 6ad820eb..de0882f0 100755 --- a/examples/component/http-client/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go +++ b/examples/component/http-client/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go @@ -44,13 +44,12 @@ type ErrorCode = types.ErrorCode // or not allowed to be made. Otherwise, protocol errors are reported // through the `future-incoming-response`. // -// handle: func(request: outgoing-request, options: option) -> result +// handle: func(request: outgoing-request, options: option) // //go:nosplit -func Handle(request OutgoingRequest, options cm.Option[RequestOptions]) (result cm.Result[ErrorCodeShape, FutureIncomingResponse, ErrorCode]) { +func Handle(request OutgoingRequest, options cm.Option[RequestOptions]) { request0 := cm.Reinterpret[uint32](request) options0, options1 := lower_OptionRequestOptions(options) - wasmimport_Handle((uint32)(request0), (uint32)(options0), (uint32)(options1), &result) + wasmimport_Handle((uint32)(request0), (uint32)(options0), (uint32)(options1)) return } diff --git a/examples/component/http-client/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go b/examples/component/http-client/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go index 6b3f3828..1f362c2a 100755 --- a/examples/component/http-client/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go +++ b/examples/component/http-client/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go @@ -2,12 +2,8 @@ package outgoinghandler -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:http@0.2.0". //go:wasmimport wasi:http/outgoing-handler@0.2.0 handle //go:noescape -func wasmimport_Handle(request0 uint32, options0 uint32, options1 uint32, result *cm.Result[ErrorCodeShape, FutureIncomingResponse, ErrorCode]) +func wasmimport_Handle(request0 uint32, options0 uint32, options1 uint32) diff --git a/examples/component/http-client/gen/wasi/http/types/types.wasm.go b/examples/component/http-client/gen/wasi/http/types/types.wasm.go index b025b2af..584e55ae 100755 --- a/examples/component/http-client/gen/wasi/http/types/types.wasm.go +++ b/examples/component/http-client/gen/wasi/http/types/types.wasm.go @@ -14,39 +14,39 @@ func wasmimport_FieldsResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [constructor]fields //go:noescape -func wasmimport_NewFields() (result0 uint32) +func wasmimport_NewFields() //go:wasmimport wasi:http/types@0.2.0 [static]fields.from-list //go:noescape -func wasmimport_FieldsFromList(entries0 *cm.Tuple[FieldKey, FieldValue], entries1 uint32, result *cm.Result[Fields, Fields, HeaderError]) +func wasmimport_FieldsFromList(entries0 *cm.Tuple[FieldKey, FieldValue], entries1 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]fields.append //go:noescape -func wasmimport_FieldsAppend(self0 uint32, name0 *uint8, name1 uint32, value0 *uint8, value1 uint32, result *cm.Result[HeaderError, struct{}, HeaderError]) +func wasmimport_FieldsAppend(self0 uint32, name0 *uint8, name1 uint32, value0 *uint8, value1 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]fields.clone //go:noescape -func wasmimport_FieldsClone(self0 uint32) (result0 uint32) +func wasmimport_FieldsClone(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]fields.delete //go:noescape -func wasmimport_FieldsDelete(self0 uint32, name0 *uint8, name1 uint32, result *cm.Result[HeaderError, struct{}, HeaderError]) +func wasmimport_FieldsDelete(self0 uint32, name0 *uint8, name1 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]fields.entries //go:noescape -func wasmimport_FieldsEntries(self0 uint32, result *cm.List[cm.Tuple[FieldKey, FieldValue]]) +func wasmimport_FieldsEntries(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]fields.get //go:noescape -func wasmimport_FieldsGet(self0 uint32, name0 *uint8, name1 uint32, result *cm.List[FieldValue]) +func wasmimport_FieldsGet(self0 uint32, name0 *uint8, name1 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]fields.has //go:noescape -func wasmimport_FieldsHas(self0 uint32, name0 *uint8, name1 uint32) (result0 uint32) +func wasmimport_FieldsHas(self0 uint32, name0 *uint8, name1 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]fields.set //go:noescape -func wasmimport_FieldsSet(self0 uint32, name0 *uint8, name1 uint32, value0 *FieldValue, value1 uint32, result *cm.Result[HeaderError, struct{}, HeaderError]) +func wasmimport_FieldsSet(self0 uint32, name0 *uint8, name1 uint32, value0 *FieldValue, value1 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]incoming-request //go:noescape @@ -54,27 +54,27 @@ func wasmimport_IncomingRequestResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.authority //go:noescape -func wasmimport_IncomingRequestAuthority(self0 uint32, result *cm.Option[string]) +func wasmimport_IncomingRequestAuthority(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.consume //go:noescape -func wasmimport_IncomingRequestConsume(self0 uint32, result *cm.Result[IncomingBody, IncomingBody, struct{}]) +func wasmimport_IncomingRequestConsume(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.headers //go:noescape -func wasmimport_IncomingRequestHeaders(self0 uint32) (result0 uint32) +func wasmimport_IncomingRequestHeaders(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.method //go:noescape -func wasmimport_IncomingRequestMethod(self0 uint32, result *Method) +func wasmimport_IncomingRequestMethod(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.path-with-query //go:noescape -func wasmimport_IncomingRequestPathWithQuery(self0 uint32, result *cm.Option[string]) +func wasmimport_IncomingRequestPathWithQuery(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.scheme //go:noescape -func wasmimport_IncomingRequestScheme(self0 uint32, result *cm.Option[Scheme]) +func wasmimport_IncomingRequestScheme(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]outgoing-request //go:noescape @@ -82,47 +82,47 @@ func wasmimport_OutgoingRequestResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [constructor]outgoing-request //go:noescape -func wasmimport_NewOutgoingRequest(headers0 uint32) (result0 uint32) +func wasmimport_NewOutgoingRequest(headers0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.authority //go:noescape -func wasmimport_OutgoingRequestAuthority(self0 uint32, result *cm.Option[string]) +func wasmimport_OutgoingRequestAuthority(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.body //go:noescape -func wasmimport_OutgoingRequestBody(self0 uint32, result *cm.Result[OutgoingBody, OutgoingBody, struct{}]) +func wasmimport_OutgoingRequestBody(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.headers //go:noescape -func wasmimport_OutgoingRequestHeaders(self0 uint32) (result0 uint32) +func wasmimport_OutgoingRequestHeaders(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.method //go:noescape -func wasmimport_OutgoingRequestMethod(self0 uint32, result *Method) +func wasmimport_OutgoingRequestMethod(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.path-with-query //go:noescape -func wasmimport_OutgoingRequestPathWithQuery(self0 uint32, result *cm.Option[string]) +func wasmimport_OutgoingRequestPathWithQuery(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.scheme //go:noescape -func wasmimport_OutgoingRequestScheme(self0 uint32, result *cm.Option[Scheme]) +func wasmimport_OutgoingRequestScheme(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-authority //go:noescape -func wasmimport_OutgoingRequestSetAuthority(self0 uint32, authority0 uint32, authority1 *uint8, authority2 uint32) (result0 uint32) +func wasmimport_OutgoingRequestSetAuthority(self0 uint32, authority0 uint32, authority1 *uint8, authority2 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-method //go:noescape -func wasmimport_OutgoingRequestSetMethod(self0 uint32, method0 uint32, method1 *uint8, method2 uint32) (result0 uint32) +func wasmimport_OutgoingRequestSetMethod(self0 uint32, method0 uint32, method1 *uint8, method2 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-path-with-query //go:noescape -func wasmimport_OutgoingRequestSetPathWithQuery(self0 uint32, pathWithQuery0 uint32, pathWithQuery1 *uint8, pathWithQuery2 uint32) (result0 uint32) +func wasmimport_OutgoingRequestSetPathWithQuery(self0 uint32, pathWithQuery0 uint32, pathWithQuery1 *uint8, pathWithQuery2 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-scheme //go:noescape -func wasmimport_OutgoingRequestSetScheme(self0 uint32, scheme0 uint32, scheme1 uint32, scheme2 *uint8, scheme3 uint32) (result0 uint32) +func wasmimport_OutgoingRequestSetScheme(self0 uint32, scheme0 uint32, scheme1 uint32, scheme2 *uint8, scheme3 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]request-options //go:noescape @@ -130,31 +130,31 @@ func wasmimport_RequestOptionsResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [constructor]request-options //go:noescape -func wasmimport_NewRequestOptions() (result0 uint32) +func wasmimport_NewRequestOptions() //go:wasmimport wasi:http/types@0.2.0 [method]request-options.between-bytes-timeout //go:noescape -func wasmimport_RequestOptionsBetweenBytesTimeout(self0 uint32, result *cm.Option[Duration]) +func wasmimport_RequestOptionsBetweenBytesTimeout(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]request-options.connect-timeout //go:noescape -func wasmimport_RequestOptionsConnectTimeout(self0 uint32, result *cm.Option[Duration]) +func wasmimport_RequestOptionsConnectTimeout(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]request-options.first-byte-timeout //go:noescape -func wasmimport_RequestOptionsFirstByteTimeout(self0 uint32, result *cm.Option[Duration]) +func wasmimport_RequestOptionsFirstByteTimeout(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]request-options.set-between-bytes-timeout //go:noescape -func wasmimport_RequestOptionsSetBetweenBytesTimeout(self0 uint32, duration0 uint32, duration1 uint64) (result0 uint32) +func wasmimport_RequestOptionsSetBetweenBytesTimeout(self0 uint32, duration0 uint32, duration1 uint64) //go:wasmimport wasi:http/types@0.2.0 [method]request-options.set-connect-timeout //go:noescape -func wasmimport_RequestOptionsSetConnectTimeout(self0 uint32, duration0 uint32, duration1 uint64) (result0 uint32) +func wasmimport_RequestOptionsSetConnectTimeout(self0 uint32, duration0 uint32, duration1 uint64) //go:wasmimport wasi:http/types@0.2.0 [method]request-options.set-first-byte-timeout //go:noescape -func wasmimport_RequestOptionsSetFirstByteTimeout(self0 uint32, duration0 uint32, duration1 uint64) (result0 uint32) +func wasmimport_RequestOptionsSetFirstByteTimeout(self0 uint32, duration0 uint32, duration1 uint64) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]response-outparam //go:noescape @@ -170,15 +170,15 @@ func wasmimport_IncomingResponseResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-response.consume //go:noescape -func wasmimport_IncomingResponseConsume(self0 uint32, result *cm.Result[IncomingBody, IncomingBody, struct{}]) +func wasmimport_IncomingResponseConsume(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-response.headers //go:noescape -func wasmimport_IncomingResponseHeaders(self0 uint32) (result0 uint32) +func wasmimport_IncomingResponseHeaders(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-response.status //go:noescape -func wasmimport_IncomingResponseStatus(self0 uint32) (result0 uint32) +func wasmimport_IncomingResponseStatus(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]incoming-body //go:noescape @@ -186,11 +186,11 @@ func wasmimport_IncomingBodyResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [static]incoming-body.finish //go:noescape -func wasmimport_IncomingBodyFinish(this0 uint32) (result0 uint32) +func wasmimport_IncomingBodyFinish(this0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-body.stream //go:noescape -func wasmimport_IncomingBodyStream(self0 uint32, result *cm.Result[InputStream, InputStream, struct{}]) +func wasmimport_IncomingBodyStream(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]future-trailers //go:noescape @@ -198,11 +198,11 @@ func wasmimport_FutureTrailersResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]future-trailers.get //go:noescape -func wasmimport_FutureTrailersGet(self0 uint32, result *cm.Option[cm.Result[cm.Result[ErrorCodeShape, cm.Option[Trailers], ErrorCode], cm.Result[ErrorCodeShape, cm.Option[Trailers], ErrorCode], struct{}]]) +func wasmimport_FutureTrailersGet(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]future-trailers.subscribe //go:noescape -func wasmimport_FutureTrailersSubscribe(self0 uint32) (result0 uint32) +func wasmimport_FutureTrailersSubscribe(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]outgoing-response //go:noescape @@ -210,23 +210,23 @@ func wasmimport_OutgoingResponseResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [constructor]outgoing-response //go:noescape -func wasmimport_NewOutgoingResponse(headers0 uint32) (result0 uint32) +func wasmimport_NewOutgoingResponse(headers0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.body //go:noescape -func wasmimport_OutgoingResponseBody(self0 uint32, result *cm.Result[OutgoingBody, OutgoingBody, struct{}]) +func wasmimport_OutgoingResponseBody(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.headers //go:noescape -func wasmimport_OutgoingResponseHeaders(self0 uint32) (result0 uint32) +func wasmimport_OutgoingResponseHeaders(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.set-status-code //go:noescape -func wasmimport_OutgoingResponseSetStatusCode(self0 uint32, statusCode0 uint32) (result0 uint32) +func wasmimport_OutgoingResponseSetStatusCode(self0 uint32, statusCode0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.status-code //go:noescape -func wasmimport_OutgoingResponseStatusCode(self0 uint32) (result0 uint32) +func wasmimport_OutgoingResponseStatusCode(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]outgoing-body //go:noescape @@ -234,11 +234,11 @@ func wasmimport_OutgoingBodyResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [static]outgoing-body.finish //go:noescape -func wasmimport_OutgoingBodyFinish(this0 uint32, trailers0 uint32, trailers1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_OutgoingBodyFinish(this0 uint32, trailers0 uint32, trailers1 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-body.write //go:noescape -func wasmimport_OutgoingBodyWrite(self0 uint32, result *cm.Result[OutputStream, OutputStream, struct{}]) +func wasmimport_OutgoingBodyWrite(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]future-incoming-response //go:noescape @@ -246,12 +246,12 @@ func wasmimport_FutureIncomingResponseResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]future-incoming-response.get //go:noescape -func wasmimport_FutureIncomingResponseGet(self0 uint32, result *cm.Option[cm.Result[cm.Result[ErrorCodeShape, IncomingResponse, ErrorCode], cm.Result[ErrorCodeShape, IncomingResponse, ErrorCode], struct{}]]) +func wasmimport_FutureIncomingResponseGet(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]future-incoming-response.subscribe //go:noescape -func wasmimport_FutureIncomingResponseSubscribe(self0 uint32) (result0 uint32) +func wasmimport_FutureIncomingResponseSubscribe(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 http-error-code //go:noescape -func wasmimport_HTTPErrorCode(err0 uint32, result *cm.Option[ErrorCode]) +func wasmimport_HTTPErrorCode(err0 uint32) diff --git a/examples/component/http-client/gen/wasi/http/types/types.wit.go b/examples/component/http-client/gen/wasi/http/types/types.wit.go index 4361149d..72670385 100755 --- a/examples/component/http-client/gen/wasi/http/types/types.wit.go +++ b/examples/component/http-client/gen/wasi/http/types/types.wit.go @@ -886,9 +886,8 @@ func (self Fields) ResourceDrop() { // constructor() // //go:nosplit -func NewFields() (result Fields) { - result0 := wasmimport_NewFields() - result = cm.Reinterpret[Fields]((uint32)(result0)) +func NewFields() { + wasmimport_NewFields() return } @@ -910,13 +909,12 @@ func NewFields() (result Fields) { // An error result will be returned if any header or value was // syntactically invalid, or if a header was forbidden. // -// from-list: static func(entries: list>) -> result +// from-list: static func(entries: list>) // //go:nosplit -func FieldsFromList(entries cm.List[cm.Tuple[FieldKey, FieldValue]]) (result cm.Result[Fields, Fields, HeaderError]) { +func FieldsFromList(entries cm.List[cm.Tuple[FieldKey, FieldValue]]) { entries0, entries1 := cm.LowerList(entries) - wasmimport_FieldsFromList((*cm.Tuple[FieldKey, FieldValue])(entries0), (uint32)(entries1), &result) + wasmimport_FieldsFromList((*cm.Tuple[FieldKey, FieldValue])(entries0), (uint32)(entries1)) return } @@ -927,14 +925,14 @@ func FieldsFromList(entries cm.List[cm.Tuple[FieldKey, FieldValue]]) (result cm. // // Fails with `header-error.immutable` if the `fields` are immutable. // -// append: func(name: field-key, value: field-value) -> result<_, header-error> +// append: func(name: field-key, value: field-value) // //go:nosplit -func (self Fields) Append(name FieldKey, value FieldValue) (result cm.Result[HeaderError, struct{}, HeaderError]) { +func (self Fields) Append(name FieldKey, value FieldValue) { self0 := cm.Reinterpret[uint32](self) name0, name1 := cm.LowerString(name) value0, value1 := cm.LowerList(value) - wasmimport_FieldsAppend((uint32)(self0), (*uint8)(name0), (uint32)(name1), (*uint8)(value0), (uint32)(value1), &result) + wasmimport_FieldsAppend((uint32)(self0), (*uint8)(name0), (uint32)(name1), (*uint8)(value0), (uint32)(value1)) return } @@ -944,13 +942,12 @@ func (self Fields) Append(name FieldKey, value FieldValue) (result cm.Result[Hea // `fields` constructor on the return value of `entries`. The resulting // `fields` is mutable. // -// clone: func() -> fields +// clone: func() // //go:nosplit -func (self Fields) Clone() (result Fields) { +func (self Fields) Clone() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_FieldsClone((uint32)(self0)) - result = cm.Reinterpret[Fields]((uint32)(result0)) + wasmimport_FieldsClone((uint32)(self0)) return } @@ -961,13 +958,13 @@ func (self Fields) Clone() (result Fields) { // // Fails with `header-error.immutable` if the `fields` are immutable. // -// delete: func(name: field-key) -> result<_, header-error> +// delete: func(name: field-key) // //go:nosplit -func (self Fields) Delete(name FieldKey) (result cm.Result[HeaderError, struct{}, HeaderError]) { +func (self Fields) Delete(name FieldKey) { self0 := cm.Reinterpret[uint32](self) name0, name1 := cm.LowerString(name) - wasmimport_FieldsDelete((uint32)(self0), (*uint8)(name0), (uint32)(name1), &result) + wasmimport_FieldsDelete((uint32)(self0), (*uint8)(name0), (uint32)(name1)) return } @@ -980,12 +977,12 @@ func (self Fields) Delete(name FieldKey) (result cm.Result[HeaderError, struct{} // which have multiple values are represented by multiple entries in this // list with the same key. // -// entries: func() -> list> +// entries: func() // //go:nosplit -func (self Fields) Entries() (result cm.List[cm.Tuple[FieldKey, FieldValue]]) { +func (self Fields) Entries() { self0 := cm.Reinterpret[uint32](self) - wasmimport_FieldsEntries((uint32)(self0), &result) + wasmimport_FieldsEntries((uint32)(self0)) return } @@ -996,13 +993,13 @@ func (self Fields) Entries() (result cm.List[cm.Tuple[FieldKey, FieldValue]]) { // present but empty, this is represented by a list with one or more // empty field-values present. // -// get: func(name: field-key) -> list +// get: func(name: field-key) // //go:nosplit -func (self Fields) Get(name FieldKey) (result cm.List[FieldValue]) { +func (self Fields) Get(name FieldKey) { self0 := cm.Reinterpret[uint32](self) name0, name1 := cm.LowerString(name) - wasmimport_FieldsGet((uint32)(self0), (*uint8)(name0), (uint32)(name1), &result) + wasmimport_FieldsGet((uint32)(self0), (*uint8)(name0), (uint32)(name1)) return } @@ -1011,14 +1008,13 @@ func (self Fields) Get(name FieldKey) (result cm.List[FieldValue]) { // Returns `true` when the key is present in this `fields`. If the key is // syntactically invalid, `false` is returned. // -// has: func(name: field-key) -> bool +// has: func(name: field-key) // //go:nosplit -func (self Fields) Has(name FieldKey) (result bool) { +func (self Fields) Has(name FieldKey) { self0 := cm.Reinterpret[uint32](self) name0, name1 := cm.LowerString(name) - result0 := wasmimport_FieldsHas((uint32)(self0), (*uint8)(name0), (uint32)(name1)) - result = (bool)(cm.U32ToBool((uint32)(result0))) + wasmimport_FieldsHas((uint32)(self0), (*uint8)(name0), (uint32)(name1)) return } @@ -1029,14 +1025,14 @@ func (self Fields) Has(name FieldKey) (result bool) { // // Fails with `header-error.immutable` if the `fields` are immutable. // -// set: func(name: field-key, value: list) -> result<_, header-error> +// set: func(name: field-key, value: list) // //go:nosplit -func (self Fields) Set(name FieldKey, value cm.List[FieldValue]) (result cm.Result[HeaderError, struct{}, HeaderError]) { +func (self Fields) Set(name FieldKey, value cm.List[FieldValue]) { self0 := cm.Reinterpret[uint32](self) name0, name1 := cm.LowerString(name) value0, value1 := cm.LowerList(value) - wasmimport_FieldsSet((uint32)(self0), (*uint8)(name0), (uint32)(name1), (*FieldValue)(value0), (uint32)(value1), &result) + wasmimport_FieldsSet((uint32)(self0), (*uint8)(name0), (uint32)(name1), (*FieldValue)(value0), (uint32)(value1)) return } @@ -1072,12 +1068,12 @@ func (self IncomingRequest) ResourceDrop() { // // Returns the authority from the request, if it was present. // -// authority: func() -> option +// authority: func() // //go:nosplit -func (self IncomingRequest) Authority() (result cm.Option[string]) { +func (self IncomingRequest) Authority() { self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestAuthority((uint32)(self0), &result) + wasmimport_IncomingRequestAuthority((uint32)(self0)) return } @@ -1086,12 +1082,12 @@ func (self IncomingRequest) Authority() (result cm.Option[string]) { // Gives the `incoming-body` associated with this request. Will only // return success at most once, and subsequent calls will return error. // -// consume: func() -> result +// consume: func() // //go:nosplit -func (self IncomingRequest) Consume() (result cm.Result[IncomingBody, IncomingBody, struct{}]) { +func (self IncomingRequest) Consume() { self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestConsume((uint32)(self0), &result) + wasmimport_IncomingRequestConsume((uint32)(self0)) return } @@ -1106,13 +1102,12 @@ func (self IncomingRequest) Consume() (result cm.Result[IncomingBody, IncomingBo // the parent `incoming-request` is dropped. Dropping this // `incoming-request` before all children are dropped will trap. // -// headers: func() -> headers +// headers: func() // //go:nosplit -func (self IncomingRequest) Headers() (result Headers) { +func (self IncomingRequest) Headers() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_IncomingRequestHeaders((uint32)(self0)) - result = cm.Reinterpret[Headers]((uint32)(result0)) + wasmimport_IncomingRequestHeaders((uint32)(self0)) return } @@ -1120,12 +1115,12 @@ func (self IncomingRequest) Headers() (result Headers) { // // Returns the method of the incoming request. // -// method: func() -> method +// method: func() // //go:nosplit -func (self IncomingRequest) Method() (result Method) { +func (self IncomingRequest) Method() { self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestMethod((uint32)(self0), &result) + wasmimport_IncomingRequestMethod((uint32)(self0)) return } @@ -1133,12 +1128,12 @@ func (self IncomingRequest) Method() (result Method) { // // Returns the path with query parameters from the request, as a string. // -// path-with-query: func() -> option +// path-with-query: func() // //go:nosplit -func (self IncomingRequest) PathWithQuery() (result cm.Option[string]) { +func (self IncomingRequest) PathWithQuery() { self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestPathWithQuery((uint32)(self0), &result) + wasmimport_IncomingRequestPathWithQuery((uint32)(self0)) return } @@ -1146,12 +1141,12 @@ func (self IncomingRequest) PathWithQuery() (result cm.Option[string]) { // // Returns the protocol scheme from the request. // -// scheme: func() -> option +// scheme: func() // //go:nosplit -func (self IncomingRequest) Scheme() (result cm.Option[Scheme]) { +func (self IncomingRequest) Scheme() { self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestScheme((uint32)(self0), &result) + wasmimport_IncomingRequestScheme((uint32)(self0)) return } @@ -1189,10 +1184,9 @@ func (self OutgoingRequest) ResourceDrop() { // constructor(headers: headers) // //go:nosplit -func NewOutgoingRequest(headers Headers) (result OutgoingRequest) { +func NewOutgoingRequest(headers Headers) { headers0 := cm.Reinterpret[uint32](headers) - result0 := wasmimport_NewOutgoingRequest((uint32)(headers0)) - result = cm.Reinterpret[OutgoingRequest]((uint32)(result0)) + wasmimport_NewOutgoingRequest((uint32)(headers0)) return } @@ -1202,12 +1196,12 @@ func NewOutgoingRequest(headers Headers) (result OutgoingRequest) { // with Related Schemes which do not require an Authority. The HTTP and // HTTPS schemes always require an authority. // -// authority: func() -> option +// authority: func() // //go:nosplit -func (self OutgoingRequest) Authority() (result cm.Option[string]) { +func (self OutgoingRequest) Authority() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestAuthority((uint32)(self0), &result) + wasmimport_OutgoingRequestAuthority((uint32)(self0)) return } @@ -1220,12 +1214,12 @@ func (self OutgoingRequest) Authority() (result cm.Option[string]) { // this `outgoing-request` can be retrieved at most once. Subsequent // calls will return error. // -// body: func() -> result +// body: func() // //go:nosplit -func (self OutgoingRequest) Body() (result cm.Result[OutgoingBody, OutgoingBody, struct{}]) { +func (self OutgoingRequest) Body() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestBody((uint32)(self0), &result) + wasmimport_OutgoingRequestBody((uint32)(self0)) return } @@ -1240,13 +1234,12 @@ func (self OutgoingRequest) Body() (result cm.Result[OutgoingBody, OutgoingBody, // `outgoing-request` is dropped, or its ownership is transfered to // another component by e.g. `outgoing-handler.handle`. // -// headers: func() -> headers +// headers: func() // //go:nosplit -func (self OutgoingRequest) Headers() (result Headers) { +func (self OutgoingRequest) Headers() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutgoingRequestHeaders((uint32)(self0)) - result = cm.Reinterpret[Headers]((uint32)(result0)) + wasmimport_OutgoingRequestHeaders((uint32)(self0)) return } @@ -1254,12 +1247,12 @@ func (self OutgoingRequest) Headers() (result Headers) { // // Get the Method for the Request. // -// method: func() -> method +// method: func() // //go:nosplit -func (self OutgoingRequest) Method() (result Method) { +func (self OutgoingRequest) Method() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestMethod((uint32)(self0), &result) + wasmimport_OutgoingRequestMethod((uint32)(self0)) return } @@ -1268,12 +1261,12 @@ func (self OutgoingRequest) Method() (result Method) { // Get the combination of the HTTP Path and Query for the Request. // When `none`, this represents an empty Path and empty Query. // -// path-with-query: func() -> option +// path-with-query: func() // //go:nosplit -func (self OutgoingRequest) PathWithQuery() (result cm.Option[string]) { +func (self OutgoingRequest) PathWithQuery() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestPathWithQuery((uint32)(self0), &result) + wasmimport_OutgoingRequestPathWithQuery((uint32)(self0)) return } @@ -1282,12 +1275,12 @@ func (self OutgoingRequest) PathWithQuery() (result cm.Option[string]) { // Get the HTTP Related Scheme for the Request. When `none`, the // implementation may choose an appropriate default scheme. // -// scheme: func() -> option +// scheme: func() // //go:nosplit -func (self OutgoingRequest) Scheme() (result cm.Option[Scheme]) { +func (self OutgoingRequest) Scheme() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestScheme((uint32)(self0), &result) + wasmimport_OutgoingRequestScheme((uint32)(self0)) return } @@ -1298,14 +1291,13 @@ func (self OutgoingRequest) Scheme() (result cm.Option[Scheme]) { // HTTPS schemes always require an authority. Fails if the string given is // not a syntactically valid uri authority. // -// set-authority: func(authority: option) -> result +// set-authority: func(authority: option) // //go:nosplit -func (self OutgoingRequest) SetAuthority(authority cm.Option[string]) (result cm.BoolResult) { +func (self OutgoingRequest) SetAuthority(authority cm.Option[string]) { self0 := cm.Reinterpret[uint32](self) authority0, authority1, authority2 := lower_OptionString(authority) - result0 := wasmimport_OutgoingRequestSetAuthority((uint32)(self0), (uint32)(authority0), (*uint8)(authority1), (uint32)(authority2)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_OutgoingRequestSetAuthority((uint32)(self0), (uint32)(authority0), (*uint8)(authority1), (uint32)(authority2)) return } @@ -1314,14 +1306,13 @@ func (self OutgoingRequest) SetAuthority(authority cm.Option[string]) (result cm // Set the Method for the Request. Fails if the string present in a // `method.other` argument is not a syntactically valid method. // -// set-method: func(method: method) -> result +// set-method: func(method: method) // //go:nosplit -func (self OutgoingRequest) SetMethod(method Method) (result cm.BoolResult) { +func (self OutgoingRequest) SetMethod(method Method) { self0 := cm.Reinterpret[uint32](self) method0, method1, method2 := lower_Method(method) - result0 := wasmimport_OutgoingRequestSetMethod((uint32)(self0), (uint32)(method0), (*uint8)(method1), (uint32)(method2)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_OutgoingRequestSetMethod((uint32)(self0), (uint32)(method0), (*uint8)(method1), (uint32)(method2)) return } @@ -1331,14 +1322,13 @@ func (self OutgoingRequest) SetMethod(method Method) (result cm.BoolResult) { // When `none`, this represents an empty Path and empty Query. Fails is the // string given is not a syntactically valid path and query uri component. // -// set-path-with-query: func(path-with-query: option) -> result +// set-path-with-query: func(path-with-query: option) // //go:nosplit -func (self OutgoingRequest) SetPathWithQuery(pathWithQuery cm.Option[string]) (result cm.BoolResult) { +func (self OutgoingRequest) SetPathWithQuery(pathWithQuery cm.Option[string]) { self0 := cm.Reinterpret[uint32](self) pathWithQuery0, pathWithQuery1, pathWithQuery2 := lower_OptionString(pathWithQuery) - result0 := wasmimport_OutgoingRequestSetPathWithQuery((uint32)(self0), (uint32)(pathWithQuery0), (*uint8)(pathWithQuery1), (uint32)(pathWithQuery2)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_OutgoingRequestSetPathWithQuery((uint32)(self0), (uint32)(pathWithQuery0), (*uint8)(pathWithQuery1), (uint32)(pathWithQuery2)) return } @@ -1348,14 +1338,13 @@ func (self OutgoingRequest) SetPathWithQuery(pathWithQuery cm.Option[string]) (r // implementation may choose an appropriate default scheme. Fails if the // string given is not a syntactically valid uri scheme. // -// set-scheme: func(scheme: option) -> result +// set-scheme: func(scheme: option) // //go:nosplit -func (self OutgoingRequest) SetScheme(scheme cm.Option[Scheme]) (result cm.BoolResult) { +func (self OutgoingRequest) SetScheme(scheme cm.Option[Scheme]) { self0 := cm.Reinterpret[uint32](self) scheme0, scheme1, scheme2, scheme3 := lower_OptionScheme(scheme) - result0 := wasmimport_OutgoingRequestSetScheme((uint32)(self0), (uint32)(scheme0), (uint32)(scheme1), (*uint8)(scheme2), (uint32)(scheme3)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_OutgoingRequestSetScheme((uint32)(self0), (uint32)(scheme0), (uint32)(scheme1), (*uint8)(scheme2), (uint32)(scheme3)) return } @@ -1389,9 +1378,8 @@ func (self RequestOptions) ResourceDrop() { // constructor() // //go:nosplit -func NewRequestOptions() (result RequestOptions) { - result0 := wasmimport_NewRequestOptions() - result = cm.Reinterpret[RequestOptions]((uint32)(result0)) +func NewRequestOptions() { + wasmimport_NewRequestOptions() return } @@ -1400,12 +1388,12 @@ func NewRequestOptions() (result RequestOptions) { // The timeout for receiving subsequent chunks of bytes in the Response // body stream. // -// between-bytes-timeout: func() -> option +// between-bytes-timeout: func() // //go:nosplit -func (self RequestOptions) BetweenBytesTimeout() (result cm.Option[Duration]) { +func (self RequestOptions) BetweenBytesTimeout() { self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsBetweenBytesTimeout((uint32)(self0), &result) + wasmimport_RequestOptionsBetweenBytesTimeout((uint32)(self0)) return } @@ -1413,12 +1401,12 @@ func (self RequestOptions) BetweenBytesTimeout() (result cm.Option[Duration]) { // // The timeout for the initial connect to the HTTP Server. // -// connect-timeout: func() -> option +// connect-timeout: func() // //go:nosplit -func (self RequestOptions) ConnectTimeout() (result cm.Option[Duration]) { +func (self RequestOptions) ConnectTimeout() { self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsConnectTimeout((uint32)(self0), &result) + wasmimport_RequestOptionsConnectTimeout((uint32)(self0)) return } @@ -1426,12 +1414,12 @@ func (self RequestOptions) ConnectTimeout() (result cm.Option[Duration]) { // // The timeout for receiving the first byte of the Response body. // -// first-byte-timeout: func() -> option +// first-byte-timeout: func() // //go:nosplit -func (self RequestOptions) FirstByteTimeout() (result cm.Option[Duration]) { +func (self RequestOptions) FirstByteTimeout() { self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsFirstByteTimeout((uint32)(self0), &result) + wasmimport_RequestOptionsFirstByteTimeout((uint32)(self0)) return } @@ -1441,14 +1429,13 @@ func (self RequestOptions) FirstByteTimeout() (result cm.Option[Duration]) { // body stream. An error return value indicates that this timeout is not // supported. // -// set-between-bytes-timeout: func(duration: option) -> result +// set-between-bytes-timeout: func(duration: option) // //go:nosplit -func (self RequestOptions) SetBetweenBytesTimeout(duration cm.Option[Duration]) (result cm.BoolResult) { +func (self RequestOptions) SetBetweenBytesTimeout(duration cm.Option[Duration]) { self0 := cm.Reinterpret[uint32](self) duration0, duration1 := lower_OptionDuration(duration) - result0 := wasmimport_RequestOptionsSetBetweenBytesTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_RequestOptionsSetBetweenBytesTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) return } @@ -1457,14 +1444,13 @@ func (self RequestOptions) SetBetweenBytesTimeout(duration cm.Option[Duration]) // Set the timeout for the initial connect to the HTTP Server. An error // return value indicates that this timeout is not supported. // -// set-connect-timeout: func(duration: option) -> result +// set-connect-timeout: func(duration: option) // //go:nosplit -func (self RequestOptions) SetConnectTimeout(duration cm.Option[Duration]) (result cm.BoolResult) { +func (self RequestOptions) SetConnectTimeout(duration cm.Option[Duration]) { self0 := cm.Reinterpret[uint32](self) duration0, duration1 := lower_OptionDuration(duration) - result0 := wasmimport_RequestOptionsSetConnectTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_RequestOptionsSetConnectTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) return } @@ -1473,14 +1459,13 @@ func (self RequestOptions) SetConnectTimeout(duration cm.Option[Duration]) (resu // Set the timeout for receiving the first byte of the Response body. An // error return value indicates that this timeout is not supported. // -// set-first-byte-timeout: func(duration: option) -> result +// set-first-byte-timeout: func(duration: option) // //go:nosplit -func (self RequestOptions) SetFirstByteTimeout(duration cm.Option[Duration]) (result cm.BoolResult) { +func (self RequestOptions) SetFirstByteTimeout(duration cm.Option[Duration]) { self0 := cm.Reinterpret[uint32](self) duration0, duration1 := lower_OptionDuration(duration) - result0 := wasmimport_RequestOptionsSetFirstByteTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_RequestOptionsSetFirstByteTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) return } @@ -1559,12 +1544,12 @@ func (self IncomingResponse) ResourceDrop() { // Returns the incoming body. May be called at most once. Returns error // if called additional times. // -// consume: func() -> result +// consume: func() // //go:nosplit -func (self IncomingResponse) Consume() (result cm.Result[IncomingBody, IncomingBody, struct{}]) { +func (self IncomingResponse) Consume() { self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingResponseConsume((uint32)(self0), &result) + wasmimport_IncomingResponseConsume((uint32)(self0)) return } @@ -1578,13 +1563,12 @@ func (self IncomingResponse) Consume() (result cm.Result[IncomingBody, IncomingB // This headers resource is a child: it must be dropped before the parent // `incoming-response` is dropped. // -// headers: func() -> headers +// headers: func() // //go:nosplit -func (self IncomingResponse) Headers() (result Headers) { +func (self IncomingResponse) Headers() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_IncomingResponseHeaders((uint32)(self0)) - result = cm.Reinterpret[Headers]((uint32)(result0)) + wasmimport_IncomingResponseHeaders((uint32)(self0)) return } @@ -1592,13 +1576,12 @@ func (self IncomingResponse) Headers() (result Headers) { // // Returns the status code from the incoming response. // -// status: func() -> status-code +// status: func() // //go:nosplit -func (self IncomingResponse) Status() (result StatusCode) { +func (self IncomingResponse) Status() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_IncomingResponseStatus((uint32)(self0)) - result = (StatusCode)((uint32)(result0)) + wasmimport_IncomingResponseStatus((uint32)(self0)) return } @@ -1632,13 +1615,12 @@ func (self IncomingBody) ResourceDrop() { // Takes ownership of `incoming-body`, and returns a `future-trailers`. // This function will trap if the `input-stream` child is still alive. // -// finish: static func(this: incoming-body) -> future-trailers +// finish: static func(this: incoming-body) // //go:nosplit -func IncomingBodyFinish(this IncomingBody) (result FutureTrailers) { +func IncomingBodyFinish(this IncomingBody) { this0 := cm.Reinterpret[uint32](this) - result0 := wasmimport_IncomingBodyFinish((uint32)(this0)) - result = cm.Reinterpret[FutureTrailers]((uint32)(result0)) + wasmimport_IncomingBodyFinish((uint32)(this0)) return } @@ -1660,12 +1642,12 @@ func IncomingBodyFinish(this IncomingBody) (result FutureTrailers) { // and for that backpressure to not inhibit delivery of the trailers if // the user does not read the entire body. // -// %stream: func() -> result +// %stream: func() // //go:nosplit -func (self IncomingBody) Stream() (result cm.Result[InputStream, InputStream, struct{}]) { +func (self IncomingBody) Stream() { self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingBodyStream((uint32)(self0), &result) + wasmimport_IncomingBodyStream((uint32)(self0)) return } @@ -1713,12 +1695,12 @@ func (self FutureTrailers) ResourceDrop() { // `delete` methods will return an error, and the resource must be // dropped before the parent `future-trailers` is dropped. // -// get: func() -> option, error-code>>> +// get: func() // //go:nosplit -func (self FutureTrailers) Get() (result cm.Option[cm.Result[cm.Result[ErrorCodeShape, cm.Option[Trailers], ErrorCode], cm.Result[ErrorCodeShape, cm.Option[Trailers], ErrorCode], struct{}]]) { +func (self FutureTrailers) Get() { self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureTrailersGet((uint32)(self0), &result) + wasmimport_FutureTrailersGet((uint32)(self0)) return } @@ -1728,13 +1710,12 @@ func (self FutureTrailers) Get() (result cm.Option[cm.Result[cm.Result[ErrorCode // been received, or an error has occured. When this pollable is ready, // the `get` method will return `some`. // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self FutureTrailers) Subscribe() (result Pollable) { +func (self FutureTrailers) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_FutureTrailersSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_FutureTrailersSubscribe((uint32)(self0)) return } @@ -1767,10 +1748,9 @@ func (self OutgoingResponse) ResourceDrop() { // constructor(headers: headers) // //go:nosplit -func NewOutgoingResponse(headers Headers) (result OutgoingResponse) { +func NewOutgoingResponse(headers Headers) { headers0 := cm.Reinterpret[uint32](headers) - result0 := wasmimport_NewOutgoingResponse((uint32)(headers0)) - result = cm.Reinterpret[OutgoingResponse]((uint32)(result0)) + wasmimport_NewOutgoingResponse((uint32)(headers0)) return } @@ -1782,12 +1762,12 @@ func NewOutgoingResponse(headers Headers) (result OutgoingResponse) { // this `outgoing-response` can be retrieved at most once. Subsequent // calls will return error. // -// body: func() -> result +// body: func() // //go:nosplit -func (self OutgoingResponse) Body() (result cm.Result[OutgoingBody, OutgoingBody, struct{}]) { +func (self OutgoingResponse) Body() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingResponseBody((uint32)(self0), &result) + wasmimport_OutgoingResponseBody((uint32)(self0)) return } @@ -1802,13 +1782,12 @@ func (self OutgoingResponse) Body() (result cm.Result[OutgoingBody, OutgoingBody // `outgoing-request` is dropped, or its ownership is transfered to // another component by e.g. `outgoing-handler.handle`. // -// headers: func() -> headers +// headers: func() // //go:nosplit -func (self OutgoingResponse) Headers() (result Headers) { +func (self OutgoingResponse) Headers() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutgoingResponseHeaders((uint32)(self0)) - result = cm.Reinterpret[Headers]((uint32)(result0)) + wasmimport_OutgoingResponseHeaders((uint32)(self0)) return } @@ -1817,14 +1796,13 @@ func (self OutgoingResponse) Headers() (result Headers) { // Set the HTTP Status Code for the Response. Fails if the status-code // given is not a valid http status code. // -// set-status-code: func(status-code: status-code) -> result +// set-status-code: func(status-code: status-code) // //go:nosplit -func (self OutgoingResponse) SetStatusCode(statusCode StatusCode) (result cm.BoolResult) { +func (self OutgoingResponse) SetStatusCode(statusCode StatusCode) { self0 := cm.Reinterpret[uint32](self) statusCode0 := (uint32)(statusCode) - result0 := wasmimport_OutgoingResponseSetStatusCode((uint32)(self0), (uint32)(statusCode0)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_OutgoingResponseSetStatusCode((uint32)(self0), (uint32)(statusCode0)) return } @@ -1832,13 +1810,12 @@ func (self OutgoingResponse) SetStatusCode(statusCode StatusCode) (result cm.Boo // // Get the HTTP Status Code for the Response. // -// status-code: func() -> status-code +// status-code: func() // //go:nosplit -func (self OutgoingResponse) StatusCode() (result StatusCode) { +func (self OutgoingResponse) StatusCode() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutgoingResponseStatusCode((uint32)(self0)) - result = (StatusCode)((uint32)(result0)) + wasmimport_OutgoingResponseStatusCode((uint32)(self0)) return } @@ -1887,14 +1864,13 @@ func (self OutgoingBody) ResourceDrop() { // to the body (via `write`) does not match the value given in the // Content-Length. // -// finish: static func(this: outgoing-body, trailers: option) -> result<_, -// error-code> +// finish: static func(this: outgoing-body, trailers: option) // //go:nosplit -func OutgoingBodyFinish(this OutgoingBody, trailers cm.Option[Trailers]) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func OutgoingBodyFinish(this OutgoingBody, trailers cm.Option[Trailers]) { this0 := cm.Reinterpret[uint32](this) trailers0, trailers1 := lower_OptionTrailers(trailers) - wasmimport_OutgoingBodyFinish((uint32)(this0), (uint32)(trailers0), (uint32)(trailers1), &result) + wasmimport_OutgoingBodyFinish((uint32)(this0), (uint32)(trailers0), (uint32)(trailers1)) return } @@ -1910,12 +1886,12 @@ func OutgoingBodyFinish(this OutgoingBody, trailers cm.Option[Trailers]) (result // this `outgoing-body` may be retrieved at most once. Subsequent calls // will return error. // -// write: func() -> result +// write: func() // //go:nosplit -func (self OutgoingBody) Write() (result cm.Result[OutputStream, OutputStream, struct{}]) { +func (self OutgoingBody) Write() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingBodyWrite((uint32)(self0), &result) + wasmimport_OutgoingBodyWrite((uint32)(self0)) return } @@ -1958,12 +1934,12 @@ func (self FutureIncomingResponse) ResourceDrop() { // but those will be reported by the `incoming-body` and its // `output-stream` child. // -// get: func() -> option>> +// get: func() // //go:nosplit -func (self FutureIncomingResponse) Get() (result cm.Option[cm.Result[cm.Result[ErrorCodeShape, IncomingResponse, ErrorCode], cm.Result[ErrorCodeShape, IncomingResponse, ErrorCode], struct{}]]) { +func (self FutureIncomingResponse) Get() { self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureIncomingResponseGet((uint32)(self0), &result) + wasmimport_FutureIncomingResponseGet((uint32)(self0)) return } @@ -1973,13 +1949,12 @@ func (self FutureIncomingResponse) Get() (result cm.Option[cm.Result[cm.Result[E // been received, or an error has occured. When this pollable is ready, // the `get` method will return `some`. // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self FutureIncomingResponse) Subscribe() (result Pollable) { +func (self FutureIncomingResponse) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_FutureIncomingResponseSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_FutureIncomingResponseSubscribe((uint32)(self0)) return } @@ -1997,11 +1972,11 @@ func (self FutureIncomingResponse) Subscribe() (result Pollable) { // Note that this function is fallible because not all io-errors are // http-related errors. // -// http-error-code: func(err: borrow) -> option +// http-error-code: func(err: borrow) // //go:nosplit -func HTTPErrorCode(err IOError) (result cm.Option[ErrorCode]) { +func HTTPErrorCode(err IOError) { err0 := cm.Reinterpret[uint32](err) - wasmimport_HTTPErrorCode((uint32)(err0), &result) + wasmimport_HTTPErrorCode((uint32)(err0)) return } diff --git a/examples/component/http-client/gen/wasi/io/error/error.wit.go b/examples/component/http-client/gen/wasi/io/error/error.wit.go index 828e977e..a7ebc7e4 100755 --- a/examples/component/http-client/gen/wasi/io/error/error.wit.go +++ b/examples/component/http-client/gen/wasi/io/error/error.wit.go @@ -25,11 +25,11 @@ func (self Error) ResourceDrop() { // ToDebugString represents the imported method "to-debug-string". // -// to-debug-string: func() -> string +// to-debug-string: func() // //go:nosplit -func (self Error) ToDebugString() (result string) { +func (self Error) ToDebugString() { self0 := cm.Reinterpret[uint32](self) - wasmimport_ErrorToDebugString((uint32)(self0), &result) + wasmimport_ErrorToDebugString((uint32)(self0)) return } diff --git a/examples/component/http-client/gen/wasi/io/error/ioerror.wasm.go b/examples/component/http-client/gen/wasi/io/error/ioerror.wasm.go index e254b5d8..96c77c65 100755 --- a/examples/component/http-client/gen/wasi/io/error/ioerror.wasm.go +++ b/examples/component/http-client/gen/wasi/io/error/ioerror.wasm.go @@ -10,4 +10,4 @@ func wasmimport_ErrorResourceDrop(self0 uint32) //go:wasmimport wasi:io/error@0.2.0 [method]error.to-debug-string //go:noescape -func wasmimport_ErrorToDebugString(self0 uint32, result *string) +func wasmimport_ErrorToDebugString(self0 uint32) diff --git a/examples/component/http-client/gen/wasi/io/poll/poll.wasm.go b/examples/component/http-client/gen/wasi/io/poll/poll.wasm.go index f7c55c3d..d89a9926 100755 --- a/examples/component/http-client/gen/wasi/io/poll/poll.wasm.go +++ b/examples/component/http-client/gen/wasi/io/poll/poll.wasm.go @@ -2,10 +2,6 @@ package poll -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". //go:wasmimport wasi:io/poll@0.2.0 [resource-drop]pollable @@ -18,8 +14,8 @@ func wasmimport_PollableBlock(self0 uint32) //go:wasmimport wasi:io/poll@0.2.0 [method]pollable.ready //go:noescape -func wasmimport_PollableReady(self0 uint32) (result0 uint32) +func wasmimport_PollableReady(self0 uint32) //go:wasmimport wasi:io/poll@0.2.0 poll //go:noescape -func wasmimport_Poll(in0 *Pollable, in1 uint32, result *cm.List[uint32]) +func wasmimport_Poll(in0 *Pollable, in1 uint32) diff --git a/examples/component/http-client/gen/wasi/io/poll/poll.wit.go b/examples/component/http-client/gen/wasi/io/poll/poll.wit.go index ad9e9564..4a952ecf 100755 --- a/examples/component/http-client/gen/wasi/io/poll/poll.wit.go +++ b/examples/component/http-client/gen/wasi/io/poll/poll.wit.go @@ -36,23 +36,22 @@ func (self Pollable) Block() { // Ready represents the imported method "ready". // -// ready: func() -> bool +// ready: func() // //go:nosplit -func (self Pollable) Ready() (result bool) { +func (self Pollable) Ready() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_PollableReady((uint32)(self0)) - result = (bool)(cm.U32ToBool((uint32)(result0))) + wasmimport_PollableReady((uint32)(self0)) return } // Poll represents the imported function "poll". // -// poll: func(in: list>) -> list +// poll: func(in: list>) // //go:nosplit -func Poll(in cm.List[Pollable]) (result cm.List[uint32]) { +func Poll(in cm.List[Pollable]) { in0, in1 := cm.LowerList(in) - wasmimport_Poll((*Pollable)(in0), (uint32)(in1), &result) + wasmimport_Poll((*Pollable)(in0), (uint32)(in1)) return } diff --git a/examples/component/http-client/gen/wasi/io/streams/streams.wasm.go b/examples/component/http-client/gen/wasi/io/streams/streams.wasm.go index eec56645..98543c56 100755 --- a/examples/component/http-client/gen/wasi/io/streams/streams.wasm.go +++ b/examples/component/http-client/gen/wasi/io/streams/streams.wasm.go @@ -2,10 +2,6 @@ package streams -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". //go:wasmimport wasi:io/streams@0.2.0 [resource-drop]input-stream @@ -14,23 +10,23 @@ func wasmimport_InputStreamResourceDrop(self0 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.blocking-read //go:noescape -func wasmimport_InputStreamBlockingRead(self0 uint32, len0 uint64, result *cm.Result[cm.List[uint8], cm.List[uint8], StreamError]) +func wasmimport_InputStreamBlockingRead(self0 uint32, len0 uint64) //go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.blocking-skip //go:noescape -func wasmimport_InputStreamBlockingSkip(self0 uint32, len0 uint64, result *cm.Result[uint64, uint64, StreamError]) +func wasmimport_InputStreamBlockingSkip(self0 uint32, len0 uint64) //go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.read //go:noescape -func wasmimport_InputStreamRead(self0 uint32, len0 uint64, result *cm.Result[cm.List[uint8], cm.List[uint8], StreamError]) +func wasmimport_InputStreamRead(self0 uint32, len0 uint64) //go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.skip //go:noescape -func wasmimport_InputStreamSkip(self0 uint32, len0 uint64, result *cm.Result[uint64, uint64, StreamError]) +func wasmimport_InputStreamSkip(self0 uint32, len0 uint64) //go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.subscribe //go:noescape -func wasmimport_InputStreamSubscribe(self0 uint32) (result0 uint32) +func wasmimport_InputStreamSubscribe(self0 uint32) //go:wasmimport wasi:io/streams@0.2.0 [resource-drop]output-stream //go:noescape @@ -38,40 +34,40 @@ func wasmimport_OutputStreamResourceDrop(self0 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-flush //go:noescape -func wasmimport_OutputStreamBlockingFlush(self0 uint32, result *cm.Result[StreamError, struct{}, StreamError]) +func wasmimport_OutputStreamBlockingFlush(self0 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-splice //go:noescape -func wasmimport_OutputStreamBlockingSplice(self0 uint32, src0 uint32, len0 uint64, result *cm.Result[uint64, uint64, StreamError]) +func wasmimport_OutputStreamBlockingSplice(self0 uint32, src0 uint32, len0 uint64) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-write-and-flush //go:noescape -func wasmimport_OutputStreamBlockingWriteAndFlush(self0 uint32, contents0 *uint8, contents1 uint32, result *cm.Result[StreamError, struct{}, StreamError]) +func wasmimport_OutputStreamBlockingWriteAndFlush(self0 uint32, contents0 *uint8, contents1 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-write-zeroes-and-flush //go:noescape -func wasmimport_OutputStreamBlockingWriteZeroesAndFlush(self0 uint32, len0 uint64, result *cm.Result[StreamError, struct{}, StreamError]) +func wasmimport_OutputStreamBlockingWriteZeroesAndFlush(self0 uint32, len0 uint64) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.check-write //go:noescape -func wasmimport_OutputStreamCheckWrite(self0 uint32, result *cm.Result[uint64, uint64, StreamError]) +func wasmimport_OutputStreamCheckWrite(self0 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.flush //go:noescape -func wasmimport_OutputStreamFlush(self0 uint32, result *cm.Result[StreamError, struct{}, StreamError]) +func wasmimport_OutputStreamFlush(self0 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.splice //go:noescape -func wasmimport_OutputStreamSplice(self0 uint32, src0 uint32, len0 uint64, result *cm.Result[uint64, uint64, StreamError]) +func wasmimport_OutputStreamSplice(self0 uint32, src0 uint32, len0 uint64) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.subscribe //go:noescape -func wasmimport_OutputStreamSubscribe(self0 uint32) (result0 uint32) +func wasmimport_OutputStreamSubscribe(self0 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.write //go:noescape -func wasmimport_OutputStreamWrite(self0 uint32, contents0 *uint8, contents1 uint32, result *cm.Result[StreamError, struct{}, StreamError]) +func wasmimport_OutputStreamWrite(self0 uint32, contents0 *uint8, contents1 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.write-zeroes //go:noescape -func wasmimport_OutputStreamWriteZeroes(self0 uint32, len0 uint64, result *cm.Result[StreamError, struct{}, StreamError]) +func wasmimport_OutputStreamWriteZeroes(self0 uint32, len0 uint64) diff --git a/examples/component/http-client/gen/wasi/io/streams/streams.wit.go b/examples/component/http-client/gen/wasi/io/streams/streams.wit.go index 24a71fc1..05300c4f 100755 --- a/examples/component/http-client/gen/wasi/io/streams/streams.wit.go +++ b/examples/component/http-client/gen/wasi/io/streams/streams.wit.go @@ -76,61 +76,60 @@ func (self InputStream) ResourceDrop() { // BlockingRead represents the imported method "blocking-read". // -// blocking-read: func(len: u64) -> result, stream-error> +// blocking-read: func(len: u64) // //go:nosplit -func (self InputStream) BlockingRead(len_ uint64) (result cm.Result[cm.List[uint8], cm.List[uint8], StreamError]) { +func (self InputStream) BlockingRead(len_ uint64) { self0 := cm.Reinterpret[uint32](self) len0 := (uint64)(len_) - wasmimport_InputStreamBlockingRead((uint32)(self0), (uint64)(len0), &result) + wasmimport_InputStreamBlockingRead((uint32)(self0), (uint64)(len0)) return } // BlockingSkip represents the imported method "blocking-skip". // -// blocking-skip: func(len: u64) -> result +// blocking-skip: func(len: u64) // //go:nosplit -func (self InputStream) BlockingSkip(len_ uint64) (result cm.Result[uint64, uint64, StreamError]) { +func (self InputStream) BlockingSkip(len_ uint64) { self0 := cm.Reinterpret[uint32](self) len0 := (uint64)(len_) - wasmimport_InputStreamBlockingSkip((uint32)(self0), (uint64)(len0), &result) + wasmimport_InputStreamBlockingSkip((uint32)(self0), (uint64)(len0)) return } // Read represents the imported method "read". // -// read: func(len: u64) -> result, stream-error> +// read: func(len: u64) // //go:nosplit -func (self InputStream) Read(len_ uint64) (result cm.Result[cm.List[uint8], cm.List[uint8], StreamError]) { +func (self InputStream) Read(len_ uint64) { self0 := cm.Reinterpret[uint32](self) len0 := (uint64)(len_) - wasmimport_InputStreamRead((uint32)(self0), (uint64)(len0), &result) + wasmimport_InputStreamRead((uint32)(self0), (uint64)(len0)) return } // Skip represents the imported method "skip". // -// skip: func(len: u64) -> result +// skip: func(len: u64) // //go:nosplit -func (self InputStream) Skip(len_ uint64) (result cm.Result[uint64, uint64, StreamError]) { +func (self InputStream) Skip(len_ uint64) { self0 := cm.Reinterpret[uint32](self) len0 := (uint64)(len_) - wasmimport_InputStreamSkip((uint32)(self0), (uint64)(len0), &result) + wasmimport_InputStreamSkip((uint32)(self0), (uint64)(len0)) return } // Subscribe represents the imported method "subscribe". // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self InputStream) Subscribe() (result Pollable) { +func (self InputStream) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_InputStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_InputStreamSubscribe((uint32)(self0)) return } @@ -152,119 +151,118 @@ func (self OutputStream) ResourceDrop() { // BlockingFlush represents the imported method "blocking-flush". // -// blocking-flush: func() -> result<_, stream-error> +// blocking-flush: func() // //go:nosplit -func (self OutputStream) BlockingFlush() (result cm.Result[StreamError, struct{}, StreamError]) { +func (self OutputStream) BlockingFlush() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamBlockingFlush((uint32)(self0), &result) + wasmimport_OutputStreamBlockingFlush((uint32)(self0)) return } // BlockingSplice represents the imported method "blocking-splice". // -// blocking-splice: func(src: borrow, len: u64) -> result +// blocking-splice: func(src: borrow, len: u64) // //go:nosplit -func (self OutputStream) BlockingSplice(src InputStream, len_ uint64) (result cm.Result[uint64, uint64, StreamError]) { +func (self OutputStream) BlockingSplice(src InputStream, len_ uint64) { self0 := cm.Reinterpret[uint32](self) src0 := cm.Reinterpret[uint32](src) len0 := (uint64)(len_) - wasmimport_OutputStreamBlockingSplice((uint32)(self0), (uint32)(src0), (uint64)(len0), &result) + wasmimport_OutputStreamBlockingSplice((uint32)(self0), (uint32)(src0), (uint64)(len0)) return } // BlockingWriteAndFlush represents the imported method "blocking-write-and-flush". // -// blocking-write-and-flush: func(contents: list) -> result<_, stream-error> +// blocking-write-and-flush: func(contents: list) // //go:nosplit -func (self OutputStream) BlockingWriteAndFlush(contents cm.List[uint8]) (result cm.Result[StreamError, struct{}, StreamError]) { +func (self OutputStream) BlockingWriteAndFlush(contents cm.List[uint8]) { self0 := cm.Reinterpret[uint32](self) contents0, contents1 := cm.LowerList(contents) - wasmimport_OutputStreamBlockingWriteAndFlush((uint32)(self0), (*uint8)(contents0), (uint32)(contents1), &result) + wasmimport_OutputStreamBlockingWriteAndFlush((uint32)(self0), (*uint8)(contents0), (uint32)(contents1)) return } // BlockingWriteZeroesAndFlush represents the imported method "blocking-write-zeroes-and-flush". // -// blocking-write-zeroes-and-flush: func(len: u64) -> result<_, stream-error> +// blocking-write-zeroes-and-flush: func(len: u64) // //go:nosplit -func (self OutputStream) BlockingWriteZeroesAndFlush(len_ uint64) (result cm.Result[StreamError, struct{}, StreamError]) { +func (self OutputStream) BlockingWriteZeroesAndFlush(len_ uint64) { self0 := cm.Reinterpret[uint32](self) len0 := (uint64)(len_) - wasmimport_OutputStreamBlockingWriteZeroesAndFlush((uint32)(self0), (uint64)(len0), &result) + wasmimport_OutputStreamBlockingWriteZeroesAndFlush((uint32)(self0), (uint64)(len0)) return } // CheckWrite represents the imported method "check-write". // -// check-write: func() -> result +// check-write: func() // //go:nosplit -func (self OutputStream) CheckWrite() (result cm.Result[uint64, uint64, StreamError]) { +func (self OutputStream) CheckWrite() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamCheckWrite((uint32)(self0), &result) + wasmimport_OutputStreamCheckWrite((uint32)(self0)) return } // Flush represents the imported method "flush". // -// flush: func() -> result<_, stream-error> +// flush: func() // //go:nosplit -func (self OutputStream) Flush() (result cm.Result[StreamError, struct{}, StreamError]) { +func (self OutputStream) Flush() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamFlush((uint32)(self0), &result) + wasmimport_OutputStreamFlush((uint32)(self0)) return } // Splice represents the imported method "splice". // -// splice: func(src: borrow, len: u64) -> result +// splice: func(src: borrow, len: u64) // //go:nosplit -func (self OutputStream) Splice(src InputStream, len_ uint64) (result cm.Result[uint64, uint64, StreamError]) { +func (self OutputStream) Splice(src InputStream, len_ uint64) { self0 := cm.Reinterpret[uint32](self) src0 := cm.Reinterpret[uint32](src) len0 := (uint64)(len_) - wasmimport_OutputStreamSplice((uint32)(self0), (uint32)(src0), (uint64)(len0), &result) + wasmimport_OutputStreamSplice((uint32)(self0), (uint32)(src0), (uint64)(len0)) return } // Subscribe represents the imported method "subscribe". // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self OutputStream) Subscribe() (result Pollable) { +func (self OutputStream) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutputStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_OutputStreamSubscribe((uint32)(self0)) return } // Write represents the imported method "write". // -// write: func(contents: list) -> result<_, stream-error> +// write: func(contents: list) // //go:nosplit -func (self OutputStream) Write(contents cm.List[uint8]) (result cm.Result[StreamError, struct{}, StreamError]) { +func (self OutputStream) Write(contents cm.List[uint8]) { self0 := cm.Reinterpret[uint32](self) contents0, contents1 := cm.LowerList(contents) - wasmimport_OutputStreamWrite((uint32)(self0), (*uint8)(contents0), (uint32)(contents1), &result) + wasmimport_OutputStreamWrite((uint32)(self0), (*uint8)(contents0), (uint32)(contents1)) return } // WriteZeroes represents the imported method "write-zeroes". // -// write-zeroes: func(len: u64) -> result<_, stream-error> +// write-zeroes: func(len: u64) // //go:nosplit -func (self OutputStream) WriteZeroes(len_ uint64) (result cm.Result[StreamError, struct{}, StreamError]) { +func (self OutputStream) WriteZeroes(len_ uint64) { self0 := cm.Reinterpret[uint32](self) len0 := (uint64)(len_) - wasmimport_OutputStreamWriteZeroes((uint32)(self0), (uint64)(len0), &result) + wasmimport_OutputStreamWriteZeroes((uint32)(self0), (uint64)(len0)) return } diff --git a/examples/component/http-client/gen/wasi/random/insecure-seed/insecure-seed.wit.go b/examples/component/http-client/gen/wasi/random/insecure-seed/insecure-seed.wit.go index e701d1b4..6b9afd75 100755 --- a/examples/component/http-client/gen/wasi/random/insecure-seed/insecure-seed.wit.go +++ b/examples/component/http-client/gen/wasi/random/insecure-seed/insecure-seed.wit.go @@ -5,10 +5,10 @@ package insecureseed // InsecureSeed represents the imported function "insecure-seed". // -// insecure-seed: func() -> tuple +// insecure-seed: func() // //go:nosplit -func InsecureSeed() (result [2]uint64) { - wasmimport_InsecureSeed(&result) +func InsecureSeed() { + wasmimport_InsecureSeed() return } diff --git a/examples/component/http-client/gen/wasi/random/insecure-seed/insecureseed.wasm.go b/examples/component/http-client/gen/wasi/random/insecure-seed/insecureseed.wasm.go index e94356df..6dc19c0b 100755 --- a/examples/component/http-client/gen/wasi/random/insecure-seed/insecureseed.wasm.go +++ b/examples/component/http-client/gen/wasi/random/insecure-seed/insecureseed.wasm.go @@ -6,4 +6,4 @@ package insecureseed //go:wasmimport wasi:random/insecure-seed@0.2.0 insecure-seed //go:noescape -func wasmimport_InsecureSeed(result *[2]uint64) +func wasmimport_InsecureSeed() diff --git a/examples/component/http-client/gen/wasi/random/insecure/insecure.wasm.go b/examples/component/http-client/gen/wasi/random/insecure/insecure.wasm.go index 498bfe4a..41ffb551 100755 --- a/examples/component/http-client/gen/wasi/random/insecure/insecure.wasm.go +++ b/examples/component/http-client/gen/wasi/random/insecure/insecure.wasm.go @@ -2,16 +2,12 @@ package insecure -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". //go:wasmimport wasi:random/insecure@0.2.0 get-insecure-random-bytes //go:noescape -func wasmimport_GetInsecureRandomBytes(len0 uint64, result *cm.List[uint8]) +func wasmimport_GetInsecureRandomBytes(len0 uint64) //go:wasmimport wasi:random/insecure@0.2.0 get-insecure-random-u64 //go:noescape -func wasmimport_GetInsecureRandomU64() (result0 uint64) +func wasmimport_GetInsecureRandomU64() diff --git a/examples/component/http-client/gen/wasi/random/insecure/insecure.wit.go b/examples/component/http-client/gen/wasi/random/insecure/insecure.wit.go index f32282c6..add35465 100755 --- a/examples/component/http-client/gen/wasi/random/insecure/insecure.wit.go +++ b/examples/component/http-client/gen/wasi/random/insecure/insecure.wit.go @@ -3,28 +3,23 @@ // Package insecure represents the imported interface "wasi:random/insecure@0.2.0". package insecure -import ( - "go.bytecodealliance.org/cm" -) - // GetInsecureRandomBytes represents the imported function "get-insecure-random-bytes". // -// get-insecure-random-bytes: func(len: u64) -> list +// get-insecure-random-bytes: func(len: u64) // //go:nosplit -func GetInsecureRandomBytes(len_ uint64) (result cm.List[uint8]) { +func GetInsecureRandomBytes(len_ uint64) { len0 := (uint64)(len_) - wasmimport_GetInsecureRandomBytes((uint64)(len0), &result) + wasmimport_GetInsecureRandomBytes((uint64)(len0)) return } // GetInsecureRandomU64 represents the imported function "get-insecure-random-u64". // -// get-insecure-random-u64: func() -> u64 +// get-insecure-random-u64: func() // //go:nosplit -func GetInsecureRandomU64() (result uint64) { - result0 := wasmimport_GetInsecureRandomU64() - result = (uint64)((uint64)(result0)) +func GetInsecureRandomU64() { + wasmimport_GetInsecureRandomU64() return } diff --git a/examples/component/http-client/gen/wasi/random/random/random.wasm.go b/examples/component/http-client/gen/wasi/random/random/random.wasm.go index 9096457b..512ee826 100755 --- a/examples/component/http-client/gen/wasi/random/random/random.wasm.go +++ b/examples/component/http-client/gen/wasi/random/random/random.wasm.go @@ -2,16 +2,12 @@ package random -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". //go:wasmimport wasi:random/random@0.2.0 get-random-bytes //go:noescape -func wasmimport_GetRandomBytes(len0 uint64, result *cm.List[uint8]) +func wasmimport_GetRandomBytes(len0 uint64) //go:wasmimport wasi:random/random@0.2.0 get-random-u64 //go:noescape -func wasmimport_GetRandomU64() (result0 uint64) +func wasmimport_GetRandomU64() diff --git a/examples/component/http-client/gen/wasi/random/random/random.wit.go b/examples/component/http-client/gen/wasi/random/random/random.wit.go index 98bb7779..f11f988d 100755 --- a/examples/component/http-client/gen/wasi/random/random/random.wit.go +++ b/examples/component/http-client/gen/wasi/random/random/random.wit.go @@ -3,28 +3,23 @@ // Package random represents the imported interface "wasi:random/random@0.2.0". package random -import ( - "go.bytecodealliance.org/cm" -) - // GetRandomBytes represents the imported function "get-random-bytes". // -// get-random-bytes: func(len: u64) -> list +// get-random-bytes: func(len: u64) // //go:nosplit -func GetRandomBytes(len_ uint64) (result cm.List[uint8]) { +func GetRandomBytes(len_ uint64) { len0 := (uint64)(len_) - wasmimport_GetRandomBytes((uint64)(len0), &result) + wasmimport_GetRandomBytes((uint64)(len0)) return } // GetRandomU64 represents the imported function "get-random-u64". // -// get-random-u64: func() -> u64 +// get-random-u64: func() // //go:nosplit -func GetRandomU64() (result uint64) { - result0 := wasmimport_GetRandomU64() - result = (uint64)((uint64)(result0)) +func GetRandomU64() { + wasmimport_GetRandomU64() return } diff --git a/examples/component/http-client/gen/wasi/sockets/instance-network/instance-network.wit.go b/examples/component/http-client/gen/wasi/sockets/instance-network/instance-network.wit.go index c727d7e1..b454a29d 100755 --- a/examples/component/http-client/gen/wasi/sockets/instance-network/instance-network.wit.go +++ b/examples/component/http-client/gen/wasi/sockets/instance-network/instance-network.wit.go @@ -5,7 +5,6 @@ package instancenetwork import ( "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/sockets/network" - "go.bytecodealliance.org/cm" ) // Network represents the imported type alias "wasi:sockets/instance-network@0.2.0#network". @@ -15,11 +14,10 @@ type Network = network.Network // InstanceNetwork represents the imported function "instance-network". // -// instance-network: func() -> network +// instance-network: func() // //go:nosplit -func InstanceNetwork() (result Network) { - result0 := wasmimport_InstanceNetwork() - result = cm.Reinterpret[Network]((uint32)(result0)) +func InstanceNetwork() { + wasmimport_InstanceNetwork() return } diff --git a/examples/component/http-client/gen/wasi/sockets/instance-network/instancenetwork.wasm.go b/examples/component/http-client/gen/wasi/sockets/instance-network/instancenetwork.wasm.go index eb113e21..01fc4839 100755 --- a/examples/component/http-client/gen/wasi/sockets/instance-network/instancenetwork.wasm.go +++ b/examples/component/http-client/gen/wasi/sockets/instance-network/instancenetwork.wasm.go @@ -6,4 +6,4 @@ package instancenetwork //go:wasmimport wasi:sockets/instance-network@0.2.0 instance-network //go:noescape -func wasmimport_InstanceNetwork() (result0 uint32) +func wasmimport_InstanceNetwork() diff --git a/examples/component/http-client/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go b/examples/component/http-client/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go index 99c12f55..d6b8d1fc 100755 --- a/examples/component/http-client/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go +++ b/examples/component/http-client/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go @@ -47,36 +47,34 @@ func (self ResolveAddressStream) ResourceDrop() { // ResolveNextAddress represents the imported method "resolve-next-address". // -// resolve-next-address: func() -> result, error-code> +// resolve-next-address: func() // //go:nosplit -func (self ResolveAddressStream) ResolveNextAddress() (result cm.Result[OptionIPAddressShape, cm.Option[IPAddress], ErrorCode]) { +func (self ResolveAddressStream) ResolveNextAddress() { self0 := cm.Reinterpret[uint32](self) - wasmimport_ResolveAddressStreamResolveNextAddress((uint32)(self0), &result) + wasmimport_ResolveAddressStreamResolveNextAddress((uint32)(self0)) return } // Subscribe represents the imported method "subscribe". // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self ResolveAddressStream) Subscribe() (result Pollable) { +func (self ResolveAddressStream) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_ResolveAddressStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_ResolveAddressStreamSubscribe((uint32)(self0)) return } // ResolveAddresses represents the imported function "resolve-addresses". // -// resolve-addresses: func(network: borrow, name: string) -> result +// resolve-addresses: func(network: borrow, name: string) // //go:nosplit -func ResolveAddresses(network_ Network, name string) (result cm.Result[ResolveAddressStream, ResolveAddressStream, ErrorCode]) { +func ResolveAddresses(network_ Network, name string) { network0 := cm.Reinterpret[uint32](network_) name0, name1 := cm.LowerString(name) - wasmimport_ResolveAddresses((uint32)(network0), (*uint8)(name0), (uint32)(name1), &result) + wasmimport_ResolveAddresses((uint32)(network0), (*uint8)(name0), (uint32)(name1)) return } diff --git a/examples/component/http-client/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go b/examples/component/http-client/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go index da5fb000..df4d85bc 100755 --- a/examples/component/http-client/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go +++ b/examples/component/http-client/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go @@ -2,10 +2,6 @@ package ipnamelookup -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". //go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 [resource-drop]resolve-address-stream @@ -14,12 +10,12 @@ func wasmimport_ResolveAddressStreamResourceDrop(self0 uint32) //go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 [method]resolve-address-stream.resolve-next-address //go:noescape -func wasmimport_ResolveAddressStreamResolveNextAddress(self0 uint32, result *cm.Result[OptionIPAddressShape, cm.Option[IPAddress], ErrorCode]) +func wasmimport_ResolveAddressStreamResolveNextAddress(self0 uint32) //go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 [method]resolve-address-stream.subscribe //go:noescape -func wasmimport_ResolveAddressStreamSubscribe(self0 uint32) (result0 uint32) +func wasmimport_ResolveAddressStreamSubscribe(self0 uint32) //go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 resolve-addresses //go:noescape -func wasmimport_ResolveAddresses(network0 uint32, name0 *uint8, name1 uint32, result *cm.Result[ResolveAddressStream, ResolveAddressStream, ErrorCode]) +func wasmimport_ResolveAddresses(network0 uint32, name0 *uint8, name1 uint32) diff --git a/examples/component/http-client/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go b/examples/component/http-client/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go index 2dd653c8..1399b820 100755 --- a/examples/component/http-client/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go +++ b/examples/component/http-client/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go @@ -6,7 +6,6 @@ package tcpcreatesocket import ( "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/sockets/network" "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/sockets/tcp" - "go.bytecodealliance.org/cm" ) // Network represents the imported type alias "wasi:sockets/tcp-create-socket@0.2.0#network". @@ -31,12 +30,11 @@ type TCPSocket = tcp.TCPSocket // CreateTCPSocket represents the imported function "create-tcp-socket". // -// create-tcp-socket: func(address-family: ip-address-family) -> result +// create-tcp-socket: func(address-family: ip-address-family) // //go:nosplit -func CreateTCPSocket(addressFamily IPAddressFamily) (result cm.Result[TCPSocket, TCPSocket, ErrorCode]) { +func CreateTCPSocket(addressFamily IPAddressFamily) { addressFamily0 := (uint32)(addressFamily) - wasmimport_CreateTCPSocket((uint32)(addressFamily0), &result) + wasmimport_CreateTCPSocket((uint32)(addressFamily0)) return } diff --git a/examples/component/http-client/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go b/examples/component/http-client/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go index b7b43155..48d9b113 100755 --- a/examples/component/http-client/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go +++ b/examples/component/http-client/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go @@ -2,12 +2,8 @@ package tcpcreatesocket -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". //go:wasmimport wasi:sockets/tcp-create-socket@0.2.0 create-tcp-socket //go:noescape -func wasmimport_CreateTCPSocket(addressFamily0 uint32, result *cm.Result[TCPSocket, TCPSocket, ErrorCode]) +func wasmimport_CreateTCPSocket(addressFamily0 uint32) diff --git a/examples/component/http-client/gen/wasi/sockets/tcp/abi.go b/examples/component/http-client/gen/wasi/sockets/tcp/abi.go index db36f756..e1b5e5d7 100755 --- a/examples/component/http-client/gen/wasi/sockets/tcp/abi.go +++ b/examples/component/http-client/gen/wasi/sockets/tcp/abi.go @@ -5,27 +5,8 @@ package tcp import ( "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/sockets/network" "go.bytecodealliance.org/cm" - "unsafe" ) -// TupleTCPSocketInputStreamOutputStreamShape is used for storage in variant or result types. -type TupleTCPSocketInputStreamOutputStreamShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Tuple3[TCPSocket, InputStream, OutputStream]{})]byte -} - -// TupleInputStreamOutputStreamShape is used for storage in variant or result types. -type TupleInputStreamOutputStreamShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Tuple[InputStream, OutputStream]{})]byte -} - -// IPSocketAddressShape is used for storage in variant or result types. -type IPSocketAddressShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(network.IPSocketAddress{})]byte -} - func lower_IPv4Address(v network.IPv4Address) (f0 uint32, f1 uint32, f2 uint32, f3 uint32) { f0 = (uint32)(v[0]) f1 = (uint32)(v[1]) diff --git a/examples/component/http-client/gen/wasi/sockets/tcp/tcp.wasm.go b/examples/component/http-client/gen/wasi/sockets/tcp/tcp.wasm.go index 56247525..3d3553be 100755 --- a/examples/component/http-client/gen/wasi/sockets/tcp/tcp.wasm.go +++ b/examples/component/http-client/gen/wasi/sockets/tcp/tcp.wasm.go @@ -2,10 +2,6 @@ package tcp -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". //go:wasmimport wasi:sockets/tcp@0.2.0 [resource-drop]tcp-socket @@ -14,112 +10,112 @@ func wasmimport_TCPSocketResourceDrop(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.accept //go:noescape -func wasmimport_TCPSocketAccept(self0 uint32, result *cm.Result[TupleTCPSocketInputStreamOutputStreamShape, cm.Tuple3[TCPSocket, InputStream, OutputStream], ErrorCode]) +func wasmimport_TCPSocketAccept(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.address-family //go:noescape -func wasmimport_TCPSocketAddressFamily(self0 uint32) (result0 uint32) +func wasmimport_TCPSocketAddressFamily(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-bind //go:noescape -func wasmimport_TCPSocketFinishBind(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketFinishBind(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-connect //go:noescape -func wasmimport_TCPSocketFinishConnect(self0 uint32, result *cm.Result[TupleInputStreamOutputStreamShape, cm.Tuple[InputStream, OutputStream], ErrorCode]) +func wasmimport_TCPSocketFinishConnect(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-listen //go:noescape -func wasmimport_TCPSocketFinishListen(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketFinishListen(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.hop-limit //go:noescape -func wasmimport_TCPSocketHopLimit(self0 uint32, result *cm.Result[uint8, uint8, ErrorCode]) +func wasmimport_TCPSocketHopLimit(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.is-listening //go:noescape -func wasmimport_TCPSocketIsListening(self0 uint32) (result0 uint32) +func wasmimport_TCPSocketIsListening(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-count //go:noescape -func wasmimport_TCPSocketKeepAliveCount(self0 uint32, result *cm.Result[uint32, uint32, ErrorCode]) +func wasmimport_TCPSocketKeepAliveCount(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-enabled //go:noescape -func wasmimport_TCPSocketKeepAliveEnabled(self0 uint32, result *cm.Result[bool, bool, ErrorCode]) +func wasmimport_TCPSocketKeepAliveEnabled(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-idle-time //go:noescape -func wasmimport_TCPSocketKeepAliveIdleTime(self0 uint32, result *cm.Result[uint64, Duration, ErrorCode]) +func wasmimport_TCPSocketKeepAliveIdleTime(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-interval //go:noescape -func wasmimport_TCPSocketKeepAliveInterval(self0 uint32, result *cm.Result[uint64, Duration, ErrorCode]) +func wasmimport_TCPSocketKeepAliveInterval(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.local-address //go:noescape -func wasmimport_TCPSocketLocalAddress(self0 uint32, result *cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) +func wasmimport_TCPSocketLocalAddress(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.receive-buffer-size //go:noescape -func wasmimport_TCPSocketReceiveBufferSize(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) +func wasmimport_TCPSocketReceiveBufferSize(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.remote-address //go:noescape -func wasmimport_TCPSocketRemoteAddress(self0 uint32, result *cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) +func wasmimport_TCPSocketRemoteAddress(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.send-buffer-size //go:noescape -func wasmimport_TCPSocketSendBufferSize(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) +func wasmimport_TCPSocketSendBufferSize(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-hop-limit //go:noescape -func wasmimport_TCPSocketSetHopLimit(self0 uint32, value0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetHopLimit(self0 uint32, value0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-count //go:noescape -func wasmimport_TCPSocketSetKeepAliveCount(self0 uint32, value0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetKeepAliveCount(self0 uint32, value0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-enabled //go:noescape -func wasmimport_TCPSocketSetKeepAliveEnabled(self0 uint32, value0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetKeepAliveEnabled(self0 uint32, value0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-idle-time //go:noescape -func wasmimport_TCPSocketSetKeepAliveIdleTime(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetKeepAliveIdleTime(self0 uint32, value0 uint64) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-interval //go:noescape -func wasmimport_TCPSocketSetKeepAliveInterval(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetKeepAliveInterval(self0 uint32, value0 uint64) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-listen-backlog-size //go:noescape -func wasmimport_TCPSocketSetListenBacklogSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetListenBacklogSize(self0 uint32, value0 uint64) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-receive-buffer-size //go:noescape -func wasmimport_TCPSocketSetReceiveBufferSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetReceiveBufferSize(self0 uint32, value0 uint64) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-send-buffer-size //go:noescape -func wasmimport_TCPSocketSetSendBufferSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetSendBufferSize(self0 uint32, value0 uint64) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.shutdown //go:noescape -func wasmimport_TCPSocketShutdown(self0 uint32, shutdownType0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketShutdown(self0 uint32, shutdownType0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-bind //go:noescape -func wasmimport_TCPSocketStartBind(self0 uint32, network0 uint32, localAddress0 uint32, localAddress1 uint32, localAddress2 uint32, localAddress3 uint32, localAddress4 uint32, localAddress5 uint32, localAddress6 uint32, localAddress7 uint32, localAddress8 uint32, localAddress9 uint32, localAddress10 uint32, localAddress11 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketStartBind(self0 uint32, network0 uint32, localAddress0 uint32, localAddress1 uint32, localAddress2 uint32, localAddress3 uint32, localAddress4 uint32, localAddress5 uint32, localAddress6 uint32, localAddress7 uint32, localAddress8 uint32, localAddress9 uint32, localAddress10 uint32, localAddress11 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-connect //go:noescape -func wasmimport_TCPSocketStartConnect(self0 uint32, network0 uint32, remoteAddress0 uint32, remoteAddress1 uint32, remoteAddress2 uint32, remoteAddress3 uint32, remoteAddress4 uint32, remoteAddress5 uint32, remoteAddress6 uint32, remoteAddress7 uint32, remoteAddress8 uint32, remoteAddress9 uint32, remoteAddress10 uint32, remoteAddress11 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketStartConnect(self0 uint32, network0 uint32, remoteAddress0 uint32, remoteAddress1 uint32, remoteAddress2 uint32, remoteAddress3 uint32, remoteAddress4 uint32, remoteAddress5 uint32, remoteAddress6 uint32, remoteAddress7 uint32, remoteAddress8 uint32, remoteAddress9 uint32, remoteAddress10 uint32, remoteAddress11 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-listen //go:noescape -func wasmimport_TCPSocketStartListen(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketStartListen(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.subscribe //go:noescape -func wasmimport_TCPSocketSubscribe(self0 uint32) (result0 uint32) +func wasmimport_TCPSocketSubscribe(self0 uint32) diff --git a/examples/component/http-client/gen/wasi/sockets/tcp/tcp.wit.go b/examples/component/http-client/gen/wasi/sockets/tcp/tcp.wit.go index 9216a68d..26a180f7 100755 --- a/examples/component/http-client/gen/wasi/sockets/tcp/tcp.wit.go +++ b/examples/component/http-client/gen/wasi/sockets/tcp/tcp.wit.go @@ -95,326 +95,321 @@ func (self TCPSocket) ResourceDrop() { // Accept represents the imported method "accept". // -// accept: func() -> result, error-code> +// accept: func() // //go:nosplit -func (self TCPSocket) Accept() (result cm.Result[TupleTCPSocketInputStreamOutputStreamShape, cm.Tuple3[TCPSocket, InputStream, OutputStream], ErrorCode]) { +func (self TCPSocket) Accept() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketAccept((uint32)(self0), &result) + wasmimport_TCPSocketAccept((uint32)(self0)) return } // AddressFamily represents the imported method "address-family". // -// address-family: func() -> ip-address-family +// address-family: func() // //go:nosplit -func (self TCPSocket) AddressFamily() (result IPAddressFamily) { +func (self TCPSocket) AddressFamily() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_TCPSocketAddressFamily((uint32)(self0)) - result = (network.IPAddressFamily)((uint32)(result0)) + wasmimport_TCPSocketAddressFamily((uint32)(self0)) return } // FinishBind represents the imported method "finish-bind". // -// finish-bind: func() -> result<_, error-code> +// finish-bind: func() // //go:nosplit -func (self TCPSocket) FinishBind() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) FinishBind() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketFinishBind((uint32)(self0), &result) + wasmimport_TCPSocketFinishBind((uint32)(self0)) return } // FinishConnect represents the imported method "finish-connect". // -// finish-connect: func() -> result, error-code> +// finish-connect: func() // //go:nosplit -func (self TCPSocket) FinishConnect() (result cm.Result[TupleInputStreamOutputStreamShape, cm.Tuple[InputStream, OutputStream], ErrorCode]) { +func (self TCPSocket) FinishConnect() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketFinishConnect((uint32)(self0), &result) + wasmimport_TCPSocketFinishConnect((uint32)(self0)) return } // FinishListen represents the imported method "finish-listen". // -// finish-listen: func() -> result<_, error-code> +// finish-listen: func() // //go:nosplit -func (self TCPSocket) FinishListen() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) FinishListen() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketFinishListen((uint32)(self0), &result) + wasmimport_TCPSocketFinishListen((uint32)(self0)) return } // HopLimit represents the imported method "hop-limit". // -// hop-limit: func() -> result +// hop-limit: func() // //go:nosplit -func (self TCPSocket) HopLimit() (result cm.Result[uint8, uint8, ErrorCode]) { +func (self TCPSocket) HopLimit() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketHopLimit((uint32)(self0), &result) + wasmimport_TCPSocketHopLimit((uint32)(self0)) return } // IsListening represents the imported method "is-listening". // -// is-listening: func() -> bool +// is-listening: func() // //go:nosplit -func (self TCPSocket) IsListening() (result bool) { +func (self TCPSocket) IsListening() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_TCPSocketIsListening((uint32)(self0)) - result = (bool)(cm.U32ToBool((uint32)(result0))) + wasmimport_TCPSocketIsListening((uint32)(self0)) return } // KeepAliveCount represents the imported method "keep-alive-count". // -// keep-alive-count: func() -> result +// keep-alive-count: func() // //go:nosplit -func (self TCPSocket) KeepAliveCount() (result cm.Result[uint32, uint32, ErrorCode]) { +func (self TCPSocket) KeepAliveCount() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveCount((uint32)(self0), &result) + wasmimport_TCPSocketKeepAliveCount((uint32)(self0)) return } // KeepAliveEnabled represents the imported method "keep-alive-enabled". // -// keep-alive-enabled: func() -> result +// keep-alive-enabled: func() // //go:nosplit -func (self TCPSocket) KeepAliveEnabled() (result cm.Result[bool, bool, ErrorCode]) { +func (self TCPSocket) KeepAliveEnabled() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveEnabled((uint32)(self0), &result) + wasmimport_TCPSocketKeepAliveEnabled((uint32)(self0)) return } // KeepAliveIdleTime represents the imported method "keep-alive-idle-time". // -// keep-alive-idle-time: func() -> result +// keep-alive-idle-time: func() // //go:nosplit -func (self TCPSocket) KeepAliveIdleTime() (result cm.Result[uint64, Duration, ErrorCode]) { +func (self TCPSocket) KeepAliveIdleTime() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveIdleTime((uint32)(self0), &result) + wasmimport_TCPSocketKeepAliveIdleTime((uint32)(self0)) return } // KeepAliveInterval represents the imported method "keep-alive-interval". // -// keep-alive-interval: func() -> result +// keep-alive-interval: func() // //go:nosplit -func (self TCPSocket) KeepAliveInterval() (result cm.Result[uint64, Duration, ErrorCode]) { +func (self TCPSocket) KeepAliveInterval() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveInterval((uint32)(self0), &result) + wasmimport_TCPSocketKeepAliveInterval((uint32)(self0)) return } // LocalAddress represents the imported method "local-address". // -// local-address: func() -> result +// local-address: func() // //go:nosplit -func (self TCPSocket) LocalAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) { +func (self TCPSocket) LocalAddress() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketLocalAddress((uint32)(self0), &result) + wasmimport_TCPSocketLocalAddress((uint32)(self0)) return } // ReceiveBufferSize represents the imported method "receive-buffer-size". // -// receive-buffer-size: func() -> result +// receive-buffer-size: func() // //go:nosplit -func (self TCPSocket) ReceiveBufferSize() (result cm.Result[uint64, uint64, ErrorCode]) { +func (self TCPSocket) ReceiveBufferSize() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketReceiveBufferSize((uint32)(self0), &result) + wasmimport_TCPSocketReceiveBufferSize((uint32)(self0)) return } // RemoteAddress represents the imported method "remote-address". // -// remote-address: func() -> result +// remote-address: func() // //go:nosplit -func (self TCPSocket) RemoteAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) { +func (self TCPSocket) RemoteAddress() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketRemoteAddress((uint32)(self0), &result) + wasmimport_TCPSocketRemoteAddress((uint32)(self0)) return } // SendBufferSize represents the imported method "send-buffer-size". // -// send-buffer-size: func() -> result +// send-buffer-size: func() // //go:nosplit -func (self TCPSocket) SendBufferSize() (result cm.Result[uint64, uint64, ErrorCode]) { +func (self TCPSocket) SendBufferSize() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketSendBufferSize((uint32)(self0), &result) + wasmimport_TCPSocketSendBufferSize((uint32)(self0)) return } // SetHopLimit represents the imported method "set-hop-limit". // -// set-hop-limit: func(value: u8) -> result<_, error-code> +// set-hop-limit: func(value: u8) // //go:nosplit -func (self TCPSocket) SetHopLimit(value uint8) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetHopLimit(value uint8) { self0 := cm.Reinterpret[uint32](self) value0 := (uint32)(value) - wasmimport_TCPSocketSetHopLimit((uint32)(self0), (uint32)(value0), &result) + wasmimport_TCPSocketSetHopLimit((uint32)(self0), (uint32)(value0)) return } // SetKeepAliveCount represents the imported method "set-keep-alive-count". // -// set-keep-alive-count: func(value: u32) -> result<_, error-code> +// set-keep-alive-count: func(value: u32) // //go:nosplit -func (self TCPSocket) SetKeepAliveCount(value uint32) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetKeepAliveCount(value uint32) { self0 := cm.Reinterpret[uint32](self) value0 := (uint32)(value) - wasmimport_TCPSocketSetKeepAliveCount((uint32)(self0), (uint32)(value0), &result) + wasmimport_TCPSocketSetKeepAliveCount((uint32)(self0), (uint32)(value0)) return } // SetKeepAliveEnabled represents the imported method "set-keep-alive-enabled". // -// set-keep-alive-enabled: func(value: bool) -> result<_, error-code> +// set-keep-alive-enabled: func(value: bool) // //go:nosplit -func (self TCPSocket) SetKeepAliveEnabled(value bool) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetKeepAliveEnabled(value bool) { self0 := cm.Reinterpret[uint32](self) value0 := (uint32)(cm.BoolToU32(value)) - wasmimport_TCPSocketSetKeepAliveEnabled((uint32)(self0), (uint32)(value0), &result) + wasmimport_TCPSocketSetKeepAliveEnabled((uint32)(self0), (uint32)(value0)) return } // SetKeepAliveIdleTime represents the imported method "set-keep-alive-idle-time". // -// set-keep-alive-idle-time: func(value: duration) -> result<_, error-code> +// set-keep-alive-idle-time: func(value: duration) // //go:nosplit -func (self TCPSocket) SetKeepAliveIdleTime(value Duration) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetKeepAliveIdleTime(value Duration) { self0 := cm.Reinterpret[uint32](self) value0 := (uint64)(value) - wasmimport_TCPSocketSetKeepAliveIdleTime((uint32)(self0), (uint64)(value0), &result) + wasmimport_TCPSocketSetKeepAliveIdleTime((uint32)(self0), (uint64)(value0)) return } // SetKeepAliveInterval represents the imported method "set-keep-alive-interval". // -// set-keep-alive-interval: func(value: duration) -> result<_, error-code> +// set-keep-alive-interval: func(value: duration) // //go:nosplit -func (self TCPSocket) SetKeepAliveInterval(value Duration) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetKeepAliveInterval(value Duration) { self0 := cm.Reinterpret[uint32](self) value0 := (uint64)(value) - wasmimport_TCPSocketSetKeepAliveInterval((uint32)(self0), (uint64)(value0), &result) + wasmimport_TCPSocketSetKeepAliveInterval((uint32)(self0), (uint64)(value0)) return } // SetListenBacklogSize represents the imported method "set-listen-backlog-size". // -// set-listen-backlog-size: func(value: u64) -> result<_, error-code> +// set-listen-backlog-size: func(value: u64) // //go:nosplit -func (self TCPSocket) SetListenBacklogSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetListenBacklogSize(value uint64) { self0 := cm.Reinterpret[uint32](self) value0 := (uint64)(value) - wasmimport_TCPSocketSetListenBacklogSize((uint32)(self0), (uint64)(value0), &result) + wasmimport_TCPSocketSetListenBacklogSize((uint32)(self0), (uint64)(value0)) return } // SetReceiveBufferSize represents the imported method "set-receive-buffer-size". // -// set-receive-buffer-size: func(value: u64) -> result<_, error-code> +// set-receive-buffer-size: func(value: u64) // //go:nosplit -func (self TCPSocket) SetReceiveBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetReceiveBufferSize(value uint64) { self0 := cm.Reinterpret[uint32](self) value0 := (uint64)(value) - wasmimport_TCPSocketSetReceiveBufferSize((uint32)(self0), (uint64)(value0), &result) + wasmimport_TCPSocketSetReceiveBufferSize((uint32)(self0), (uint64)(value0)) return } // SetSendBufferSize represents the imported method "set-send-buffer-size". // -// set-send-buffer-size: func(value: u64) -> result<_, error-code> +// set-send-buffer-size: func(value: u64) // //go:nosplit -func (self TCPSocket) SetSendBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetSendBufferSize(value uint64) { self0 := cm.Reinterpret[uint32](self) value0 := (uint64)(value) - wasmimport_TCPSocketSetSendBufferSize((uint32)(self0), (uint64)(value0), &result) + wasmimport_TCPSocketSetSendBufferSize((uint32)(self0), (uint64)(value0)) return } // Shutdown represents the imported method "shutdown". // -// shutdown: func(shutdown-type: shutdown-type) -> result<_, error-code> +// shutdown: func(shutdown-type: shutdown-type) // //go:nosplit -func (self TCPSocket) Shutdown(shutdownType ShutdownType) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) Shutdown(shutdownType ShutdownType) { self0 := cm.Reinterpret[uint32](self) shutdownType0 := (uint32)(shutdownType) - wasmimport_TCPSocketShutdown((uint32)(self0), (uint32)(shutdownType0), &result) + wasmimport_TCPSocketShutdown((uint32)(self0), (uint32)(shutdownType0)) return } // StartBind represents the imported method "start-bind". // -// start-bind: func(network: borrow, local-address: ip-socket-address) -> -// result<_, error-code> +// start-bind: func(network: borrow, local-address: ip-socket-address) // //go:nosplit -func (self TCPSocket) StartBind(network_ Network, localAddress IPSocketAddress) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) StartBind(network_ Network, localAddress IPSocketAddress) { self0 := cm.Reinterpret[uint32](self) network0 := cm.Reinterpret[uint32](network_) localAddress0, localAddress1, localAddress2, localAddress3, localAddress4, localAddress5, localAddress6, localAddress7, localAddress8, localAddress9, localAddress10, localAddress11 := lower_IPSocketAddress(localAddress) - wasmimport_TCPSocketStartBind((uint32)(self0), (uint32)(network0), (uint32)(localAddress0), (uint32)(localAddress1), (uint32)(localAddress2), (uint32)(localAddress3), (uint32)(localAddress4), (uint32)(localAddress5), (uint32)(localAddress6), (uint32)(localAddress7), (uint32)(localAddress8), (uint32)(localAddress9), (uint32)(localAddress10), (uint32)(localAddress11), &result) + wasmimport_TCPSocketStartBind((uint32)(self0), (uint32)(network0), (uint32)(localAddress0), (uint32)(localAddress1), (uint32)(localAddress2), (uint32)(localAddress3), (uint32)(localAddress4), (uint32)(localAddress5), (uint32)(localAddress6), (uint32)(localAddress7), (uint32)(localAddress8), (uint32)(localAddress9), (uint32)(localAddress10), (uint32)(localAddress11)) return } // StartConnect represents the imported method "start-connect". // // start-connect: func(network: borrow, remote-address: ip-socket-address) -// -> result<_, error-code> // //go:nosplit -func (self TCPSocket) StartConnect(network_ Network, remoteAddress IPSocketAddress) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) StartConnect(network_ Network, remoteAddress IPSocketAddress) { self0 := cm.Reinterpret[uint32](self) network0 := cm.Reinterpret[uint32](network_) remoteAddress0, remoteAddress1, remoteAddress2, remoteAddress3, remoteAddress4, remoteAddress5, remoteAddress6, remoteAddress7, remoteAddress8, remoteAddress9, remoteAddress10, remoteAddress11 := lower_IPSocketAddress(remoteAddress) - wasmimport_TCPSocketStartConnect((uint32)(self0), (uint32)(network0), (uint32)(remoteAddress0), (uint32)(remoteAddress1), (uint32)(remoteAddress2), (uint32)(remoteAddress3), (uint32)(remoteAddress4), (uint32)(remoteAddress5), (uint32)(remoteAddress6), (uint32)(remoteAddress7), (uint32)(remoteAddress8), (uint32)(remoteAddress9), (uint32)(remoteAddress10), (uint32)(remoteAddress11), &result) + wasmimport_TCPSocketStartConnect((uint32)(self0), (uint32)(network0), (uint32)(remoteAddress0), (uint32)(remoteAddress1), (uint32)(remoteAddress2), (uint32)(remoteAddress3), (uint32)(remoteAddress4), (uint32)(remoteAddress5), (uint32)(remoteAddress6), (uint32)(remoteAddress7), (uint32)(remoteAddress8), (uint32)(remoteAddress9), (uint32)(remoteAddress10), (uint32)(remoteAddress11)) return } // StartListen represents the imported method "start-listen". // -// start-listen: func() -> result<_, error-code> +// start-listen: func() // //go:nosplit -func (self TCPSocket) StartListen() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) StartListen() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketStartListen((uint32)(self0), &result) + wasmimport_TCPSocketStartListen((uint32)(self0)) return } // Subscribe represents the imported method "subscribe". // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self TCPSocket) Subscribe() (result Pollable) { +func (self TCPSocket) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_TCPSocketSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_TCPSocketSubscribe((uint32)(self0)) return } diff --git a/examples/component/http-client/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go b/examples/component/http-client/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go index 573125f6..60011fc9 100755 --- a/examples/component/http-client/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go +++ b/examples/component/http-client/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go @@ -6,7 +6,6 @@ package udpcreatesocket import ( "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/sockets/network" "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/sockets/udp" - "go.bytecodealliance.org/cm" ) // Network represents the imported type alias "wasi:sockets/udp-create-socket@0.2.0#network". @@ -31,12 +30,11 @@ type UDPSocket = udp.UDPSocket // CreateUDPSocket represents the imported function "create-udp-socket". // -// create-udp-socket: func(address-family: ip-address-family) -> result +// create-udp-socket: func(address-family: ip-address-family) // //go:nosplit -func CreateUDPSocket(addressFamily IPAddressFamily) (result cm.Result[UDPSocket, UDPSocket, ErrorCode]) { +func CreateUDPSocket(addressFamily IPAddressFamily) { addressFamily0 := (uint32)(addressFamily) - wasmimport_CreateUDPSocket((uint32)(addressFamily0), &result) + wasmimport_CreateUDPSocket((uint32)(addressFamily0)) return } diff --git a/examples/component/http-client/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go b/examples/component/http-client/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go index 94b1ab67..dfe49e18 100755 --- a/examples/component/http-client/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go +++ b/examples/component/http-client/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go @@ -2,12 +2,8 @@ package udpcreatesocket -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". //go:wasmimport wasi:sockets/udp-create-socket@0.2.0 create-udp-socket //go:noescape -func wasmimport_CreateUDPSocket(addressFamily0 uint32, result *cm.Result[UDPSocket, UDPSocket, ErrorCode]) +func wasmimport_CreateUDPSocket(addressFamily0 uint32) diff --git a/examples/component/http-client/gen/wasi/sockets/udp/abi.go b/examples/component/http-client/gen/wasi/sockets/udp/abi.go index 540b8f45..cf83af26 100755 --- a/examples/component/http-client/gen/wasi/sockets/udp/abi.go +++ b/examples/component/http-client/gen/wasi/sockets/udp/abi.go @@ -5,15 +5,8 @@ package udp import ( "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/sockets/network" "go.bytecodealliance.org/cm" - "unsafe" ) -// IPSocketAddressShape is used for storage in variant or result types. -type IPSocketAddressShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(network.IPSocketAddress{})]byte -} - func lower_IPv4Address(v network.IPv4Address) (f0 uint32, f1 uint32, f2 uint32, f3 uint32) { f0 = (uint32)(v[0]) f1 = (uint32)(v[1]) @@ -75,12 +68,6 @@ func lower_IPSocketAddress(v network.IPSocketAddress) (f0 uint32, f1 uint32, f2 return } -// TupleIncomingDatagramStreamOutgoingDatagramStreamShape is used for storage in variant or result types. -type TupleIncomingDatagramStreamOutgoingDatagramStreamShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Tuple[IncomingDatagramStream, OutgoingDatagramStream]{})]byte -} - func lower_OptionIPSocketAddress(v cm.Option[IPSocketAddress]) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32, f11 uint32, f12 uint32) { some := v.Some() if some != nil { diff --git a/examples/component/http-client/gen/wasi/sockets/udp/udp.wasm.go b/examples/component/http-client/gen/wasi/sockets/udp/udp.wasm.go index 83ce8ca7..0b0fd6ba 100755 --- a/examples/component/http-client/gen/wasi/sockets/udp/udp.wasm.go +++ b/examples/component/http-client/gen/wasi/sockets/udp/udp.wasm.go @@ -2,10 +2,6 @@ package udp -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". //go:wasmimport wasi:sockets/udp@0.2.0 [resource-drop]udp-socket @@ -14,55 +10,55 @@ func wasmimport_UDPSocketResourceDrop(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.address-family //go:noescape -func wasmimport_UDPSocketAddressFamily(self0 uint32) (result0 uint32) +func wasmimport_UDPSocketAddressFamily(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.finish-bind //go:noescape -func wasmimport_UDPSocketFinishBind(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_UDPSocketFinishBind(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.local-address //go:noescape -func wasmimport_UDPSocketLocalAddress(self0 uint32, result *cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) +func wasmimport_UDPSocketLocalAddress(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.receive-buffer-size //go:noescape -func wasmimport_UDPSocketReceiveBufferSize(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) +func wasmimport_UDPSocketReceiveBufferSize(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.remote-address //go:noescape -func wasmimport_UDPSocketRemoteAddress(self0 uint32, result *cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) +func wasmimport_UDPSocketRemoteAddress(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.send-buffer-size //go:noescape -func wasmimport_UDPSocketSendBufferSize(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) +func wasmimport_UDPSocketSendBufferSize(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.set-receive-buffer-size //go:noescape -func wasmimport_UDPSocketSetReceiveBufferSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_UDPSocketSetReceiveBufferSize(self0 uint32, value0 uint64) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.set-send-buffer-size //go:noescape -func wasmimport_UDPSocketSetSendBufferSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_UDPSocketSetSendBufferSize(self0 uint32, value0 uint64) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.set-unicast-hop-limit //go:noescape -func wasmimport_UDPSocketSetUnicastHopLimit(self0 uint32, value0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_UDPSocketSetUnicastHopLimit(self0 uint32, value0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.start-bind //go:noescape -func wasmimport_UDPSocketStartBind(self0 uint32, network0 uint32, localAddress0 uint32, localAddress1 uint32, localAddress2 uint32, localAddress3 uint32, localAddress4 uint32, localAddress5 uint32, localAddress6 uint32, localAddress7 uint32, localAddress8 uint32, localAddress9 uint32, localAddress10 uint32, localAddress11 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_UDPSocketStartBind(self0 uint32, network0 uint32, localAddress0 uint32, localAddress1 uint32, localAddress2 uint32, localAddress3 uint32, localAddress4 uint32, localAddress5 uint32, localAddress6 uint32, localAddress7 uint32, localAddress8 uint32, localAddress9 uint32, localAddress10 uint32, localAddress11 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.stream //go:noescape -func wasmimport_UDPSocketStream(self0 uint32, remoteAddress0 uint32, remoteAddress1 uint32, remoteAddress2 uint32, remoteAddress3 uint32, remoteAddress4 uint32, remoteAddress5 uint32, remoteAddress6 uint32, remoteAddress7 uint32, remoteAddress8 uint32, remoteAddress9 uint32, remoteAddress10 uint32, remoteAddress11 uint32, remoteAddress12 uint32, result *cm.Result[TupleIncomingDatagramStreamOutgoingDatagramStreamShape, cm.Tuple[IncomingDatagramStream, OutgoingDatagramStream], ErrorCode]) +func wasmimport_UDPSocketStream(self0 uint32, remoteAddress0 uint32, remoteAddress1 uint32, remoteAddress2 uint32, remoteAddress3 uint32, remoteAddress4 uint32, remoteAddress5 uint32, remoteAddress6 uint32, remoteAddress7 uint32, remoteAddress8 uint32, remoteAddress9 uint32, remoteAddress10 uint32, remoteAddress11 uint32, remoteAddress12 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.subscribe //go:noescape -func wasmimport_UDPSocketSubscribe(self0 uint32) (result0 uint32) +func wasmimport_UDPSocketSubscribe(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.unicast-hop-limit //go:noescape -func wasmimport_UDPSocketUnicastHopLimit(self0 uint32, result *cm.Result[uint8, uint8, ErrorCode]) +func wasmimport_UDPSocketUnicastHopLimit(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [resource-drop]incoming-datagram-stream //go:noescape @@ -70,11 +66,11 @@ func wasmimport_IncomingDatagramStreamResourceDrop(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]incoming-datagram-stream.receive //go:noescape -func wasmimport_IncomingDatagramStreamReceive(self0 uint32, maxResults0 uint64, result *cm.Result[cm.List[IncomingDatagram], cm.List[IncomingDatagram], ErrorCode]) +func wasmimport_IncomingDatagramStreamReceive(self0 uint32, maxResults0 uint64) //go:wasmimport wasi:sockets/udp@0.2.0 [method]incoming-datagram-stream.subscribe //go:noescape -func wasmimport_IncomingDatagramStreamSubscribe(self0 uint32) (result0 uint32) +func wasmimport_IncomingDatagramStreamSubscribe(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [resource-drop]outgoing-datagram-stream //go:noescape @@ -82,12 +78,12 @@ func wasmimport_OutgoingDatagramStreamResourceDrop(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]outgoing-datagram-stream.check-send //go:noescape -func wasmimport_OutgoingDatagramStreamCheckSend(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) +func wasmimport_OutgoingDatagramStreamCheckSend(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]outgoing-datagram-stream.send //go:noescape -func wasmimport_OutgoingDatagramStreamSend(self0 uint32, datagrams0 *OutgoingDatagram, datagrams1 uint32, result *cm.Result[uint64, uint64, ErrorCode]) +func wasmimport_OutgoingDatagramStreamSend(self0 uint32, datagrams0 *OutgoingDatagram, datagrams1 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]outgoing-datagram-stream.subscribe //go:noescape -func wasmimport_OutgoingDatagramStreamSubscribe(self0 uint32) (result0 uint32) +func wasmimport_OutgoingDatagramStreamSubscribe(self0 uint32) diff --git a/examples/component/http-client/gen/wasi/sockets/udp/udp.wit.go b/examples/component/http-client/gen/wasi/sockets/udp/udp.wit.go index b10aa02f..e3bb0079 100755 --- a/examples/component/http-client/gen/wasi/sockets/udp/udp.wit.go +++ b/examples/component/http-client/gen/wasi/sockets/udp/udp.wit.go @@ -76,154 +76,150 @@ func (self UDPSocket) ResourceDrop() { // AddressFamily represents the imported method "address-family". // -// address-family: func() -> ip-address-family +// address-family: func() // //go:nosplit -func (self UDPSocket) AddressFamily() (result IPAddressFamily) { +func (self UDPSocket) AddressFamily() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_UDPSocketAddressFamily((uint32)(self0)) - result = (network.IPAddressFamily)((uint32)(result0)) + wasmimport_UDPSocketAddressFamily((uint32)(self0)) return } // FinishBind represents the imported method "finish-bind". // -// finish-bind: func() -> result<_, error-code> +// finish-bind: func() // //go:nosplit -func (self UDPSocket) FinishBind() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self UDPSocket) FinishBind() { self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketFinishBind((uint32)(self0), &result) + wasmimport_UDPSocketFinishBind((uint32)(self0)) return } // LocalAddress represents the imported method "local-address". // -// local-address: func() -> result +// local-address: func() // //go:nosplit -func (self UDPSocket) LocalAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) { +func (self UDPSocket) LocalAddress() { self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketLocalAddress((uint32)(self0), &result) + wasmimport_UDPSocketLocalAddress((uint32)(self0)) return } // ReceiveBufferSize represents the imported method "receive-buffer-size". // -// receive-buffer-size: func() -> result +// receive-buffer-size: func() // //go:nosplit -func (self UDPSocket) ReceiveBufferSize() (result cm.Result[uint64, uint64, ErrorCode]) { +func (self UDPSocket) ReceiveBufferSize() { self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketReceiveBufferSize((uint32)(self0), &result) + wasmimport_UDPSocketReceiveBufferSize((uint32)(self0)) return } // RemoteAddress represents the imported method "remote-address". // -// remote-address: func() -> result +// remote-address: func() // //go:nosplit -func (self UDPSocket) RemoteAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) { +func (self UDPSocket) RemoteAddress() { self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketRemoteAddress((uint32)(self0), &result) + wasmimport_UDPSocketRemoteAddress((uint32)(self0)) return } // SendBufferSize represents the imported method "send-buffer-size". // -// send-buffer-size: func() -> result +// send-buffer-size: func() // //go:nosplit -func (self UDPSocket) SendBufferSize() (result cm.Result[uint64, uint64, ErrorCode]) { +func (self UDPSocket) SendBufferSize() { self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketSendBufferSize((uint32)(self0), &result) + wasmimport_UDPSocketSendBufferSize((uint32)(self0)) return } // SetReceiveBufferSize represents the imported method "set-receive-buffer-size". // -// set-receive-buffer-size: func(value: u64) -> result<_, error-code> +// set-receive-buffer-size: func(value: u64) // //go:nosplit -func (self UDPSocket) SetReceiveBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self UDPSocket) SetReceiveBufferSize(value uint64) { self0 := cm.Reinterpret[uint32](self) value0 := (uint64)(value) - wasmimport_UDPSocketSetReceiveBufferSize((uint32)(self0), (uint64)(value0), &result) + wasmimport_UDPSocketSetReceiveBufferSize((uint32)(self0), (uint64)(value0)) return } // SetSendBufferSize represents the imported method "set-send-buffer-size". // -// set-send-buffer-size: func(value: u64) -> result<_, error-code> +// set-send-buffer-size: func(value: u64) // //go:nosplit -func (self UDPSocket) SetSendBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self UDPSocket) SetSendBufferSize(value uint64) { self0 := cm.Reinterpret[uint32](self) value0 := (uint64)(value) - wasmimport_UDPSocketSetSendBufferSize((uint32)(self0), (uint64)(value0), &result) + wasmimport_UDPSocketSetSendBufferSize((uint32)(self0), (uint64)(value0)) return } // SetUnicastHopLimit represents the imported method "set-unicast-hop-limit". // -// set-unicast-hop-limit: func(value: u8) -> result<_, error-code> +// set-unicast-hop-limit: func(value: u8) // //go:nosplit -func (self UDPSocket) SetUnicastHopLimit(value uint8) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self UDPSocket) SetUnicastHopLimit(value uint8) { self0 := cm.Reinterpret[uint32](self) value0 := (uint32)(value) - wasmimport_UDPSocketSetUnicastHopLimit((uint32)(self0), (uint32)(value0), &result) + wasmimport_UDPSocketSetUnicastHopLimit((uint32)(self0), (uint32)(value0)) return } // StartBind represents the imported method "start-bind". // -// start-bind: func(network: borrow, local-address: ip-socket-address) -> -// result<_, error-code> +// start-bind: func(network: borrow, local-address: ip-socket-address) // //go:nosplit -func (self UDPSocket) StartBind(network_ Network, localAddress IPSocketAddress) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self UDPSocket) StartBind(network_ Network, localAddress IPSocketAddress) { self0 := cm.Reinterpret[uint32](self) network0 := cm.Reinterpret[uint32](network_) localAddress0, localAddress1, localAddress2, localAddress3, localAddress4, localAddress5, localAddress6, localAddress7, localAddress8, localAddress9, localAddress10, localAddress11 := lower_IPSocketAddress(localAddress) - wasmimport_UDPSocketStartBind((uint32)(self0), (uint32)(network0), (uint32)(localAddress0), (uint32)(localAddress1), (uint32)(localAddress2), (uint32)(localAddress3), (uint32)(localAddress4), (uint32)(localAddress5), (uint32)(localAddress6), (uint32)(localAddress7), (uint32)(localAddress8), (uint32)(localAddress9), (uint32)(localAddress10), (uint32)(localAddress11), &result) + wasmimport_UDPSocketStartBind((uint32)(self0), (uint32)(network0), (uint32)(localAddress0), (uint32)(localAddress1), (uint32)(localAddress2), (uint32)(localAddress3), (uint32)(localAddress4), (uint32)(localAddress5), (uint32)(localAddress6), (uint32)(localAddress7), (uint32)(localAddress8), (uint32)(localAddress9), (uint32)(localAddress10), (uint32)(localAddress11)) return } // Stream represents the imported method "stream". // -// %stream: func(remote-address: option) -> result, error-code> +// %stream: func(remote-address: option) // //go:nosplit -func (self UDPSocket) Stream(remoteAddress cm.Option[IPSocketAddress]) (result cm.Result[TupleIncomingDatagramStreamOutgoingDatagramStreamShape, cm.Tuple[IncomingDatagramStream, OutgoingDatagramStream], ErrorCode]) { +func (self UDPSocket) Stream(remoteAddress cm.Option[IPSocketAddress]) { self0 := cm.Reinterpret[uint32](self) remoteAddress0, remoteAddress1, remoteAddress2, remoteAddress3, remoteAddress4, remoteAddress5, remoteAddress6, remoteAddress7, remoteAddress8, remoteAddress9, remoteAddress10, remoteAddress11, remoteAddress12 := lower_OptionIPSocketAddress(remoteAddress) - wasmimport_UDPSocketStream((uint32)(self0), (uint32)(remoteAddress0), (uint32)(remoteAddress1), (uint32)(remoteAddress2), (uint32)(remoteAddress3), (uint32)(remoteAddress4), (uint32)(remoteAddress5), (uint32)(remoteAddress6), (uint32)(remoteAddress7), (uint32)(remoteAddress8), (uint32)(remoteAddress9), (uint32)(remoteAddress10), (uint32)(remoteAddress11), (uint32)(remoteAddress12), &result) + wasmimport_UDPSocketStream((uint32)(self0), (uint32)(remoteAddress0), (uint32)(remoteAddress1), (uint32)(remoteAddress2), (uint32)(remoteAddress3), (uint32)(remoteAddress4), (uint32)(remoteAddress5), (uint32)(remoteAddress6), (uint32)(remoteAddress7), (uint32)(remoteAddress8), (uint32)(remoteAddress9), (uint32)(remoteAddress10), (uint32)(remoteAddress11), (uint32)(remoteAddress12)) return } // Subscribe represents the imported method "subscribe". // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self UDPSocket) Subscribe() (result Pollable) { +func (self UDPSocket) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_UDPSocketSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_UDPSocketSubscribe((uint32)(self0)) return } // UnicastHopLimit represents the imported method "unicast-hop-limit". // -// unicast-hop-limit: func() -> result +// unicast-hop-limit: func() // //go:nosplit -func (self UDPSocket) UnicastHopLimit() (result cm.Result[uint8, uint8, ErrorCode]) { +func (self UDPSocket) UnicastHopLimit() { self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketUnicastHopLimit((uint32)(self0), &result) + wasmimport_UDPSocketUnicastHopLimit((uint32)(self0)) return } @@ -245,25 +241,24 @@ func (self IncomingDatagramStream) ResourceDrop() { // Receive represents the imported method "receive". // -// receive: func(max-results: u64) -> result, error-code> +// receive: func(max-results: u64) // //go:nosplit -func (self IncomingDatagramStream) Receive(maxResults uint64) (result cm.Result[cm.List[IncomingDatagram], cm.List[IncomingDatagram], ErrorCode]) { +func (self IncomingDatagramStream) Receive(maxResults uint64) { self0 := cm.Reinterpret[uint32](self) maxResults0 := (uint64)(maxResults) - wasmimport_IncomingDatagramStreamReceive((uint32)(self0), (uint64)(maxResults0), &result) + wasmimport_IncomingDatagramStreamReceive((uint32)(self0), (uint64)(maxResults0)) return } // Subscribe represents the imported method "subscribe". // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self IncomingDatagramStream) Subscribe() (result Pollable) { +func (self IncomingDatagramStream) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_IncomingDatagramStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_IncomingDatagramStreamSubscribe((uint32)(self0)) return } @@ -285,35 +280,34 @@ func (self OutgoingDatagramStream) ResourceDrop() { // CheckSend represents the imported method "check-send". // -// check-send: func() -> result +// check-send: func() // //go:nosplit -func (self OutgoingDatagramStream) CheckSend() (result cm.Result[uint64, uint64, ErrorCode]) { +func (self OutgoingDatagramStream) CheckSend() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingDatagramStreamCheckSend((uint32)(self0), &result) + wasmimport_OutgoingDatagramStreamCheckSend((uint32)(self0)) return } // Send represents the imported method "send". // -// send: func(datagrams: list) -> result +// send: func(datagrams: list) // //go:nosplit -func (self OutgoingDatagramStream) Send(datagrams cm.List[OutgoingDatagram]) (result cm.Result[uint64, uint64, ErrorCode]) { +func (self OutgoingDatagramStream) Send(datagrams cm.List[OutgoingDatagram]) { self0 := cm.Reinterpret[uint32](self) datagrams0, datagrams1 := cm.LowerList(datagrams) - wasmimport_OutgoingDatagramStreamSend((uint32)(self0), (*OutgoingDatagram)(datagrams0), (uint32)(datagrams1), &result) + wasmimport_OutgoingDatagramStreamSend((uint32)(self0), (*OutgoingDatagram)(datagrams0), (uint32)(datagrams1)) return } // Subscribe represents the imported method "subscribe". // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self OutgoingDatagramStream) Subscribe() (result Pollable) { +func (self OutgoingDatagramStream) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutgoingDatagramStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_OutgoingDatagramStreamSubscribe((uint32)(self0)) return } diff --git a/examples/component/http-client/gen/wasmcloud/bus/lattice/lattice.wasm.go b/examples/component/http-client/gen/wasmcloud/bus/lattice/lattice.wasm.go index 7c7b9094..6c044549 100755 --- a/examples/component/http-client/gen/wasmcloud/bus/lattice/lattice.wasm.go +++ b/examples/component/http-client/gen/wasmcloud/bus/lattice/lattice.wasm.go @@ -10,7 +10,7 @@ func wasmimport_CallTargetInterfaceResourceDrop(self0 uint32) //go:wasmimport wasmcloud:bus/lattice@1.0.0 [constructor]call-target-interface //go:noescape -func wasmimport_NewCallTargetInterface(namespace0 *uint8, namespace1 uint32, package0 *uint8, package1 uint32, interface0 *uint8, interface1 uint32) (result0 uint32) +func wasmimport_NewCallTargetInterface(namespace0 *uint8, namespace1 uint32, package0 *uint8, package1 uint32, interface0 *uint8, interface1 uint32) //go:wasmimport wasmcloud:bus/lattice@1.0.0 set-link-name //go:noescape diff --git a/examples/component/http-client/gen/wasmcloud/bus/lattice/lattice.wit.go b/examples/component/http-client/gen/wasmcloud/bus/lattice/lattice.wit.go index ba34d30c..af5d44b6 100755 --- a/examples/component/http-client/gen/wasmcloud/bus/lattice/lattice.wit.go +++ b/examples/component/http-client/gen/wasmcloud/bus/lattice/lattice.wit.go @@ -28,12 +28,11 @@ func (self CallTargetInterface) ResourceDrop() { // constructor(namespace: string, %package: string, %interface: string) // //go:nosplit -func NewCallTargetInterface(namespace string, package_ string, interface_ string) (result CallTargetInterface) { +func NewCallTargetInterface(namespace string, package_ string, interface_ string) { namespace0, namespace1 := cm.LowerString(namespace) package0, package1 := cm.LowerString(package_) interface0, interface1 := cm.LowerString(interface_) - result0 := wasmimport_NewCallTargetInterface((*uint8)(namespace0), (uint32)(namespace1), (*uint8)(package0), (uint32)(package1), (*uint8)(interface0), (uint32)(interface1)) - result = cm.Reinterpret[CallTargetInterface]((uint32)(result0)) + wasmimport_NewCallTargetInterface((*uint8)(namespace0), (uint32)(namespace1), (*uint8)(package0), (uint32)(package1), (*uint8)(interface0), (uint32)(interface1)) return } diff --git a/examples/component/http-client/gen/wasmcloud/secrets/reveal/reveal.wasm.go b/examples/component/http-client/gen/wasmcloud/secrets/reveal/reveal.wasm.go index 65404eb3..a6d83174 100755 --- a/examples/component/http-client/gen/wasmcloud/secrets/reveal/reveal.wasm.go +++ b/examples/component/http-client/gen/wasmcloud/secrets/reveal/reveal.wasm.go @@ -6,4 +6,4 @@ package reveal //go:wasmimport wasmcloud:secrets/reveal@0.1.0-draft reveal //go:noescape -func wasmimport_Reveal(s0 uint32, result *SecretValue) +func wasmimport_Reveal(s0 uint32) diff --git a/examples/component/http-client/gen/wasmcloud/secrets/reveal/reveal.wit.go b/examples/component/http-client/gen/wasmcloud/secrets/reveal/reveal.wit.go index a16d9dbc..077a3369 100755 --- a/examples/component/http-client/gen/wasmcloud/secrets/reveal/reveal.wit.go +++ b/examples/component/http-client/gen/wasmcloud/secrets/reveal/reveal.wit.go @@ -20,11 +20,11 @@ type SecretValue = store.SecretValue // Reveal represents the imported function "reveal". // -// reveal: func(s: borrow) -> secret-value +// reveal: func(s: borrow) // //go:nosplit -func Reveal(s Secret) (result SecretValue) { +func Reveal(s Secret) { s0 := cm.Reinterpret[uint32](s) - wasmimport_Reveal((uint32)(s0), &result) + wasmimport_Reveal((uint32)(s0)) return } diff --git a/examples/component/http-client/gen/wasmcloud/secrets/store/store.wasm.go b/examples/component/http-client/gen/wasmcloud/secrets/store/store.wasm.go index cc94c517..4ef43490 100755 --- a/examples/component/http-client/gen/wasmcloud/secrets/store/store.wasm.go +++ b/examples/component/http-client/gen/wasmcloud/secrets/store/store.wasm.go @@ -2,10 +2,6 @@ package store -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasmcloud:secrets@0.1.0-draft". //go:wasmimport wasmcloud:secrets/store@0.1.0-draft [resource-drop]secret @@ -14,4 +10,4 @@ func wasmimport_SecretResourceDrop(self0 uint32) //go:wasmimport wasmcloud:secrets/store@0.1.0-draft get //go:noescape -func wasmimport_Get(key0 *uint8, key1 uint32, result *cm.Result[SecretsErrorShape, Secret, SecretsError]) +func wasmimport_Get(key0 *uint8, key1 uint32) diff --git a/examples/component/http-client/gen/wasmcloud/secrets/store/store.wit.go b/examples/component/http-client/gen/wasmcloud/secrets/store/store.wit.go index d3465e4f..405555fa 100755 --- a/examples/component/http-client/gen/wasmcloud/secrets/store/store.wit.go +++ b/examples/component/http-client/gen/wasmcloud/secrets/store/store.wit.go @@ -114,11 +114,11 @@ func (self Secret) ResourceDrop() { // Get represents the imported function "get". // -// get: func(key: string) -> result +// get: func(key: string) // //go:nosplit -func Get(key string) (result cm.Result[SecretsErrorShape, Secret, SecretsError]) { +func Get(key string) { key0, key1 := cm.LowerString(key) - wasmimport_Get((*uint8)(key0), (uint32)(key1), &result) + wasmimport_Get((*uint8)(key0), (uint32)(key1)) return } diff --git a/examples/component/http-keyvalue-crud/go.mod b/examples/component/http-keyvalue-crud/go.mod index b970b16c..08c439bd 100644 --- a/examples/component/http-keyvalue-crud/go.mod +++ b/examples/component/http-keyvalue-crud/go.mod @@ -30,3 +30,6 @@ tool ( go.bytecodealliance.org/cmd/wit-bindgen-go go.wasmcloud.dev/wadge/cmd/wadge-bindgen-go ) + +// NOTE(lxf): Remove this line if running outside of wasmCloud/go repository +replace go.wasmcloud.dev/component => ../../../component \ No newline at end of file diff --git a/examples/component/http-password-checker/README.md b/examples/component/http-password-checker/README.md index 21380d88..988635f2 100644 --- a/examples/component/http-password-checker/README.md +++ b/examples/component/http-password-checker/README.md @@ -17,13 +17,6 @@ The application... ## 📦 Dependencies -> [!WARNING] -> Due to incompatibilities introduced in `wasm-tools` v1.226.0, a version of -> `wasm-tools` <= 1.225.0 is **required** for running this example. -> -> You can install `wasm-tools` [v1.225.0 from upstream releases](https://github.com/bytecodealliance/wasm-tools/releases/tag/v1.225.0), or use -> `cargo` ([Rust toolchain](https://doc.rust-lang.org/cargo/getting-started/installation.html)) -- (i.e. `cargo install --locked wasm-tools@1.225.0`) - Before starting, ensure that you have the following installed in addition to the Go (1.23+) toolchain: - [`tinygo`](https://tinygo.org/getting-started/install/) for compiling Go (always use the latest version) @@ -97,6 +90,10 @@ You can cancel the `wash dev` process with `Ctrl-C`. ## ⚠️ Issues/FAQ +### Build errors + +New releases of `wasm-tools` may introduce compatibility issues that can result in build errors. If you encounter issues, try using v1.225.0, which is currently the most consistent for Go builds. You can install `wasm-tools` [v1.225.0 from upstream releases](https://github.com/bytecodealliance/wasm-tools/releases/tag/v1.225.0), or use `cargo` ([Rust toolchain](https://doc.rust-lang.org/cargo/getting-started/installation.html)) -- (i.e. `cargo install --locked wasm-tools@1.225.0`) + ### `curl` produces a "failed to invoke" error If `curl`ing produces... diff --git a/examples/component/http-password-checker/gen/wasi/cli/environment/environment.wasm.go b/examples/component/http-password-checker/gen/wasi/cli/environment/environment.wasm.go index 89bb596b..b4c02ba4 100755 --- a/examples/component/http-password-checker/gen/wasi/cli/environment/environment.wasm.go +++ b/examples/component/http-password-checker/gen/wasi/cli/environment/environment.wasm.go @@ -2,20 +2,16 @@ package environment -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". //go:wasmimport wasi:cli/environment@0.2.0 get-environment //go:noescape -func wasmimport_GetEnvironment(result *cm.List[[2]string]) +func wasmimport_GetEnvironment() //go:wasmimport wasi:cli/environment@0.2.0 get-arguments //go:noescape -func wasmimport_GetArguments(result *cm.List[string]) +func wasmimport_GetArguments() //go:wasmimport wasi:cli/environment@0.2.0 initial-cwd //go:noescape -func wasmimport_InitialCWD(result *cm.Option[string]) +func wasmimport_InitialCWD() diff --git a/examples/component/http-password-checker/gen/wasi/cli/environment/environment.wit.go b/examples/component/http-password-checker/gen/wasi/cli/environment/environment.wit.go index 068bed33..7d1f8133 100755 --- a/examples/component/http-password-checker/gen/wasi/cli/environment/environment.wit.go +++ b/examples/component/http-password-checker/gen/wasi/cli/environment/environment.wit.go @@ -3,36 +3,32 @@ // Package environment represents the imported interface "wasi:cli/environment@0.2.0". package environment -import ( - "go.bytecodealliance.org/cm" -) - // GetEnvironment represents the imported function "get-environment". // -// get-environment: func() -> list> +// get-environment: func() // //go:nosplit -func GetEnvironment() (result cm.List[[2]string]) { - wasmimport_GetEnvironment(&result) +func GetEnvironment() { + wasmimport_GetEnvironment() return } // GetArguments represents the imported function "get-arguments". // -// get-arguments: func() -> list +// get-arguments: func() // //go:nosplit -func GetArguments() (result cm.List[string]) { - wasmimport_GetArguments(&result) +func GetArguments() { + wasmimport_GetArguments() return } // InitialCWD represents the imported function "initial-cwd". // -// initial-cwd: func() -> option +// initial-cwd: func() // //go:nosplit -func InitialCWD() (result cm.Option[string]) { - wasmimport_InitialCWD(&result) +func InitialCWD() { + wasmimport_InitialCWD() return } diff --git a/examples/component/http-password-checker/gen/wasi/cli/stderr/stderr.wasm.go b/examples/component/http-password-checker/gen/wasi/cli/stderr/stderr.wasm.go index 462cf172..9c5bcdb9 100755 --- a/examples/component/http-password-checker/gen/wasi/cli/stderr/stderr.wasm.go +++ b/examples/component/http-password-checker/gen/wasi/cli/stderr/stderr.wasm.go @@ -6,4 +6,4 @@ package stderr //go:wasmimport wasi:cli/stderr@0.2.0 get-stderr //go:noescape -func wasmimport_GetStderr() (result0 uint32) +func wasmimport_GetStderr() diff --git a/examples/component/http-password-checker/gen/wasi/cli/stderr/stderr.wit.go b/examples/component/http-password-checker/gen/wasi/cli/stderr/stderr.wit.go index 2b9ac018..ddac2bda 100755 --- a/examples/component/http-password-checker/gen/wasi/cli/stderr/stderr.wit.go +++ b/examples/component/http-password-checker/gen/wasi/cli/stderr/stderr.wit.go @@ -4,7 +4,6 @@ package stderr import ( - "go.bytecodealliance.org/cm" "http-password-checker/gen/wasi/io/streams" ) @@ -15,11 +14,10 @@ type OutputStream = streams.OutputStream // GetStderr represents the imported function "get-stderr". // -// get-stderr: func() -> output-stream +// get-stderr: func() // //go:nosplit -func GetStderr() (result OutputStream) { - result0 := wasmimport_GetStderr() - result = cm.Reinterpret[OutputStream]((uint32)(result0)) +func GetStderr() { + wasmimport_GetStderr() return } diff --git a/examples/component/http-password-checker/gen/wasi/cli/stdin/stdin.wasm.go b/examples/component/http-password-checker/gen/wasi/cli/stdin/stdin.wasm.go index 374eb253..090f2e31 100755 --- a/examples/component/http-password-checker/gen/wasi/cli/stdin/stdin.wasm.go +++ b/examples/component/http-password-checker/gen/wasi/cli/stdin/stdin.wasm.go @@ -6,4 +6,4 @@ package stdin //go:wasmimport wasi:cli/stdin@0.2.0 get-stdin //go:noescape -func wasmimport_GetStdin() (result0 uint32) +func wasmimport_GetStdin() diff --git a/examples/component/http-password-checker/gen/wasi/cli/stdin/stdin.wit.go b/examples/component/http-password-checker/gen/wasi/cli/stdin/stdin.wit.go index 8242a9d0..55888f91 100755 --- a/examples/component/http-password-checker/gen/wasi/cli/stdin/stdin.wit.go +++ b/examples/component/http-password-checker/gen/wasi/cli/stdin/stdin.wit.go @@ -4,7 +4,6 @@ package stdin import ( - "go.bytecodealliance.org/cm" "http-password-checker/gen/wasi/io/streams" ) @@ -15,11 +14,10 @@ type InputStream = streams.InputStream // GetStdin represents the imported function "get-stdin". // -// get-stdin: func() -> input-stream +// get-stdin: func() // //go:nosplit -func GetStdin() (result InputStream) { - result0 := wasmimport_GetStdin() - result = cm.Reinterpret[InputStream]((uint32)(result0)) +func GetStdin() { + wasmimport_GetStdin() return } diff --git a/examples/component/http-password-checker/gen/wasi/cli/stdout/stdout.wasm.go b/examples/component/http-password-checker/gen/wasi/cli/stdout/stdout.wasm.go index 68e4a3da..1a1a2650 100755 --- a/examples/component/http-password-checker/gen/wasi/cli/stdout/stdout.wasm.go +++ b/examples/component/http-password-checker/gen/wasi/cli/stdout/stdout.wasm.go @@ -6,4 +6,4 @@ package stdout //go:wasmimport wasi:cli/stdout@0.2.0 get-stdout //go:noescape -func wasmimport_GetStdout() (result0 uint32) +func wasmimport_GetStdout() diff --git a/examples/component/http-password-checker/gen/wasi/cli/stdout/stdout.wit.go b/examples/component/http-password-checker/gen/wasi/cli/stdout/stdout.wit.go index b1b8ffa8..b123b280 100755 --- a/examples/component/http-password-checker/gen/wasi/cli/stdout/stdout.wit.go +++ b/examples/component/http-password-checker/gen/wasi/cli/stdout/stdout.wit.go @@ -4,7 +4,6 @@ package stdout import ( - "go.bytecodealliance.org/cm" "http-password-checker/gen/wasi/io/streams" ) @@ -15,11 +14,10 @@ type OutputStream = streams.OutputStream // GetStdout represents the imported function "get-stdout". // -// get-stdout: func() -> output-stream +// get-stdout: func() // //go:nosplit -func GetStdout() (result OutputStream) { - result0 := wasmimport_GetStdout() - result = cm.Reinterpret[OutputStream]((uint32)(result0)) +func GetStdout() { + wasmimport_GetStdout() return } diff --git a/examples/component/http-password-checker/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go b/examples/component/http-password-checker/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go index 1afc0b57..c9c97a7a 100755 --- a/examples/component/http-password-checker/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go +++ b/examples/component/http-password-checker/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go @@ -4,7 +4,6 @@ package terminalstderr import ( - "go.bytecodealliance.org/cm" terminaloutput "http-password-checker/gen/wasi/cli/terminal-output" ) @@ -15,10 +14,10 @@ type TerminalOutput = terminaloutput.TerminalOutput // GetTerminalStderr represents the imported function "get-terminal-stderr". // -// get-terminal-stderr: func() -> option +// get-terminal-stderr: func() // //go:nosplit -func GetTerminalStderr() (result cm.Option[TerminalOutput]) { - wasmimport_GetTerminalStderr(&result) +func GetTerminalStderr() { + wasmimport_GetTerminalStderr() return } diff --git a/examples/component/http-password-checker/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go b/examples/component/http-password-checker/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go index be9af72f..03cbe909 100755 --- a/examples/component/http-password-checker/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go +++ b/examples/component/http-password-checker/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go @@ -2,12 +2,8 @@ package terminalstderr -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". //go:wasmimport wasi:cli/terminal-stderr@0.2.0 get-terminal-stderr //go:noescape -func wasmimport_GetTerminalStderr(result *cm.Option[TerminalOutput]) +func wasmimport_GetTerminalStderr() diff --git a/examples/component/http-password-checker/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go b/examples/component/http-password-checker/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go index 4dcb7319..b1423587 100755 --- a/examples/component/http-password-checker/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go +++ b/examples/component/http-password-checker/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go @@ -4,7 +4,6 @@ package terminalstdin import ( - "go.bytecodealliance.org/cm" terminalinput "http-password-checker/gen/wasi/cli/terminal-input" ) @@ -15,10 +14,10 @@ type TerminalInput = terminalinput.TerminalInput // GetTerminalStdin represents the imported function "get-terminal-stdin". // -// get-terminal-stdin: func() -> option +// get-terminal-stdin: func() // //go:nosplit -func GetTerminalStdin() (result cm.Option[TerminalInput]) { - wasmimport_GetTerminalStdin(&result) +func GetTerminalStdin() { + wasmimport_GetTerminalStdin() return } diff --git a/examples/component/http-password-checker/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go b/examples/component/http-password-checker/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go index e3b3ac61..1a59d9fd 100755 --- a/examples/component/http-password-checker/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go +++ b/examples/component/http-password-checker/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go @@ -2,12 +2,8 @@ package terminalstdin -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". //go:wasmimport wasi:cli/terminal-stdin@0.2.0 get-terminal-stdin //go:noescape -func wasmimport_GetTerminalStdin(result *cm.Option[TerminalInput]) +func wasmimport_GetTerminalStdin() diff --git a/examples/component/http-password-checker/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go b/examples/component/http-password-checker/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go index 34a24a7b..c38358ef 100755 --- a/examples/component/http-password-checker/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go +++ b/examples/component/http-password-checker/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go @@ -4,7 +4,6 @@ package terminalstdout import ( - "go.bytecodealliance.org/cm" terminaloutput "http-password-checker/gen/wasi/cli/terminal-output" ) @@ -15,10 +14,10 @@ type TerminalOutput = terminaloutput.TerminalOutput // GetTerminalStdout represents the imported function "get-terminal-stdout". // -// get-terminal-stdout: func() -> option +// get-terminal-stdout: func() // //go:nosplit -func GetTerminalStdout() (result cm.Option[TerminalOutput]) { - wasmimport_GetTerminalStdout(&result) +func GetTerminalStdout() { + wasmimport_GetTerminalStdout() return } diff --git a/examples/component/http-password-checker/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go b/examples/component/http-password-checker/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go index fa750ad9..c45db1d2 100755 --- a/examples/component/http-password-checker/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go +++ b/examples/component/http-password-checker/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go @@ -2,12 +2,8 @@ package terminalstdout -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". //go:wasmimport wasi:cli/terminal-stdout@0.2.0 get-terminal-stdout //go:noescape -func wasmimport_GetTerminalStdout(result *cm.Option[TerminalOutput]) +func wasmimport_GetTerminalStdout() diff --git a/examples/component/http-password-checker/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go b/examples/component/http-password-checker/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go index a025569c..0d17e749 100755 --- a/examples/component/http-password-checker/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go +++ b/examples/component/http-password-checker/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go @@ -4,7 +4,6 @@ package monotonicclock import ( - "go.bytecodealliance.org/cm" "http-password-checker/gen/wasi/io/poll" ) @@ -25,46 +24,42 @@ type Duration uint64 // Now represents the imported function "now". // -// now: func() -> instant +// now: func() // //go:nosplit -func Now() (result Instant) { - result0 := wasmimport_Now() - result = (Instant)((uint64)(result0)) +func Now() { + wasmimport_Now() return } // Resolution represents the imported function "resolution". // -// resolution: func() -> duration +// resolution: func() // //go:nosplit -func Resolution() (result Duration) { - result0 := wasmimport_Resolution() - result = (Duration)((uint64)(result0)) +func Resolution() { + wasmimport_Resolution() return } // SubscribeInstant represents the imported function "subscribe-instant". // -// subscribe-instant: func(when: instant) -> pollable +// subscribe-instant: func(when: instant) // //go:nosplit -func SubscribeInstant(when Instant) (result Pollable) { +func SubscribeInstant(when Instant) { when0 := (uint64)(when) - result0 := wasmimport_SubscribeInstant((uint64)(when0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_SubscribeInstant((uint64)(when0)) return } // SubscribeDuration represents the imported function "subscribe-duration". // -// subscribe-duration: func(when: duration) -> pollable +// subscribe-duration: func(when: duration) // //go:nosplit -func SubscribeDuration(when Duration) (result Pollable) { +func SubscribeDuration(when Duration) { when0 := (uint64)(when) - result0 := wasmimport_SubscribeDuration((uint64)(when0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_SubscribeDuration((uint64)(when0)) return } diff --git a/examples/component/http-password-checker/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go b/examples/component/http-password-checker/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go index 36a1720a..4494c61a 100755 --- a/examples/component/http-password-checker/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go +++ b/examples/component/http-password-checker/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go @@ -6,16 +6,16 @@ package monotonicclock //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 now //go:noescape -func wasmimport_Now() (result0 uint64) +func wasmimport_Now() //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 resolution //go:noescape -func wasmimport_Resolution() (result0 uint64) +func wasmimport_Resolution() //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 subscribe-instant //go:noescape -func wasmimport_SubscribeInstant(when0 uint64) (result0 uint32) +func wasmimport_SubscribeInstant(when0 uint64) //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 subscribe-duration //go:noescape -func wasmimport_SubscribeDuration(when0 uint64) (result0 uint32) +func wasmimport_SubscribeDuration(when0 uint64) diff --git a/examples/component/http-password-checker/gen/wasi/clocks/wall-clock/wall-clock.wit.go b/examples/component/http-password-checker/gen/wasi/clocks/wall-clock/wall-clock.wit.go index e3f35395..308f0910 100755 --- a/examples/component/http-password-checker/gen/wasi/clocks/wall-clock/wall-clock.wit.go +++ b/examples/component/http-password-checker/gen/wasi/clocks/wall-clock/wall-clock.wit.go @@ -21,20 +21,20 @@ type DateTime struct { // Now represents the imported function "now". // -// now: func() -> datetime +// now: func() // //go:nosplit -func Now() (result DateTime) { - wasmimport_Now(&result) +func Now() { + wasmimport_Now() return } // Resolution represents the imported function "resolution". // -// resolution: func() -> datetime +// resolution: func() // //go:nosplit -func Resolution() (result DateTime) { - wasmimport_Resolution(&result) +func Resolution() { + wasmimport_Resolution() return } diff --git a/examples/component/http-password-checker/gen/wasi/clocks/wall-clock/wallclock.wasm.go b/examples/component/http-password-checker/gen/wasi/clocks/wall-clock/wallclock.wasm.go index 321ff3f1..4efbaf84 100755 --- a/examples/component/http-password-checker/gen/wasi/clocks/wall-clock/wallclock.wasm.go +++ b/examples/component/http-password-checker/gen/wasi/clocks/wall-clock/wallclock.wasm.go @@ -6,8 +6,8 @@ package wallclock //go:wasmimport wasi:clocks/wall-clock@0.2.0 now //go:noescape -func wasmimport_Now(result *DateTime) +func wasmimport_Now() //go:wasmimport wasi:clocks/wall-clock@0.2.0 resolution //go:noescape -func wasmimport_Resolution(result *DateTime) +func wasmimport_Resolution() diff --git a/examples/component/http-password-checker/gen/wasi/config/runtime/runtime.wasm.go b/examples/component/http-password-checker/gen/wasi/config/runtime/runtime.wasm.go index 8ce17d5e..4abfb286 100755 --- a/examples/component/http-password-checker/gen/wasi/config/runtime/runtime.wasm.go +++ b/examples/component/http-password-checker/gen/wasi/config/runtime/runtime.wasm.go @@ -2,16 +2,12 @@ package runtime -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:config@0.2.0-draft". //go:wasmimport wasi:config/runtime@0.2.0-draft get //go:noescape -func wasmimport_Get(key0 *uint8, key1 uint32, result *cm.Result[OptionStringShape, cm.Option[string], ConfigError]) +func wasmimport_Get(key0 *uint8, key1 uint32) //go:wasmimport wasi:config/runtime@0.2.0-draft get-all //go:noescape -func wasmimport_GetAll(result *cm.Result[ConfigErrorShape, cm.List[[2]string], ConfigError]) +func wasmimport_GetAll() diff --git a/examples/component/http-password-checker/gen/wasi/config/runtime/runtime.wit.go b/examples/component/http-password-checker/gen/wasi/config/runtime/runtime.wit.go index 99a739d1..204a5c0c 100755 --- a/examples/component/http-password-checker/gen/wasi/config/runtime/runtime.wit.go +++ b/examples/component/http-password-checker/gen/wasi/config/runtime/runtime.wit.go @@ -47,21 +47,21 @@ func (v ConfigError) String() string { // Get represents the imported function "get". // -// get: func(key: string) -> result, config-error> +// get: func(key: string) // //go:nosplit -func Get(key string) (result cm.Result[OptionStringShape, cm.Option[string], ConfigError]) { +func Get(key string) { key0, key1 := cm.LowerString(key) - wasmimport_Get((*uint8)(key0), (uint32)(key1), &result) + wasmimport_Get((*uint8)(key0), (uint32)(key1)) return } // GetAll represents the imported function "get-all". // -// get-all: func() -> result>, config-error> +// get-all: func() // //go:nosplit -func GetAll() (result cm.Result[ConfigErrorShape, cm.List[[2]string], ConfigError]) { - wasmimport_GetAll(&result) +func GetAll() { + wasmimport_GetAll() return } diff --git a/examples/component/http-password-checker/gen/wasi/filesystem/preopens/preopens.wasm.go b/examples/component/http-password-checker/gen/wasi/filesystem/preopens/preopens.wasm.go index 1bcd416a..50885ee0 100755 --- a/examples/component/http-password-checker/gen/wasi/filesystem/preopens/preopens.wasm.go +++ b/examples/component/http-password-checker/gen/wasi/filesystem/preopens/preopens.wasm.go @@ -2,12 +2,8 @@ package preopens -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:filesystem@0.2.0". //go:wasmimport wasi:filesystem/preopens@0.2.0 get-directories //go:noescape -func wasmimport_GetDirectories(result *cm.List[cm.Tuple[Descriptor, string]]) +func wasmimport_GetDirectories() diff --git a/examples/component/http-password-checker/gen/wasi/filesystem/preopens/preopens.wit.go b/examples/component/http-password-checker/gen/wasi/filesystem/preopens/preopens.wit.go index 09196a94..2145be9a 100755 --- a/examples/component/http-password-checker/gen/wasi/filesystem/preopens/preopens.wit.go +++ b/examples/component/http-password-checker/gen/wasi/filesystem/preopens/preopens.wit.go @@ -4,7 +4,6 @@ package preopens import ( - "go.bytecodealliance.org/cm" "http-password-checker/gen/wasi/filesystem/types" ) @@ -15,10 +14,10 @@ type Descriptor = types.Descriptor // GetDirectories represents the imported function "get-directories". // -// get-directories: func() -> list> +// get-directories: func() // //go:nosplit -func GetDirectories() (result cm.List[cm.Tuple[Descriptor, string]]) { - wasmimport_GetDirectories(&result) +func GetDirectories() { + wasmimport_GetDirectories() return } diff --git a/examples/component/http-password-checker/gen/wasi/filesystem/types/abi.go b/examples/component/http-password-checker/gen/wasi/filesystem/types/abi.go index b9f11474..efa146f7 100755 --- a/examples/component/http-password-checker/gen/wasi/filesystem/types/abi.go +++ b/examples/component/http-password-checker/gen/wasi/filesystem/types/abi.go @@ -5,21 +5,8 @@ package types import ( "go.bytecodealliance.org/cm" wallclock "http-password-checker/gen/wasi/clocks/wall-clock" - "unsafe" ) -// MetadataHashValueShape is used for storage in variant or result types. -type MetadataHashValueShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(MetadataHashValue{})]byte -} - -// TupleListU8BoolShape is used for storage in variant or result types. -type TupleListU8BoolShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Tuple[cm.List[uint8], bool]{})]byte -} - func lower_DateTime(v wallclock.DateTime) (f0 uint64, f1 uint32) { f0 = (uint64)(v.Seconds) f1 = (uint32)(v.Nanoseconds) @@ -36,15 +23,3 @@ func lower_NewTimestamp(v NewTimestamp) (f0 uint32, f1 uint64, f2 uint32) { } return } - -// DescriptorStatShape is used for storage in variant or result types. -type DescriptorStatShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(DescriptorStat{})]byte -} - -// OptionDirectoryEntryShape is used for storage in variant or result types. -type OptionDirectoryEntryShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Option[DirectoryEntry]{})]byte -} diff --git a/examples/component/http-password-checker/gen/wasi/filesystem/types/types.wasm.go b/examples/component/http-password-checker/gen/wasi/filesystem/types/types.wasm.go index b97dad84..7a2b9993 100755 --- a/examples/component/http-password-checker/gen/wasi/filesystem/types/types.wasm.go +++ b/examples/component/http-password-checker/gen/wasi/filesystem/types/types.wasm.go @@ -2,10 +2,6 @@ package types -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:filesystem@0.2.0". //go:wasmimport wasi:filesystem/types@0.2.0 [resource-drop]descriptor @@ -14,111 +10,111 @@ func wasmimport_DescriptorResourceDrop(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.advise //go:noescape -func wasmimport_DescriptorAdvise(self0 uint32, offset0 uint64, length0 uint64, advice0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorAdvise(self0 uint32, offset0 uint64, length0 uint64, advice0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.append-via-stream //go:noescape -func wasmimport_DescriptorAppendViaStream(self0 uint32, result *cm.Result[OutputStream, OutputStream, ErrorCode]) +func wasmimport_DescriptorAppendViaStream(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.create-directory-at //go:noescape -func wasmimport_DescriptorCreateDirectoryAt(self0 uint32, path0 *uint8, path1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorCreateDirectoryAt(self0 uint32, path0 *uint8, path1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.get-flags //go:noescape -func wasmimport_DescriptorGetFlags(self0 uint32, result *cm.Result[DescriptorFlags, DescriptorFlags, ErrorCode]) +func wasmimport_DescriptorGetFlags(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.get-type //go:noescape -func wasmimport_DescriptorGetType(self0 uint32, result *cm.Result[DescriptorType, DescriptorType, ErrorCode]) +func wasmimport_DescriptorGetType(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.is-same-object //go:noescape -func wasmimport_DescriptorIsSameObject(self0 uint32, other0 uint32) (result0 uint32) +func wasmimport_DescriptorIsSameObject(self0 uint32, other0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.link-at //go:noescape -func wasmimport_DescriptorLinkAt(self0 uint32, oldPathFlags0 uint32, oldPath0 *uint8, oldPath1 uint32, newDescriptor0 uint32, newPath0 *uint8, newPath1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorLinkAt(self0 uint32, oldPathFlags0 uint32, oldPath0 *uint8, oldPath1 uint32, newDescriptor0 uint32, newPath0 *uint8, newPath1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.metadata-hash //go:noescape -func wasmimport_DescriptorMetadataHash(self0 uint32, result *cm.Result[MetadataHashValueShape, MetadataHashValue, ErrorCode]) +func wasmimport_DescriptorMetadataHash(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.metadata-hash-at //go:noescape -func wasmimport_DescriptorMetadataHashAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, result *cm.Result[MetadataHashValueShape, MetadataHashValue, ErrorCode]) +func wasmimport_DescriptorMetadataHashAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.open-at //go:noescape -func wasmimport_DescriptorOpenAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, openFlags0 uint32, flags0 uint32, result *cm.Result[Descriptor, Descriptor, ErrorCode]) +func wasmimport_DescriptorOpenAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, openFlags0 uint32, flags0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.read //go:noescape -func wasmimport_DescriptorRead(self0 uint32, length0 uint64, offset0 uint64, result *cm.Result[TupleListU8BoolShape, cm.Tuple[cm.List[uint8], bool], ErrorCode]) +func wasmimport_DescriptorRead(self0 uint32, length0 uint64, offset0 uint64) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.read-directory //go:noescape -func wasmimport_DescriptorReadDirectory(self0 uint32, result *cm.Result[DirectoryEntryStream, DirectoryEntryStream, ErrorCode]) +func wasmimport_DescriptorReadDirectory(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.read-via-stream //go:noescape -func wasmimport_DescriptorReadViaStream(self0 uint32, offset0 uint64, result *cm.Result[InputStream, InputStream, ErrorCode]) +func wasmimport_DescriptorReadViaStream(self0 uint32, offset0 uint64) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.readlink-at //go:noescape -func wasmimport_DescriptorReadLinkAt(self0 uint32, path0 *uint8, path1 uint32, result *cm.Result[string, string, ErrorCode]) +func wasmimport_DescriptorReadLinkAt(self0 uint32, path0 *uint8, path1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.remove-directory-at //go:noescape -func wasmimport_DescriptorRemoveDirectoryAt(self0 uint32, path0 *uint8, path1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorRemoveDirectoryAt(self0 uint32, path0 *uint8, path1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.rename-at //go:noescape -func wasmimport_DescriptorRenameAt(self0 uint32, oldPath0 *uint8, oldPath1 uint32, newDescriptor0 uint32, newPath0 *uint8, newPath1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorRenameAt(self0 uint32, oldPath0 *uint8, oldPath1 uint32, newDescriptor0 uint32, newPath0 *uint8, newPath1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.set-size //go:noescape -func wasmimport_DescriptorSetSize(self0 uint32, size0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorSetSize(self0 uint32, size0 uint64) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.set-times //go:noescape -func wasmimport_DescriptorSetTimes(self0 uint32, dataAccessTimestamp0 uint32, dataAccessTimestamp1 uint64, dataAccessTimestamp2 uint32, dataModificationTimestamp0 uint32, dataModificationTimestamp1 uint64, dataModificationTimestamp2 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorSetTimes(self0 uint32, dataAccessTimestamp0 uint32, dataAccessTimestamp1 uint64, dataAccessTimestamp2 uint32, dataModificationTimestamp0 uint32, dataModificationTimestamp1 uint64, dataModificationTimestamp2 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.set-times-at //go:noescape -func wasmimport_DescriptorSetTimesAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, dataAccessTimestamp0 uint32, dataAccessTimestamp1 uint64, dataAccessTimestamp2 uint32, dataModificationTimestamp0 uint32, dataModificationTimestamp1 uint64, dataModificationTimestamp2 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorSetTimesAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, dataAccessTimestamp0 uint32, dataAccessTimestamp1 uint64, dataAccessTimestamp2 uint32, dataModificationTimestamp0 uint32, dataModificationTimestamp1 uint64, dataModificationTimestamp2 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.stat //go:noescape -func wasmimport_DescriptorStat(self0 uint32, result *cm.Result[DescriptorStatShape, DescriptorStat, ErrorCode]) +func wasmimport_DescriptorStat(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.stat-at //go:noescape -func wasmimport_DescriptorStatAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, result *cm.Result[DescriptorStatShape, DescriptorStat, ErrorCode]) +func wasmimport_DescriptorStatAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.symlink-at //go:noescape -func wasmimport_DescriptorSymlinkAt(self0 uint32, oldPath0 *uint8, oldPath1 uint32, newPath0 *uint8, newPath1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorSymlinkAt(self0 uint32, oldPath0 *uint8, oldPath1 uint32, newPath0 *uint8, newPath1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.sync //go:noescape -func wasmimport_DescriptorSync(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorSync(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.sync-data //go:noescape -func wasmimport_DescriptorSyncData(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorSyncData(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.unlink-file-at //go:noescape -func wasmimport_DescriptorUnlinkFileAt(self0 uint32, path0 *uint8, path1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorUnlinkFileAt(self0 uint32, path0 *uint8, path1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.write //go:noescape -func wasmimport_DescriptorWrite(self0 uint32, buffer0 *uint8, buffer1 uint32, offset0 uint64, result *cm.Result[uint64, FileSize, ErrorCode]) +func wasmimport_DescriptorWrite(self0 uint32, buffer0 *uint8, buffer1 uint32, offset0 uint64) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.write-via-stream //go:noescape -func wasmimport_DescriptorWriteViaStream(self0 uint32, offset0 uint64, result *cm.Result[OutputStream, OutputStream, ErrorCode]) +func wasmimport_DescriptorWriteViaStream(self0 uint32, offset0 uint64) //go:wasmimport wasi:filesystem/types@0.2.0 [resource-drop]directory-entry-stream //go:noescape @@ -126,8 +122,8 @@ func wasmimport_DirectoryEntryStreamResourceDrop(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]directory-entry-stream.read-directory-entry //go:noescape -func wasmimport_DirectoryEntryStreamReadDirectoryEntry(self0 uint32, result *cm.Result[OptionDirectoryEntryShape, cm.Option[DirectoryEntry], ErrorCode]) +func wasmimport_DirectoryEntryStreamReadDirectoryEntry(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 filesystem-error-code //go:noescape -func wasmimport_FilesystemErrorCode(err0 uint32, result *cm.Option[ErrorCode]) +func wasmimport_FilesystemErrorCode(err0 uint32) diff --git a/examples/component/http-password-checker/gen/wasi/filesystem/types/types.wit.go b/examples/component/http-password-checker/gen/wasi/filesystem/types/types.wit.go index dca02531..c61191ef 100755 --- a/examples/component/http-password-checker/gen/wasi/filesystem/types/types.wit.go +++ b/examples/component/http-password-checker/gen/wasi/filesystem/types/types.wit.go @@ -406,345 +406,341 @@ func (self Descriptor) ResourceDrop() { // Advise represents the imported method "advise". // -// advise: func(offset: filesize, length: filesize, advice: advice) -> result<_, error-code> +// advise: func(offset: filesize, length: filesize, advice: advice) // //go:nosplit -func (self Descriptor) Advise(offset FileSize, length FileSize, advice Advice) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) Advise(offset FileSize, length FileSize, advice Advice) { self0 := cm.Reinterpret[uint32](self) offset0 := (uint64)(offset) length0 := (uint64)(length) advice0 := (uint32)(advice) - wasmimport_DescriptorAdvise((uint32)(self0), (uint64)(offset0), (uint64)(length0), (uint32)(advice0), &result) + wasmimport_DescriptorAdvise((uint32)(self0), (uint64)(offset0), (uint64)(length0), (uint32)(advice0)) return } // AppendViaStream represents the imported method "append-via-stream". // -// append-via-stream: func() -> result +// append-via-stream: func() // //go:nosplit -func (self Descriptor) AppendViaStream() (result cm.Result[OutputStream, OutputStream, ErrorCode]) { +func (self Descriptor) AppendViaStream() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorAppendViaStream((uint32)(self0), &result) + wasmimport_DescriptorAppendViaStream((uint32)(self0)) return } // CreateDirectoryAt represents the imported method "create-directory-at". // -// create-directory-at: func(path: string) -> result<_, error-code> +// create-directory-at: func(path: string) // //go:nosplit -func (self Descriptor) CreateDirectoryAt(path string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) CreateDirectoryAt(path string) { self0 := cm.Reinterpret[uint32](self) path0, path1 := cm.LowerString(path) - wasmimport_DescriptorCreateDirectoryAt((uint32)(self0), (*uint8)(path0), (uint32)(path1), &result) + wasmimport_DescriptorCreateDirectoryAt((uint32)(self0), (*uint8)(path0), (uint32)(path1)) return } // GetFlags represents the imported method "get-flags". // -// get-flags: func() -> result +// get-flags: func() // //go:nosplit -func (self Descriptor) GetFlags() (result cm.Result[DescriptorFlags, DescriptorFlags, ErrorCode]) { +func (self Descriptor) GetFlags() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorGetFlags((uint32)(self0), &result) + wasmimport_DescriptorGetFlags((uint32)(self0)) return } // GetType represents the imported method "get-type". // -// get-type: func() -> result +// get-type: func() // //go:nosplit -func (self Descriptor) GetType() (result cm.Result[DescriptorType, DescriptorType, ErrorCode]) { +func (self Descriptor) GetType() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorGetType((uint32)(self0), &result) + wasmimport_DescriptorGetType((uint32)(self0)) return } // IsSameObject represents the imported method "is-same-object". // -// is-same-object: func(other: borrow) -> bool +// is-same-object: func(other: borrow) // //go:nosplit -func (self Descriptor) IsSameObject(other Descriptor) (result bool) { +func (self Descriptor) IsSameObject(other Descriptor) { self0 := cm.Reinterpret[uint32](self) other0 := cm.Reinterpret[uint32](other) - result0 := wasmimport_DescriptorIsSameObject((uint32)(self0), (uint32)(other0)) - result = (bool)(cm.U32ToBool((uint32)(result0))) + wasmimport_DescriptorIsSameObject((uint32)(self0), (uint32)(other0)) return } // LinkAt represents the imported method "link-at". // // link-at: func(old-path-flags: path-flags, old-path: string, new-descriptor: borrow, -// new-path: string) -> result<_, error-code> +// new-path: string) // //go:nosplit -func (self Descriptor) LinkAt(oldPathFlags PathFlags, oldPath string, newDescriptor Descriptor, newPath string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) LinkAt(oldPathFlags PathFlags, oldPath string, newDescriptor Descriptor, newPath string) { self0 := cm.Reinterpret[uint32](self) oldPathFlags0 := (uint32)(oldPathFlags) oldPath0, oldPath1 := cm.LowerString(oldPath) newDescriptor0 := cm.Reinterpret[uint32](newDescriptor) newPath0, newPath1 := cm.LowerString(newPath) - wasmimport_DescriptorLinkAt((uint32)(self0), (uint32)(oldPathFlags0), (*uint8)(oldPath0), (uint32)(oldPath1), (uint32)(newDescriptor0), (*uint8)(newPath0), (uint32)(newPath1), &result) + wasmimport_DescriptorLinkAt((uint32)(self0), (uint32)(oldPathFlags0), (*uint8)(oldPath0), (uint32)(oldPath1), (uint32)(newDescriptor0), (*uint8)(newPath0), (uint32)(newPath1)) return } // MetadataHash represents the imported method "metadata-hash". // -// metadata-hash: func() -> result +// metadata-hash: func() // //go:nosplit -func (self Descriptor) MetadataHash() (result cm.Result[MetadataHashValueShape, MetadataHashValue, ErrorCode]) { +func (self Descriptor) MetadataHash() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorMetadataHash((uint32)(self0), &result) + wasmimport_DescriptorMetadataHash((uint32)(self0)) return } // MetadataHashAt represents the imported method "metadata-hash-at". // -// metadata-hash-at: func(path-flags: path-flags, path: string) -> result +// metadata-hash-at: func(path-flags: path-flags, path: string) // //go:nosplit -func (self Descriptor) MetadataHashAt(pathFlags PathFlags, path string) (result cm.Result[MetadataHashValueShape, MetadataHashValue, ErrorCode]) { +func (self Descriptor) MetadataHashAt(pathFlags PathFlags, path string) { self0 := cm.Reinterpret[uint32](self) pathFlags0 := (uint32)(pathFlags) path0, path1 := cm.LowerString(path) - wasmimport_DescriptorMetadataHashAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), &result) + wasmimport_DescriptorMetadataHashAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1)) return } // OpenAt represents the imported method "open-at". // // open-at: func(path-flags: path-flags, path: string, open-flags: open-flags, %flags: -// descriptor-flags) -> result +// descriptor-flags) // //go:nosplit -func (self Descriptor) OpenAt(pathFlags PathFlags, path string, openFlags OpenFlags, flags DescriptorFlags) (result cm.Result[Descriptor, Descriptor, ErrorCode]) { +func (self Descriptor) OpenAt(pathFlags PathFlags, path string, openFlags OpenFlags, flags DescriptorFlags) { self0 := cm.Reinterpret[uint32](self) pathFlags0 := (uint32)(pathFlags) path0, path1 := cm.LowerString(path) openFlags0 := (uint32)(openFlags) flags0 := (uint32)(flags) - wasmimport_DescriptorOpenAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), (uint32)(openFlags0), (uint32)(flags0), &result) + wasmimport_DescriptorOpenAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), (uint32)(openFlags0), (uint32)(flags0)) return } // Read represents the imported method "read". // -// read: func(length: filesize, offset: filesize) -> result, bool>, -// error-code> +// read: func(length: filesize, offset: filesize) // //go:nosplit -func (self Descriptor) Read(length FileSize, offset FileSize) (result cm.Result[TupleListU8BoolShape, cm.Tuple[cm.List[uint8], bool], ErrorCode]) { +func (self Descriptor) Read(length FileSize, offset FileSize) { self0 := cm.Reinterpret[uint32](self) length0 := (uint64)(length) offset0 := (uint64)(offset) - wasmimport_DescriptorRead((uint32)(self0), (uint64)(length0), (uint64)(offset0), &result) + wasmimport_DescriptorRead((uint32)(self0), (uint64)(length0), (uint64)(offset0)) return } // ReadDirectory represents the imported method "read-directory". // -// read-directory: func() -> result +// read-directory: func() // //go:nosplit -func (self Descriptor) ReadDirectory() (result cm.Result[DirectoryEntryStream, DirectoryEntryStream, ErrorCode]) { +func (self Descriptor) ReadDirectory() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorReadDirectory((uint32)(self0), &result) + wasmimport_DescriptorReadDirectory((uint32)(self0)) return } // ReadViaStream represents the imported method "read-via-stream". // -// read-via-stream: func(offset: filesize) -> result +// read-via-stream: func(offset: filesize) // //go:nosplit -func (self Descriptor) ReadViaStream(offset FileSize) (result cm.Result[InputStream, InputStream, ErrorCode]) { +func (self Descriptor) ReadViaStream(offset FileSize) { self0 := cm.Reinterpret[uint32](self) offset0 := (uint64)(offset) - wasmimport_DescriptorReadViaStream((uint32)(self0), (uint64)(offset0), &result) + wasmimport_DescriptorReadViaStream((uint32)(self0), (uint64)(offset0)) return } // ReadLinkAt represents the imported method "readlink-at". // -// readlink-at: func(path: string) -> result +// readlink-at: func(path: string) // //go:nosplit -func (self Descriptor) ReadLinkAt(path string) (result cm.Result[string, string, ErrorCode]) { +func (self Descriptor) ReadLinkAt(path string) { self0 := cm.Reinterpret[uint32](self) path0, path1 := cm.LowerString(path) - wasmimport_DescriptorReadLinkAt((uint32)(self0), (*uint8)(path0), (uint32)(path1), &result) + wasmimport_DescriptorReadLinkAt((uint32)(self0), (*uint8)(path0), (uint32)(path1)) return } // RemoveDirectoryAt represents the imported method "remove-directory-at". // -// remove-directory-at: func(path: string) -> result<_, error-code> +// remove-directory-at: func(path: string) // //go:nosplit -func (self Descriptor) RemoveDirectoryAt(path string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) RemoveDirectoryAt(path string) { self0 := cm.Reinterpret[uint32](self) path0, path1 := cm.LowerString(path) - wasmimport_DescriptorRemoveDirectoryAt((uint32)(self0), (*uint8)(path0), (uint32)(path1), &result) + wasmimport_DescriptorRemoveDirectoryAt((uint32)(self0), (*uint8)(path0), (uint32)(path1)) return } // RenameAt represents the imported method "rename-at". // // rename-at: func(old-path: string, new-descriptor: borrow, new-path: -// string) -> result<_, error-code> +// string) // //go:nosplit -func (self Descriptor) RenameAt(oldPath string, newDescriptor Descriptor, newPath string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) RenameAt(oldPath string, newDescriptor Descriptor, newPath string) { self0 := cm.Reinterpret[uint32](self) oldPath0, oldPath1 := cm.LowerString(oldPath) newDescriptor0 := cm.Reinterpret[uint32](newDescriptor) newPath0, newPath1 := cm.LowerString(newPath) - wasmimport_DescriptorRenameAt((uint32)(self0), (*uint8)(oldPath0), (uint32)(oldPath1), (uint32)(newDescriptor0), (*uint8)(newPath0), (uint32)(newPath1), &result) + wasmimport_DescriptorRenameAt((uint32)(self0), (*uint8)(oldPath0), (uint32)(oldPath1), (uint32)(newDescriptor0), (*uint8)(newPath0), (uint32)(newPath1)) return } // SetSize represents the imported method "set-size". // -// set-size: func(size: filesize) -> result<_, error-code> +// set-size: func(size: filesize) // //go:nosplit -func (self Descriptor) SetSize(size FileSize) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) SetSize(size FileSize) { self0 := cm.Reinterpret[uint32](self) size0 := (uint64)(size) - wasmimport_DescriptorSetSize((uint32)(self0), (uint64)(size0), &result) + wasmimport_DescriptorSetSize((uint32)(self0), (uint64)(size0)) return } // SetTimes represents the imported method "set-times". // // set-times: func(data-access-timestamp: new-timestamp, data-modification-timestamp: -// new-timestamp) -> result<_, error-code> +// new-timestamp) // //go:nosplit -func (self Descriptor) SetTimes(dataAccessTimestamp NewTimestamp, dataModificationTimestamp NewTimestamp) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) SetTimes(dataAccessTimestamp NewTimestamp, dataModificationTimestamp NewTimestamp) { self0 := cm.Reinterpret[uint32](self) dataAccessTimestamp0, dataAccessTimestamp1, dataAccessTimestamp2 := lower_NewTimestamp(dataAccessTimestamp) dataModificationTimestamp0, dataModificationTimestamp1, dataModificationTimestamp2 := lower_NewTimestamp(dataModificationTimestamp) - wasmimport_DescriptorSetTimes((uint32)(self0), (uint32)(dataAccessTimestamp0), (uint64)(dataAccessTimestamp1), (uint32)(dataAccessTimestamp2), (uint32)(dataModificationTimestamp0), (uint64)(dataModificationTimestamp1), (uint32)(dataModificationTimestamp2), &result) + wasmimport_DescriptorSetTimes((uint32)(self0), (uint32)(dataAccessTimestamp0), (uint64)(dataAccessTimestamp1), (uint32)(dataAccessTimestamp2), (uint32)(dataModificationTimestamp0), (uint64)(dataModificationTimestamp1), (uint32)(dataModificationTimestamp2)) return } // SetTimesAt represents the imported method "set-times-at". // // set-times-at: func(path-flags: path-flags, path: string, data-access-timestamp: -// new-timestamp, data-modification-timestamp: new-timestamp) -> result<_, error-code> +// new-timestamp, data-modification-timestamp: new-timestamp) // //go:nosplit -func (self Descriptor) SetTimesAt(pathFlags PathFlags, path string, dataAccessTimestamp NewTimestamp, dataModificationTimestamp NewTimestamp) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) SetTimesAt(pathFlags PathFlags, path string, dataAccessTimestamp NewTimestamp, dataModificationTimestamp NewTimestamp) { self0 := cm.Reinterpret[uint32](self) pathFlags0 := (uint32)(pathFlags) path0, path1 := cm.LowerString(path) dataAccessTimestamp0, dataAccessTimestamp1, dataAccessTimestamp2 := lower_NewTimestamp(dataAccessTimestamp) dataModificationTimestamp0, dataModificationTimestamp1, dataModificationTimestamp2 := lower_NewTimestamp(dataModificationTimestamp) - wasmimport_DescriptorSetTimesAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), (uint32)(dataAccessTimestamp0), (uint64)(dataAccessTimestamp1), (uint32)(dataAccessTimestamp2), (uint32)(dataModificationTimestamp0), (uint64)(dataModificationTimestamp1), (uint32)(dataModificationTimestamp2), &result) + wasmimport_DescriptorSetTimesAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), (uint32)(dataAccessTimestamp0), (uint64)(dataAccessTimestamp1), (uint32)(dataAccessTimestamp2), (uint32)(dataModificationTimestamp0), (uint64)(dataModificationTimestamp1), (uint32)(dataModificationTimestamp2)) return } // Stat represents the imported method "stat". // -// stat: func() -> result +// stat: func() // //go:nosplit -func (self Descriptor) Stat() (result cm.Result[DescriptorStatShape, DescriptorStat, ErrorCode]) { +func (self Descriptor) Stat() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorStat((uint32)(self0), &result) + wasmimport_DescriptorStat((uint32)(self0)) return } // StatAt represents the imported method "stat-at". // -// stat-at: func(path-flags: path-flags, path: string) -> result +// stat-at: func(path-flags: path-flags, path: string) // //go:nosplit -func (self Descriptor) StatAt(pathFlags PathFlags, path string) (result cm.Result[DescriptorStatShape, DescriptorStat, ErrorCode]) { +func (self Descriptor) StatAt(pathFlags PathFlags, path string) { self0 := cm.Reinterpret[uint32](self) pathFlags0 := (uint32)(pathFlags) path0, path1 := cm.LowerString(path) - wasmimport_DescriptorStatAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), &result) + wasmimport_DescriptorStatAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1)) return } // SymlinkAt represents the imported method "symlink-at". // -// symlink-at: func(old-path: string, new-path: string) -> result<_, error-code> +// symlink-at: func(old-path: string, new-path: string) // //go:nosplit -func (self Descriptor) SymlinkAt(oldPath string, newPath string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) SymlinkAt(oldPath string, newPath string) { self0 := cm.Reinterpret[uint32](self) oldPath0, oldPath1 := cm.LowerString(oldPath) newPath0, newPath1 := cm.LowerString(newPath) - wasmimport_DescriptorSymlinkAt((uint32)(self0), (*uint8)(oldPath0), (uint32)(oldPath1), (*uint8)(newPath0), (uint32)(newPath1), &result) + wasmimport_DescriptorSymlinkAt((uint32)(self0), (*uint8)(oldPath0), (uint32)(oldPath1), (*uint8)(newPath0), (uint32)(newPath1)) return } // Sync represents the imported method "sync". // -// sync: func() -> result<_, error-code> +// sync: func() // //go:nosplit -func (self Descriptor) Sync() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) Sync() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorSync((uint32)(self0), &result) + wasmimport_DescriptorSync((uint32)(self0)) return } // SyncData represents the imported method "sync-data". // -// sync-data: func() -> result<_, error-code> +// sync-data: func() // //go:nosplit -func (self Descriptor) SyncData() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) SyncData() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorSyncData((uint32)(self0), &result) + wasmimport_DescriptorSyncData((uint32)(self0)) return } // UnlinkFileAt represents the imported method "unlink-file-at". // -// unlink-file-at: func(path: string) -> result<_, error-code> +// unlink-file-at: func(path: string) // //go:nosplit -func (self Descriptor) UnlinkFileAt(path string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) UnlinkFileAt(path string) { self0 := cm.Reinterpret[uint32](self) path0, path1 := cm.LowerString(path) - wasmimport_DescriptorUnlinkFileAt((uint32)(self0), (*uint8)(path0), (uint32)(path1), &result) + wasmimport_DescriptorUnlinkFileAt((uint32)(self0), (*uint8)(path0), (uint32)(path1)) return } // Write represents the imported method "write". // -// write: func(buffer: list, offset: filesize) -> result +// write: func(buffer: list, offset: filesize) // //go:nosplit -func (self Descriptor) Write(buffer cm.List[uint8], offset FileSize) (result cm.Result[uint64, FileSize, ErrorCode]) { +func (self Descriptor) Write(buffer cm.List[uint8], offset FileSize) { self0 := cm.Reinterpret[uint32](self) buffer0, buffer1 := cm.LowerList(buffer) offset0 := (uint64)(offset) - wasmimport_DescriptorWrite((uint32)(self0), (*uint8)(buffer0), (uint32)(buffer1), (uint64)(offset0), &result) + wasmimport_DescriptorWrite((uint32)(self0), (*uint8)(buffer0), (uint32)(buffer1), (uint64)(offset0)) return } // WriteViaStream represents the imported method "write-via-stream". // -// write-via-stream: func(offset: filesize) -> result +// write-via-stream: func(offset: filesize) // //go:nosplit -func (self Descriptor) WriteViaStream(offset FileSize) (result cm.Result[OutputStream, OutputStream, ErrorCode]) { +func (self Descriptor) WriteViaStream(offset FileSize) { self0 := cm.Reinterpret[uint32](self) offset0 := (uint64)(offset) - wasmimport_DescriptorWriteViaStream((uint32)(self0), (uint64)(offset0), &result) + wasmimport_DescriptorWriteViaStream((uint32)(self0), (uint64)(offset0)) return } @@ -766,22 +762,22 @@ func (self DirectoryEntryStream) ResourceDrop() { // ReadDirectoryEntry represents the imported method "read-directory-entry". // -// read-directory-entry: func() -> result, error-code> +// read-directory-entry: func() // //go:nosplit -func (self DirectoryEntryStream) ReadDirectoryEntry() (result cm.Result[OptionDirectoryEntryShape, cm.Option[DirectoryEntry], ErrorCode]) { +func (self DirectoryEntryStream) ReadDirectoryEntry() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DirectoryEntryStreamReadDirectoryEntry((uint32)(self0), &result) + wasmimport_DirectoryEntryStreamReadDirectoryEntry((uint32)(self0)) return } // FilesystemErrorCode represents the imported function "filesystem-error-code". // -// filesystem-error-code: func(err: borrow) -> option +// filesystem-error-code: func(err: borrow) // //go:nosplit -func FilesystemErrorCode(err Error) (result cm.Option[ErrorCode]) { +func FilesystemErrorCode(err Error) { err0 := cm.Reinterpret[uint32](err) - wasmimport_FilesystemErrorCode((uint32)(err0), &result) + wasmimport_FilesystemErrorCode((uint32)(err0)) return } diff --git a/examples/component/http-password-checker/gen/wasi/http/outgoing-handler/abi.go b/examples/component/http-password-checker/gen/wasi/http/outgoing-handler/abi.go index e1caaac9..5c6a7b48 100755 --- a/examples/component/http-password-checker/gen/wasi/http/outgoing-handler/abi.go +++ b/examples/component/http-password-checker/gen/wasi/http/outgoing-handler/abi.go @@ -4,16 +4,8 @@ package outgoinghandler import ( "go.bytecodealliance.org/cm" - "http-password-checker/gen/wasi/http/types" - "unsafe" ) -// ErrorCodeShape is used for storage in variant or result types. -type ErrorCodeShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(types.ErrorCode{})]byte -} - func lower_OptionRequestOptions(v cm.Option[RequestOptions]) (f0 uint32, f1 uint32) { some := v.Some() if some != nil { diff --git a/examples/component/http-password-checker/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go b/examples/component/http-password-checker/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go index abbd77d9..facb69b2 100755 --- a/examples/component/http-password-checker/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go +++ b/examples/component/http-password-checker/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go @@ -44,13 +44,12 @@ type ErrorCode = types.ErrorCode // or not allowed to be made. Otherwise, protocol errors are reported // through the `future-incoming-response`. // -// handle: func(request: outgoing-request, options: option) -> result +// handle: func(request: outgoing-request, options: option) // //go:nosplit -func Handle(request OutgoingRequest, options cm.Option[RequestOptions]) (result cm.Result[ErrorCodeShape, FutureIncomingResponse, ErrorCode]) { +func Handle(request OutgoingRequest, options cm.Option[RequestOptions]) { request0 := cm.Reinterpret[uint32](request) options0, options1 := lower_OptionRequestOptions(options) - wasmimport_Handle((uint32)(request0), (uint32)(options0), (uint32)(options1), &result) + wasmimport_Handle((uint32)(request0), (uint32)(options0), (uint32)(options1)) return } diff --git a/examples/component/http-password-checker/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go b/examples/component/http-password-checker/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go index 6b3f3828..1f362c2a 100755 --- a/examples/component/http-password-checker/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go +++ b/examples/component/http-password-checker/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go @@ -2,12 +2,8 @@ package outgoinghandler -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:http@0.2.0". //go:wasmimport wasi:http/outgoing-handler@0.2.0 handle //go:noescape -func wasmimport_Handle(request0 uint32, options0 uint32, options1 uint32, result *cm.Result[ErrorCodeShape, FutureIncomingResponse, ErrorCode]) +func wasmimport_Handle(request0 uint32, options0 uint32, options1 uint32) diff --git a/examples/component/http-password-checker/gen/wasi/http/types/types.wasm.go b/examples/component/http-password-checker/gen/wasi/http/types/types.wasm.go index b025b2af..584e55ae 100755 --- a/examples/component/http-password-checker/gen/wasi/http/types/types.wasm.go +++ b/examples/component/http-password-checker/gen/wasi/http/types/types.wasm.go @@ -14,39 +14,39 @@ func wasmimport_FieldsResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [constructor]fields //go:noescape -func wasmimport_NewFields() (result0 uint32) +func wasmimport_NewFields() //go:wasmimport wasi:http/types@0.2.0 [static]fields.from-list //go:noescape -func wasmimport_FieldsFromList(entries0 *cm.Tuple[FieldKey, FieldValue], entries1 uint32, result *cm.Result[Fields, Fields, HeaderError]) +func wasmimport_FieldsFromList(entries0 *cm.Tuple[FieldKey, FieldValue], entries1 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]fields.append //go:noescape -func wasmimport_FieldsAppend(self0 uint32, name0 *uint8, name1 uint32, value0 *uint8, value1 uint32, result *cm.Result[HeaderError, struct{}, HeaderError]) +func wasmimport_FieldsAppend(self0 uint32, name0 *uint8, name1 uint32, value0 *uint8, value1 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]fields.clone //go:noescape -func wasmimport_FieldsClone(self0 uint32) (result0 uint32) +func wasmimport_FieldsClone(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]fields.delete //go:noescape -func wasmimport_FieldsDelete(self0 uint32, name0 *uint8, name1 uint32, result *cm.Result[HeaderError, struct{}, HeaderError]) +func wasmimport_FieldsDelete(self0 uint32, name0 *uint8, name1 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]fields.entries //go:noescape -func wasmimport_FieldsEntries(self0 uint32, result *cm.List[cm.Tuple[FieldKey, FieldValue]]) +func wasmimport_FieldsEntries(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]fields.get //go:noescape -func wasmimport_FieldsGet(self0 uint32, name0 *uint8, name1 uint32, result *cm.List[FieldValue]) +func wasmimport_FieldsGet(self0 uint32, name0 *uint8, name1 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]fields.has //go:noescape -func wasmimport_FieldsHas(self0 uint32, name0 *uint8, name1 uint32) (result0 uint32) +func wasmimport_FieldsHas(self0 uint32, name0 *uint8, name1 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]fields.set //go:noescape -func wasmimport_FieldsSet(self0 uint32, name0 *uint8, name1 uint32, value0 *FieldValue, value1 uint32, result *cm.Result[HeaderError, struct{}, HeaderError]) +func wasmimport_FieldsSet(self0 uint32, name0 *uint8, name1 uint32, value0 *FieldValue, value1 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]incoming-request //go:noescape @@ -54,27 +54,27 @@ func wasmimport_IncomingRequestResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.authority //go:noescape -func wasmimport_IncomingRequestAuthority(self0 uint32, result *cm.Option[string]) +func wasmimport_IncomingRequestAuthority(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.consume //go:noescape -func wasmimport_IncomingRequestConsume(self0 uint32, result *cm.Result[IncomingBody, IncomingBody, struct{}]) +func wasmimport_IncomingRequestConsume(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.headers //go:noescape -func wasmimport_IncomingRequestHeaders(self0 uint32) (result0 uint32) +func wasmimport_IncomingRequestHeaders(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.method //go:noescape -func wasmimport_IncomingRequestMethod(self0 uint32, result *Method) +func wasmimport_IncomingRequestMethod(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.path-with-query //go:noescape -func wasmimport_IncomingRequestPathWithQuery(self0 uint32, result *cm.Option[string]) +func wasmimport_IncomingRequestPathWithQuery(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.scheme //go:noescape -func wasmimport_IncomingRequestScheme(self0 uint32, result *cm.Option[Scheme]) +func wasmimport_IncomingRequestScheme(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]outgoing-request //go:noescape @@ -82,47 +82,47 @@ func wasmimport_OutgoingRequestResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [constructor]outgoing-request //go:noescape -func wasmimport_NewOutgoingRequest(headers0 uint32) (result0 uint32) +func wasmimport_NewOutgoingRequest(headers0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.authority //go:noescape -func wasmimport_OutgoingRequestAuthority(self0 uint32, result *cm.Option[string]) +func wasmimport_OutgoingRequestAuthority(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.body //go:noescape -func wasmimport_OutgoingRequestBody(self0 uint32, result *cm.Result[OutgoingBody, OutgoingBody, struct{}]) +func wasmimport_OutgoingRequestBody(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.headers //go:noescape -func wasmimport_OutgoingRequestHeaders(self0 uint32) (result0 uint32) +func wasmimport_OutgoingRequestHeaders(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.method //go:noescape -func wasmimport_OutgoingRequestMethod(self0 uint32, result *Method) +func wasmimport_OutgoingRequestMethod(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.path-with-query //go:noescape -func wasmimport_OutgoingRequestPathWithQuery(self0 uint32, result *cm.Option[string]) +func wasmimport_OutgoingRequestPathWithQuery(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.scheme //go:noescape -func wasmimport_OutgoingRequestScheme(self0 uint32, result *cm.Option[Scheme]) +func wasmimport_OutgoingRequestScheme(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-authority //go:noescape -func wasmimport_OutgoingRequestSetAuthority(self0 uint32, authority0 uint32, authority1 *uint8, authority2 uint32) (result0 uint32) +func wasmimport_OutgoingRequestSetAuthority(self0 uint32, authority0 uint32, authority1 *uint8, authority2 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-method //go:noescape -func wasmimport_OutgoingRequestSetMethod(self0 uint32, method0 uint32, method1 *uint8, method2 uint32) (result0 uint32) +func wasmimport_OutgoingRequestSetMethod(self0 uint32, method0 uint32, method1 *uint8, method2 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-path-with-query //go:noescape -func wasmimport_OutgoingRequestSetPathWithQuery(self0 uint32, pathWithQuery0 uint32, pathWithQuery1 *uint8, pathWithQuery2 uint32) (result0 uint32) +func wasmimport_OutgoingRequestSetPathWithQuery(self0 uint32, pathWithQuery0 uint32, pathWithQuery1 *uint8, pathWithQuery2 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-scheme //go:noescape -func wasmimport_OutgoingRequestSetScheme(self0 uint32, scheme0 uint32, scheme1 uint32, scheme2 *uint8, scheme3 uint32) (result0 uint32) +func wasmimport_OutgoingRequestSetScheme(self0 uint32, scheme0 uint32, scheme1 uint32, scheme2 *uint8, scheme3 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]request-options //go:noescape @@ -130,31 +130,31 @@ func wasmimport_RequestOptionsResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [constructor]request-options //go:noescape -func wasmimport_NewRequestOptions() (result0 uint32) +func wasmimport_NewRequestOptions() //go:wasmimport wasi:http/types@0.2.0 [method]request-options.between-bytes-timeout //go:noescape -func wasmimport_RequestOptionsBetweenBytesTimeout(self0 uint32, result *cm.Option[Duration]) +func wasmimport_RequestOptionsBetweenBytesTimeout(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]request-options.connect-timeout //go:noescape -func wasmimport_RequestOptionsConnectTimeout(self0 uint32, result *cm.Option[Duration]) +func wasmimport_RequestOptionsConnectTimeout(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]request-options.first-byte-timeout //go:noescape -func wasmimport_RequestOptionsFirstByteTimeout(self0 uint32, result *cm.Option[Duration]) +func wasmimport_RequestOptionsFirstByteTimeout(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]request-options.set-between-bytes-timeout //go:noescape -func wasmimport_RequestOptionsSetBetweenBytesTimeout(self0 uint32, duration0 uint32, duration1 uint64) (result0 uint32) +func wasmimport_RequestOptionsSetBetweenBytesTimeout(self0 uint32, duration0 uint32, duration1 uint64) //go:wasmimport wasi:http/types@0.2.0 [method]request-options.set-connect-timeout //go:noescape -func wasmimport_RequestOptionsSetConnectTimeout(self0 uint32, duration0 uint32, duration1 uint64) (result0 uint32) +func wasmimport_RequestOptionsSetConnectTimeout(self0 uint32, duration0 uint32, duration1 uint64) //go:wasmimport wasi:http/types@0.2.0 [method]request-options.set-first-byte-timeout //go:noescape -func wasmimport_RequestOptionsSetFirstByteTimeout(self0 uint32, duration0 uint32, duration1 uint64) (result0 uint32) +func wasmimport_RequestOptionsSetFirstByteTimeout(self0 uint32, duration0 uint32, duration1 uint64) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]response-outparam //go:noescape @@ -170,15 +170,15 @@ func wasmimport_IncomingResponseResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-response.consume //go:noescape -func wasmimport_IncomingResponseConsume(self0 uint32, result *cm.Result[IncomingBody, IncomingBody, struct{}]) +func wasmimport_IncomingResponseConsume(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-response.headers //go:noescape -func wasmimport_IncomingResponseHeaders(self0 uint32) (result0 uint32) +func wasmimport_IncomingResponseHeaders(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-response.status //go:noescape -func wasmimport_IncomingResponseStatus(self0 uint32) (result0 uint32) +func wasmimport_IncomingResponseStatus(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]incoming-body //go:noescape @@ -186,11 +186,11 @@ func wasmimport_IncomingBodyResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [static]incoming-body.finish //go:noescape -func wasmimport_IncomingBodyFinish(this0 uint32) (result0 uint32) +func wasmimport_IncomingBodyFinish(this0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-body.stream //go:noescape -func wasmimport_IncomingBodyStream(self0 uint32, result *cm.Result[InputStream, InputStream, struct{}]) +func wasmimport_IncomingBodyStream(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]future-trailers //go:noescape @@ -198,11 +198,11 @@ func wasmimport_FutureTrailersResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]future-trailers.get //go:noescape -func wasmimport_FutureTrailersGet(self0 uint32, result *cm.Option[cm.Result[cm.Result[ErrorCodeShape, cm.Option[Trailers], ErrorCode], cm.Result[ErrorCodeShape, cm.Option[Trailers], ErrorCode], struct{}]]) +func wasmimport_FutureTrailersGet(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]future-trailers.subscribe //go:noescape -func wasmimport_FutureTrailersSubscribe(self0 uint32) (result0 uint32) +func wasmimport_FutureTrailersSubscribe(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]outgoing-response //go:noescape @@ -210,23 +210,23 @@ func wasmimport_OutgoingResponseResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [constructor]outgoing-response //go:noescape -func wasmimport_NewOutgoingResponse(headers0 uint32) (result0 uint32) +func wasmimport_NewOutgoingResponse(headers0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.body //go:noescape -func wasmimport_OutgoingResponseBody(self0 uint32, result *cm.Result[OutgoingBody, OutgoingBody, struct{}]) +func wasmimport_OutgoingResponseBody(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.headers //go:noescape -func wasmimport_OutgoingResponseHeaders(self0 uint32) (result0 uint32) +func wasmimport_OutgoingResponseHeaders(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.set-status-code //go:noescape -func wasmimport_OutgoingResponseSetStatusCode(self0 uint32, statusCode0 uint32) (result0 uint32) +func wasmimport_OutgoingResponseSetStatusCode(self0 uint32, statusCode0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.status-code //go:noescape -func wasmimport_OutgoingResponseStatusCode(self0 uint32) (result0 uint32) +func wasmimport_OutgoingResponseStatusCode(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]outgoing-body //go:noescape @@ -234,11 +234,11 @@ func wasmimport_OutgoingBodyResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [static]outgoing-body.finish //go:noescape -func wasmimport_OutgoingBodyFinish(this0 uint32, trailers0 uint32, trailers1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_OutgoingBodyFinish(this0 uint32, trailers0 uint32, trailers1 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-body.write //go:noescape -func wasmimport_OutgoingBodyWrite(self0 uint32, result *cm.Result[OutputStream, OutputStream, struct{}]) +func wasmimport_OutgoingBodyWrite(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]future-incoming-response //go:noescape @@ -246,12 +246,12 @@ func wasmimport_FutureIncomingResponseResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]future-incoming-response.get //go:noescape -func wasmimport_FutureIncomingResponseGet(self0 uint32, result *cm.Option[cm.Result[cm.Result[ErrorCodeShape, IncomingResponse, ErrorCode], cm.Result[ErrorCodeShape, IncomingResponse, ErrorCode], struct{}]]) +func wasmimport_FutureIncomingResponseGet(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]future-incoming-response.subscribe //go:noescape -func wasmimport_FutureIncomingResponseSubscribe(self0 uint32) (result0 uint32) +func wasmimport_FutureIncomingResponseSubscribe(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 http-error-code //go:noescape -func wasmimport_HTTPErrorCode(err0 uint32, result *cm.Option[ErrorCode]) +func wasmimport_HTTPErrorCode(err0 uint32) diff --git a/examples/component/http-password-checker/gen/wasi/http/types/types.wit.go b/examples/component/http-password-checker/gen/wasi/http/types/types.wit.go index 3838ee5c..e20e027e 100755 --- a/examples/component/http-password-checker/gen/wasi/http/types/types.wit.go +++ b/examples/component/http-password-checker/gen/wasi/http/types/types.wit.go @@ -886,9 +886,8 @@ func (self Fields) ResourceDrop() { // constructor() // //go:nosplit -func NewFields() (result Fields) { - result0 := wasmimport_NewFields() - result = cm.Reinterpret[Fields]((uint32)(result0)) +func NewFields() { + wasmimport_NewFields() return } @@ -910,13 +909,12 @@ func NewFields() (result Fields) { // An error result will be returned if any header or value was // syntactically invalid, or if a header was forbidden. // -// from-list: static func(entries: list>) -> result +// from-list: static func(entries: list>) // //go:nosplit -func FieldsFromList(entries cm.List[cm.Tuple[FieldKey, FieldValue]]) (result cm.Result[Fields, Fields, HeaderError]) { +func FieldsFromList(entries cm.List[cm.Tuple[FieldKey, FieldValue]]) { entries0, entries1 := cm.LowerList(entries) - wasmimport_FieldsFromList((*cm.Tuple[FieldKey, FieldValue])(entries0), (uint32)(entries1), &result) + wasmimport_FieldsFromList((*cm.Tuple[FieldKey, FieldValue])(entries0), (uint32)(entries1)) return } @@ -927,14 +925,14 @@ func FieldsFromList(entries cm.List[cm.Tuple[FieldKey, FieldValue]]) (result cm. // // Fails with `header-error.immutable` if the `fields` are immutable. // -// append: func(name: field-key, value: field-value) -> result<_, header-error> +// append: func(name: field-key, value: field-value) // //go:nosplit -func (self Fields) Append(name FieldKey, value FieldValue) (result cm.Result[HeaderError, struct{}, HeaderError]) { +func (self Fields) Append(name FieldKey, value FieldValue) { self0 := cm.Reinterpret[uint32](self) name0, name1 := cm.LowerString(name) value0, value1 := cm.LowerList(value) - wasmimport_FieldsAppend((uint32)(self0), (*uint8)(name0), (uint32)(name1), (*uint8)(value0), (uint32)(value1), &result) + wasmimport_FieldsAppend((uint32)(self0), (*uint8)(name0), (uint32)(name1), (*uint8)(value0), (uint32)(value1)) return } @@ -944,13 +942,12 @@ func (self Fields) Append(name FieldKey, value FieldValue) (result cm.Result[Hea // `fields` constructor on the return value of `entries`. The resulting // `fields` is mutable. // -// clone: func() -> fields +// clone: func() // //go:nosplit -func (self Fields) Clone() (result Fields) { +func (self Fields) Clone() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_FieldsClone((uint32)(self0)) - result = cm.Reinterpret[Fields]((uint32)(result0)) + wasmimport_FieldsClone((uint32)(self0)) return } @@ -961,13 +958,13 @@ func (self Fields) Clone() (result Fields) { // // Fails with `header-error.immutable` if the `fields` are immutable. // -// delete: func(name: field-key) -> result<_, header-error> +// delete: func(name: field-key) // //go:nosplit -func (self Fields) Delete(name FieldKey) (result cm.Result[HeaderError, struct{}, HeaderError]) { +func (self Fields) Delete(name FieldKey) { self0 := cm.Reinterpret[uint32](self) name0, name1 := cm.LowerString(name) - wasmimport_FieldsDelete((uint32)(self0), (*uint8)(name0), (uint32)(name1), &result) + wasmimport_FieldsDelete((uint32)(self0), (*uint8)(name0), (uint32)(name1)) return } @@ -980,12 +977,12 @@ func (self Fields) Delete(name FieldKey) (result cm.Result[HeaderError, struct{} // which have multiple values are represented by multiple entries in this // list with the same key. // -// entries: func() -> list> +// entries: func() // //go:nosplit -func (self Fields) Entries() (result cm.List[cm.Tuple[FieldKey, FieldValue]]) { +func (self Fields) Entries() { self0 := cm.Reinterpret[uint32](self) - wasmimport_FieldsEntries((uint32)(self0), &result) + wasmimport_FieldsEntries((uint32)(self0)) return } @@ -996,13 +993,13 @@ func (self Fields) Entries() (result cm.List[cm.Tuple[FieldKey, FieldValue]]) { // present but empty, this is represented by a list with one or more // empty field-values present. // -// get: func(name: field-key) -> list +// get: func(name: field-key) // //go:nosplit -func (self Fields) Get(name FieldKey) (result cm.List[FieldValue]) { +func (self Fields) Get(name FieldKey) { self0 := cm.Reinterpret[uint32](self) name0, name1 := cm.LowerString(name) - wasmimport_FieldsGet((uint32)(self0), (*uint8)(name0), (uint32)(name1), &result) + wasmimport_FieldsGet((uint32)(self0), (*uint8)(name0), (uint32)(name1)) return } @@ -1011,14 +1008,13 @@ func (self Fields) Get(name FieldKey) (result cm.List[FieldValue]) { // Returns `true` when the key is present in this `fields`. If the key is // syntactically invalid, `false` is returned. // -// has: func(name: field-key) -> bool +// has: func(name: field-key) // //go:nosplit -func (self Fields) Has(name FieldKey) (result bool) { +func (self Fields) Has(name FieldKey) { self0 := cm.Reinterpret[uint32](self) name0, name1 := cm.LowerString(name) - result0 := wasmimport_FieldsHas((uint32)(self0), (*uint8)(name0), (uint32)(name1)) - result = (bool)(cm.U32ToBool((uint32)(result0))) + wasmimport_FieldsHas((uint32)(self0), (*uint8)(name0), (uint32)(name1)) return } @@ -1029,14 +1025,14 @@ func (self Fields) Has(name FieldKey) (result bool) { // // Fails with `header-error.immutable` if the `fields` are immutable. // -// set: func(name: field-key, value: list) -> result<_, header-error> +// set: func(name: field-key, value: list) // //go:nosplit -func (self Fields) Set(name FieldKey, value cm.List[FieldValue]) (result cm.Result[HeaderError, struct{}, HeaderError]) { +func (self Fields) Set(name FieldKey, value cm.List[FieldValue]) { self0 := cm.Reinterpret[uint32](self) name0, name1 := cm.LowerString(name) value0, value1 := cm.LowerList(value) - wasmimport_FieldsSet((uint32)(self0), (*uint8)(name0), (uint32)(name1), (*FieldValue)(value0), (uint32)(value1), &result) + wasmimport_FieldsSet((uint32)(self0), (*uint8)(name0), (uint32)(name1), (*FieldValue)(value0), (uint32)(value1)) return } @@ -1072,12 +1068,12 @@ func (self IncomingRequest) ResourceDrop() { // // Returns the authority from the request, if it was present. // -// authority: func() -> option +// authority: func() // //go:nosplit -func (self IncomingRequest) Authority() (result cm.Option[string]) { +func (self IncomingRequest) Authority() { self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestAuthority((uint32)(self0), &result) + wasmimport_IncomingRequestAuthority((uint32)(self0)) return } @@ -1086,12 +1082,12 @@ func (self IncomingRequest) Authority() (result cm.Option[string]) { // Gives the `incoming-body` associated with this request. Will only // return success at most once, and subsequent calls will return error. // -// consume: func() -> result +// consume: func() // //go:nosplit -func (self IncomingRequest) Consume() (result cm.Result[IncomingBody, IncomingBody, struct{}]) { +func (self IncomingRequest) Consume() { self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestConsume((uint32)(self0), &result) + wasmimport_IncomingRequestConsume((uint32)(self0)) return } @@ -1106,13 +1102,12 @@ func (self IncomingRequest) Consume() (result cm.Result[IncomingBody, IncomingBo // the parent `incoming-request` is dropped. Dropping this // `incoming-request` before all children are dropped will trap. // -// headers: func() -> headers +// headers: func() // //go:nosplit -func (self IncomingRequest) Headers() (result Headers) { +func (self IncomingRequest) Headers() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_IncomingRequestHeaders((uint32)(self0)) - result = cm.Reinterpret[Headers]((uint32)(result0)) + wasmimport_IncomingRequestHeaders((uint32)(self0)) return } @@ -1120,12 +1115,12 @@ func (self IncomingRequest) Headers() (result Headers) { // // Returns the method of the incoming request. // -// method: func() -> method +// method: func() // //go:nosplit -func (self IncomingRequest) Method() (result Method) { +func (self IncomingRequest) Method() { self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestMethod((uint32)(self0), &result) + wasmimport_IncomingRequestMethod((uint32)(self0)) return } @@ -1133,12 +1128,12 @@ func (self IncomingRequest) Method() (result Method) { // // Returns the path with query parameters from the request, as a string. // -// path-with-query: func() -> option +// path-with-query: func() // //go:nosplit -func (self IncomingRequest) PathWithQuery() (result cm.Option[string]) { +func (self IncomingRequest) PathWithQuery() { self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestPathWithQuery((uint32)(self0), &result) + wasmimport_IncomingRequestPathWithQuery((uint32)(self0)) return } @@ -1146,12 +1141,12 @@ func (self IncomingRequest) PathWithQuery() (result cm.Option[string]) { // // Returns the protocol scheme from the request. // -// scheme: func() -> option +// scheme: func() // //go:nosplit -func (self IncomingRequest) Scheme() (result cm.Option[Scheme]) { +func (self IncomingRequest) Scheme() { self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestScheme((uint32)(self0), &result) + wasmimport_IncomingRequestScheme((uint32)(self0)) return } @@ -1189,10 +1184,9 @@ func (self OutgoingRequest) ResourceDrop() { // constructor(headers: headers) // //go:nosplit -func NewOutgoingRequest(headers Headers) (result OutgoingRequest) { +func NewOutgoingRequest(headers Headers) { headers0 := cm.Reinterpret[uint32](headers) - result0 := wasmimport_NewOutgoingRequest((uint32)(headers0)) - result = cm.Reinterpret[OutgoingRequest]((uint32)(result0)) + wasmimport_NewOutgoingRequest((uint32)(headers0)) return } @@ -1202,12 +1196,12 @@ func NewOutgoingRequest(headers Headers) (result OutgoingRequest) { // with Related Schemes which do not require an Authority. The HTTP and // HTTPS schemes always require an authority. // -// authority: func() -> option +// authority: func() // //go:nosplit -func (self OutgoingRequest) Authority() (result cm.Option[string]) { +func (self OutgoingRequest) Authority() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestAuthority((uint32)(self0), &result) + wasmimport_OutgoingRequestAuthority((uint32)(self0)) return } @@ -1220,12 +1214,12 @@ func (self OutgoingRequest) Authority() (result cm.Option[string]) { // this `outgoing-request` can be retrieved at most once. Subsequent // calls will return error. // -// body: func() -> result +// body: func() // //go:nosplit -func (self OutgoingRequest) Body() (result cm.Result[OutgoingBody, OutgoingBody, struct{}]) { +func (self OutgoingRequest) Body() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestBody((uint32)(self0), &result) + wasmimport_OutgoingRequestBody((uint32)(self0)) return } @@ -1240,13 +1234,12 @@ func (self OutgoingRequest) Body() (result cm.Result[OutgoingBody, OutgoingBody, // `outgoing-request` is dropped, or its ownership is transfered to // another component by e.g. `outgoing-handler.handle`. // -// headers: func() -> headers +// headers: func() // //go:nosplit -func (self OutgoingRequest) Headers() (result Headers) { +func (self OutgoingRequest) Headers() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutgoingRequestHeaders((uint32)(self0)) - result = cm.Reinterpret[Headers]((uint32)(result0)) + wasmimport_OutgoingRequestHeaders((uint32)(self0)) return } @@ -1254,12 +1247,12 @@ func (self OutgoingRequest) Headers() (result Headers) { // // Get the Method for the Request. // -// method: func() -> method +// method: func() // //go:nosplit -func (self OutgoingRequest) Method() (result Method) { +func (self OutgoingRequest) Method() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestMethod((uint32)(self0), &result) + wasmimport_OutgoingRequestMethod((uint32)(self0)) return } @@ -1268,12 +1261,12 @@ func (self OutgoingRequest) Method() (result Method) { // Get the combination of the HTTP Path and Query for the Request. // When `none`, this represents an empty Path and empty Query. // -// path-with-query: func() -> option +// path-with-query: func() // //go:nosplit -func (self OutgoingRequest) PathWithQuery() (result cm.Option[string]) { +func (self OutgoingRequest) PathWithQuery() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestPathWithQuery((uint32)(self0), &result) + wasmimport_OutgoingRequestPathWithQuery((uint32)(self0)) return } @@ -1282,12 +1275,12 @@ func (self OutgoingRequest) PathWithQuery() (result cm.Option[string]) { // Get the HTTP Related Scheme for the Request. When `none`, the // implementation may choose an appropriate default scheme. // -// scheme: func() -> option +// scheme: func() // //go:nosplit -func (self OutgoingRequest) Scheme() (result cm.Option[Scheme]) { +func (self OutgoingRequest) Scheme() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestScheme((uint32)(self0), &result) + wasmimport_OutgoingRequestScheme((uint32)(self0)) return } @@ -1298,14 +1291,13 @@ func (self OutgoingRequest) Scheme() (result cm.Option[Scheme]) { // HTTPS schemes always require an authority. Fails if the string given is // not a syntactically valid uri authority. // -// set-authority: func(authority: option) -> result +// set-authority: func(authority: option) // //go:nosplit -func (self OutgoingRequest) SetAuthority(authority cm.Option[string]) (result cm.BoolResult) { +func (self OutgoingRequest) SetAuthority(authority cm.Option[string]) { self0 := cm.Reinterpret[uint32](self) authority0, authority1, authority2 := lower_OptionString(authority) - result0 := wasmimport_OutgoingRequestSetAuthority((uint32)(self0), (uint32)(authority0), (*uint8)(authority1), (uint32)(authority2)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_OutgoingRequestSetAuthority((uint32)(self0), (uint32)(authority0), (*uint8)(authority1), (uint32)(authority2)) return } @@ -1314,14 +1306,13 @@ func (self OutgoingRequest) SetAuthority(authority cm.Option[string]) (result cm // Set the Method for the Request. Fails if the string present in a // `method.other` argument is not a syntactically valid method. // -// set-method: func(method: method) -> result +// set-method: func(method: method) // //go:nosplit -func (self OutgoingRequest) SetMethod(method Method) (result cm.BoolResult) { +func (self OutgoingRequest) SetMethod(method Method) { self0 := cm.Reinterpret[uint32](self) method0, method1, method2 := lower_Method(method) - result0 := wasmimport_OutgoingRequestSetMethod((uint32)(self0), (uint32)(method0), (*uint8)(method1), (uint32)(method2)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_OutgoingRequestSetMethod((uint32)(self0), (uint32)(method0), (*uint8)(method1), (uint32)(method2)) return } @@ -1331,14 +1322,13 @@ func (self OutgoingRequest) SetMethod(method Method) (result cm.BoolResult) { // When `none`, this represents an empty Path and empty Query. Fails is the // string given is not a syntactically valid path and query uri component. // -// set-path-with-query: func(path-with-query: option) -> result +// set-path-with-query: func(path-with-query: option) // //go:nosplit -func (self OutgoingRequest) SetPathWithQuery(pathWithQuery cm.Option[string]) (result cm.BoolResult) { +func (self OutgoingRequest) SetPathWithQuery(pathWithQuery cm.Option[string]) { self0 := cm.Reinterpret[uint32](self) pathWithQuery0, pathWithQuery1, pathWithQuery2 := lower_OptionString(pathWithQuery) - result0 := wasmimport_OutgoingRequestSetPathWithQuery((uint32)(self0), (uint32)(pathWithQuery0), (*uint8)(pathWithQuery1), (uint32)(pathWithQuery2)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_OutgoingRequestSetPathWithQuery((uint32)(self0), (uint32)(pathWithQuery0), (*uint8)(pathWithQuery1), (uint32)(pathWithQuery2)) return } @@ -1348,14 +1338,13 @@ func (self OutgoingRequest) SetPathWithQuery(pathWithQuery cm.Option[string]) (r // implementation may choose an appropriate default scheme. Fails if the // string given is not a syntactically valid uri scheme. // -// set-scheme: func(scheme: option) -> result +// set-scheme: func(scheme: option) // //go:nosplit -func (self OutgoingRequest) SetScheme(scheme cm.Option[Scheme]) (result cm.BoolResult) { +func (self OutgoingRequest) SetScheme(scheme cm.Option[Scheme]) { self0 := cm.Reinterpret[uint32](self) scheme0, scheme1, scheme2, scheme3 := lower_OptionScheme(scheme) - result0 := wasmimport_OutgoingRequestSetScheme((uint32)(self0), (uint32)(scheme0), (uint32)(scheme1), (*uint8)(scheme2), (uint32)(scheme3)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_OutgoingRequestSetScheme((uint32)(self0), (uint32)(scheme0), (uint32)(scheme1), (*uint8)(scheme2), (uint32)(scheme3)) return } @@ -1389,9 +1378,8 @@ func (self RequestOptions) ResourceDrop() { // constructor() // //go:nosplit -func NewRequestOptions() (result RequestOptions) { - result0 := wasmimport_NewRequestOptions() - result = cm.Reinterpret[RequestOptions]((uint32)(result0)) +func NewRequestOptions() { + wasmimport_NewRequestOptions() return } @@ -1400,12 +1388,12 @@ func NewRequestOptions() (result RequestOptions) { // The timeout for receiving subsequent chunks of bytes in the Response // body stream. // -// between-bytes-timeout: func() -> option +// between-bytes-timeout: func() // //go:nosplit -func (self RequestOptions) BetweenBytesTimeout() (result cm.Option[Duration]) { +func (self RequestOptions) BetweenBytesTimeout() { self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsBetweenBytesTimeout((uint32)(self0), &result) + wasmimport_RequestOptionsBetweenBytesTimeout((uint32)(self0)) return } @@ -1413,12 +1401,12 @@ func (self RequestOptions) BetweenBytesTimeout() (result cm.Option[Duration]) { // // The timeout for the initial connect to the HTTP Server. // -// connect-timeout: func() -> option +// connect-timeout: func() // //go:nosplit -func (self RequestOptions) ConnectTimeout() (result cm.Option[Duration]) { +func (self RequestOptions) ConnectTimeout() { self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsConnectTimeout((uint32)(self0), &result) + wasmimport_RequestOptionsConnectTimeout((uint32)(self0)) return } @@ -1426,12 +1414,12 @@ func (self RequestOptions) ConnectTimeout() (result cm.Option[Duration]) { // // The timeout for receiving the first byte of the Response body. // -// first-byte-timeout: func() -> option +// first-byte-timeout: func() // //go:nosplit -func (self RequestOptions) FirstByteTimeout() (result cm.Option[Duration]) { +func (self RequestOptions) FirstByteTimeout() { self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsFirstByteTimeout((uint32)(self0), &result) + wasmimport_RequestOptionsFirstByteTimeout((uint32)(self0)) return } @@ -1441,14 +1429,13 @@ func (self RequestOptions) FirstByteTimeout() (result cm.Option[Duration]) { // body stream. An error return value indicates that this timeout is not // supported. // -// set-between-bytes-timeout: func(duration: option) -> result +// set-between-bytes-timeout: func(duration: option) // //go:nosplit -func (self RequestOptions) SetBetweenBytesTimeout(duration cm.Option[Duration]) (result cm.BoolResult) { +func (self RequestOptions) SetBetweenBytesTimeout(duration cm.Option[Duration]) { self0 := cm.Reinterpret[uint32](self) duration0, duration1 := lower_OptionDuration(duration) - result0 := wasmimport_RequestOptionsSetBetweenBytesTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_RequestOptionsSetBetweenBytesTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) return } @@ -1457,14 +1444,13 @@ func (self RequestOptions) SetBetweenBytesTimeout(duration cm.Option[Duration]) // Set the timeout for the initial connect to the HTTP Server. An error // return value indicates that this timeout is not supported. // -// set-connect-timeout: func(duration: option) -> result +// set-connect-timeout: func(duration: option) // //go:nosplit -func (self RequestOptions) SetConnectTimeout(duration cm.Option[Duration]) (result cm.BoolResult) { +func (self RequestOptions) SetConnectTimeout(duration cm.Option[Duration]) { self0 := cm.Reinterpret[uint32](self) duration0, duration1 := lower_OptionDuration(duration) - result0 := wasmimport_RequestOptionsSetConnectTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_RequestOptionsSetConnectTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) return } @@ -1473,14 +1459,13 @@ func (self RequestOptions) SetConnectTimeout(duration cm.Option[Duration]) (resu // Set the timeout for receiving the first byte of the Response body. An // error return value indicates that this timeout is not supported. // -// set-first-byte-timeout: func(duration: option) -> result +// set-first-byte-timeout: func(duration: option) // //go:nosplit -func (self RequestOptions) SetFirstByteTimeout(duration cm.Option[Duration]) (result cm.BoolResult) { +func (self RequestOptions) SetFirstByteTimeout(duration cm.Option[Duration]) { self0 := cm.Reinterpret[uint32](self) duration0, duration1 := lower_OptionDuration(duration) - result0 := wasmimport_RequestOptionsSetFirstByteTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_RequestOptionsSetFirstByteTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) return } @@ -1559,12 +1544,12 @@ func (self IncomingResponse) ResourceDrop() { // Returns the incoming body. May be called at most once. Returns error // if called additional times. // -// consume: func() -> result +// consume: func() // //go:nosplit -func (self IncomingResponse) Consume() (result cm.Result[IncomingBody, IncomingBody, struct{}]) { +func (self IncomingResponse) Consume() { self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingResponseConsume((uint32)(self0), &result) + wasmimport_IncomingResponseConsume((uint32)(self0)) return } @@ -1578,13 +1563,12 @@ func (self IncomingResponse) Consume() (result cm.Result[IncomingBody, IncomingB // This headers resource is a child: it must be dropped before the parent // `incoming-response` is dropped. // -// headers: func() -> headers +// headers: func() // //go:nosplit -func (self IncomingResponse) Headers() (result Headers) { +func (self IncomingResponse) Headers() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_IncomingResponseHeaders((uint32)(self0)) - result = cm.Reinterpret[Headers]((uint32)(result0)) + wasmimport_IncomingResponseHeaders((uint32)(self0)) return } @@ -1592,13 +1576,12 @@ func (self IncomingResponse) Headers() (result Headers) { // // Returns the status code from the incoming response. // -// status: func() -> status-code +// status: func() // //go:nosplit -func (self IncomingResponse) Status() (result StatusCode) { +func (self IncomingResponse) Status() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_IncomingResponseStatus((uint32)(self0)) - result = (StatusCode)((uint32)(result0)) + wasmimport_IncomingResponseStatus((uint32)(self0)) return } @@ -1632,13 +1615,12 @@ func (self IncomingBody) ResourceDrop() { // Takes ownership of `incoming-body`, and returns a `future-trailers`. // This function will trap if the `input-stream` child is still alive. // -// finish: static func(this: incoming-body) -> future-trailers +// finish: static func(this: incoming-body) // //go:nosplit -func IncomingBodyFinish(this IncomingBody) (result FutureTrailers) { +func IncomingBodyFinish(this IncomingBody) { this0 := cm.Reinterpret[uint32](this) - result0 := wasmimport_IncomingBodyFinish((uint32)(this0)) - result = cm.Reinterpret[FutureTrailers]((uint32)(result0)) + wasmimport_IncomingBodyFinish((uint32)(this0)) return } @@ -1660,12 +1642,12 @@ func IncomingBodyFinish(this IncomingBody) (result FutureTrailers) { // and for that backpressure to not inhibit delivery of the trailers if // the user does not read the entire body. // -// %stream: func() -> result +// %stream: func() // //go:nosplit -func (self IncomingBody) Stream() (result cm.Result[InputStream, InputStream, struct{}]) { +func (self IncomingBody) Stream() { self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingBodyStream((uint32)(self0), &result) + wasmimport_IncomingBodyStream((uint32)(self0)) return } @@ -1713,12 +1695,12 @@ func (self FutureTrailers) ResourceDrop() { // `delete` methods will return an error, and the resource must be // dropped before the parent `future-trailers` is dropped. // -// get: func() -> option, error-code>>> +// get: func() // //go:nosplit -func (self FutureTrailers) Get() (result cm.Option[cm.Result[cm.Result[ErrorCodeShape, cm.Option[Trailers], ErrorCode], cm.Result[ErrorCodeShape, cm.Option[Trailers], ErrorCode], struct{}]]) { +func (self FutureTrailers) Get() { self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureTrailersGet((uint32)(self0), &result) + wasmimport_FutureTrailersGet((uint32)(self0)) return } @@ -1728,13 +1710,12 @@ func (self FutureTrailers) Get() (result cm.Option[cm.Result[cm.Result[ErrorCode // been received, or an error has occured. When this pollable is ready, // the `get` method will return `some`. // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self FutureTrailers) Subscribe() (result Pollable) { +func (self FutureTrailers) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_FutureTrailersSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_FutureTrailersSubscribe((uint32)(self0)) return } @@ -1767,10 +1748,9 @@ func (self OutgoingResponse) ResourceDrop() { // constructor(headers: headers) // //go:nosplit -func NewOutgoingResponse(headers Headers) (result OutgoingResponse) { +func NewOutgoingResponse(headers Headers) { headers0 := cm.Reinterpret[uint32](headers) - result0 := wasmimport_NewOutgoingResponse((uint32)(headers0)) - result = cm.Reinterpret[OutgoingResponse]((uint32)(result0)) + wasmimport_NewOutgoingResponse((uint32)(headers0)) return } @@ -1782,12 +1762,12 @@ func NewOutgoingResponse(headers Headers) (result OutgoingResponse) { // this `outgoing-response` can be retrieved at most once. Subsequent // calls will return error. // -// body: func() -> result +// body: func() // //go:nosplit -func (self OutgoingResponse) Body() (result cm.Result[OutgoingBody, OutgoingBody, struct{}]) { +func (self OutgoingResponse) Body() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingResponseBody((uint32)(self0), &result) + wasmimport_OutgoingResponseBody((uint32)(self0)) return } @@ -1802,13 +1782,12 @@ func (self OutgoingResponse) Body() (result cm.Result[OutgoingBody, OutgoingBody // `outgoing-request` is dropped, or its ownership is transfered to // another component by e.g. `outgoing-handler.handle`. // -// headers: func() -> headers +// headers: func() // //go:nosplit -func (self OutgoingResponse) Headers() (result Headers) { +func (self OutgoingResponse) Headers() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutgoingResponseHeaders((uint32)(self0)) - result = cm.Reinterpret[Headers]((uint32)(result0)) + wasmimport_OutgoingResponseHeaders((uint32)(self0)) return } @@ -1817,14 +1796,13 @@ func (self OutgoingResponse) Headers() (result Headers) { // Set the HTTP Status Code for the Response. Fails if the status-code // given is not a valid http status code. // -// set-status-code: func(status-code: status-code) -> result +// set-status-code: func(status-code: status-code) // //go:nosplit -func (self OutgoingResponse) SetStatusCode(statusCode StatusCode) (result cm.BoolResult) { +func (self OutgoingResponse) SetStatusCode(statusCode StatusCode) { self0 := cm.Reinterpret[uint32](self) statusCode0 := (uint32)(statusCode) - result0 := wasmimport_OutgoingResponseSetStatusCode((uint32)(self0), (uint32)(statusCode0)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_OutgoingResponseSetStatusCode((uint32)(self0), (uint32)(statusCode0)) return } @@ -1832,13 +1810,12 @@ func (self OutgoingResponse) SetStatusCode(statusCode StatusCode) (result cm.Boo // // Get the HTTP Status Code for the Response. // -// status-code: func() -> status-code +// status-code: func() // //go:nosplit -func (self OutgoingResponse) StatusCode() (result StatusCode) { +func (self OutgoingResponse) StatusCode() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutgoingResponseStatusCode((uint32)(self0)) - result = (StatusCode)((uint32)(result0)) + wasmimport_OutgoingResponseStatusCode((uint32)(self0)) return } @@ -1887,14 +1864,13 @@ func (self OutgoingBody) ResourceDrop() { // to the body (via `write`) does not match the value given in the // Content-Length. // -// finish: static func(this: outgoing-body, trailers: option) -> result<_, -// error-code> +// finish: static func(this: outgoing-body, trailers: option) // //go:nosplit -func OutgoingBodyFinish(this OutgoingBody, trailers cm.Option[Trailers]) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func OutgoingBodyFinish(this OutgoingBody, trailers cm.Option[Trailers]) { this0 := cm.Reinterpret[uint32](this) trailers0, trailers1 := lower_OptionTrailers(trailers) - wasmimport_OutgoingBodyFinish((uint32)(this0), (uint32)(trailers0), (uint32)(trailers1), &result) + wasmimport_OutgoingBodyFinish((uint32)(this0), (uint32)(trailers0), (uint32)(trailers1)) return } @@ -1910,12 +1886,12 @@ func OutgoingBodyFinish(this OutgoingBody, trailers cm.Option[Trailers]) (result // this `outgoing-body` may be retrieved at most once. Subsequent calls // will return error. // -// write: func() -> result +// write: func() // //go:nosplit -func (self OutgoingBody) Write() (result cm.Result[OutputStream, OutputStream, struct{}]) { +func (self OutgoingBody) Write() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingBodyWrite((uint32)(self0), &result) + wasmimport_OutgoingBodyWrite((uint32)(self0)) return } @@ -1958,12 +1934,12 @@ func (self FutureIncomingResponse) ResourceDrop() { // but those will be reported by the `incoming-body` and its // `output-stream` child. // -// get: func() -> option>> +// get: func() // //go:nosplit -func (self FutureIncomingResponse) Get() (result cm.Option[cm.Result[cm.Result[ErrorCodeShape, IncomingResponse, ErrorCode], cm.Result[ErrorCodeShape, IncomingResponse, ErrorCode], struct{}]]) { +func (self FutureIncomingResponse) Get() { self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureIncomingResponseGet((uint32)(self0), &result) + wasmimport_FutureIncomingResponseGet((uint32)(self0)) return } @@ -1973,13 +1949,12 @@ func (self FutureIncomingResponse) Get() (result cm.Option[cm.Result[cm.Result[E // been received, or an error has occured. When this pollable is ready, // the `get` method will return `some`. // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self FutureIncomingResponse) Subscribe() (result Pollable) { +func (self FutureIncomingResponse) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_FutureIncomingResponseSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_FutureIncomingResponseSubscribe((uint32)(self0)) return } @@ -1997,11 +1972,11 @@ func (self FutureIncomingResponse) Subscribe() (result Pollable) { // Note that this function is fallible because not all io-errors are // http-related errors. // -// http-error-code: func(err: borrow) -> option +// http-error-code: func(err: borrow) // //go:nosplit -func HTTPErrorCode(err IOError) (result cm.Option[ErrorCode]) { +func HTTPErrorCode(err IOError) { err0 := cm.Reinterpret[uint32](err) - wasmimport_HTTPErrorCode((uint32)(err0), &result) + wasmimport_HTTPErrorCode((uint32)(err0)) return } diff --git a/examples/component/http-password-checker/gen/wasi/io/error/error.wit.go b/examples/component/http-password-checker/gen/wasi/io/error/error.wit.go index 828e977e..a7ebc7e4 100755 --- a/examples/component/http-password-checker/gen/wasi/io/error/error.wit.go +++ b/examples/component/http-password-checker/gen/wasi/io/error/error.wit.go @@ -25,11 +25,11 @@ func (self Error) ResourceDrop() { // ToDebugString represents the imported method "to-debug-string". // -// to-debug-string: func() -> string +// to-debug-string: func() // //go:nosplit -func (self Error) ToDebugString() (result string) { +func (self Error) ToDebugString() { self0 := cm.Reinterpret[uint32](self) - wasmimport_ErrorToDebugString((uint32)(self0), &result) + wasmimport_ErrorToDebugString((uint32)(self0)) return } diff --git a/examples/component/http-password-checker/gen/wasi/io/error/ioerror.wasm.go b/examples/component/http-password-checker/gen/wasi/io/error/ioerror.wasm.go index e254b5d8..96c77c65 100755 --- a/examples/component/http-password-checker/gen/wasi/io/error/ioerror.wasm.go +++ b/examples/component/http-password-checker/gen/wasi/io/error/ioerror.wasm.go @@ -10,4 +10,4 @@ func wasmimport_ErrorResourceDrop(self0 uint32) //go:wasmimport wasi:io/error@0.2.0 [method]error.to-debug-string //go:noescape -func wasmimport_ErrorToDebugString(self0 uint32, result *string) +func wasmimport_ErrorToDebugString(self0 uint32) diff --git a/examples/component/http-password-checker/gen/wasi/io/poll/poll.wasm.go b/examples/component/http-password-checker/gen/wasi/io/poll/poll.wasm.go index f7c55c3d..d89a9926 100755 --- a/examples/component/http-password-checker/gen/wasi/io/poll/poll.wasm.go +++ b/examples/component/http-password-checker/gen/wasi/io/poll/poll.wasm.go @@ -2,10 +2,6 @@ package poll -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". //go:wasmimport wasi:io/poll@0.2.0 [resource-drop]pollable @@ -18,8 +14,8 @@ func wasmimport_PollableBlock(self0 uint32) //go:wasmimport wasi:io/poll@0.2.0 [method]pollable.ready //go:noescape -func wasmimport_PollableReady(self0 uint32) (result0 uint32) +func wasmimport_PollableReady(self0 uint32) //go:wasmimport wasi:io/poll@0.2.0 poll //go:noescape -func wasmimport_Poll(in0 *Pollable, in1 uint32, result *cm.List[uint32]) +func wasmimport_Poll(in0 *Pollable, in1 uint32) diff --git a/examples/component/http-password-checker/gen/wasi/io/poll/poll.wit.go b/examples/component/http-password-checker/gen/wasi/io/poll/poll.wit.go index ad9e9564..4a952ecf 100755 --- a/examples/component/http-password-checker/gen/wasi/io/poll/poll.wit.go +++ b/examples/component/http-password-checker/gen/wasi/io/poll/poll.wit.go @@ -36,23 +36,22 @@ func (self Pollable) Block() { // Ready represents the imported method "ready". // -// ready: func() -> bool +// ready: func() // //go:nosplit -func (self Pollable) Ready() (result bool) { +func (self Pollable) Ready() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_PollableReady((uint32)(self0)) - result = (bool)(cm.U32ToBool((uint32)(result0))) + wasmimport_PollableReady((uint32)(self0)) return } // Poll represents the imported function "poll". // -// poll: func(in: list>) -> list +// poll: func(in: list>) // //go:nosplit -func Poll(in cm.List[Pollable]) (result cm.List[uint32]) { +func Poll(in cm.List[Pollable]) { in0, in1 := cm.LowerList(in) - wasmimport_Poll((*Pollable)(in0), (uint32)(in1), &result) + wasmimport_Poll((*Pollable)(in0), (uint32)(in1)) return } diff --git a/examples/component/http-password-checker/gen/wasi/io/streams/streams.wasm.go b/examples/component/http-password-checker/gen/wasi/io/streams/streams.wasm.go index eec56645..98543c56 100755 --- a/examples/component/http-password-checker/gen/wasi/io/streams/streams.wasm.go +++ b/examples/component/http-password-checker/gen/wasi/io/streams/streams.wasm.go @@ -2,10 +2,6 @@ package streams -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". //go:wasmimport wasi:io/streams@0.2.0 [resource-drop]input-stream @@ -14,23 +10,23 @@ func wasmimport_InputStreamResourceDrop(self0 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.blocking-read //go:noescape -func wasmimport_InputStreamBlockingRead(self0 uint32, len0 uint64, result *cm.Result[cm.List[uint8], cm.List[uint8], StreamError]) +func wasmimport_InputStreamBlockingRead(self0 uint32, len0 uint64) //go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.blocking-skip //go:noescape -func wasmimport_InputStreamBlockingSkip(self0 uint32, len0 uint64, result *cm.Result[uint64, uint64, StreamError]) +func wasmimport_InputStreamBlockingSkip(self0 uint32, len0 uint64) //go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.read //go:noescape -func wasmimport_InputStreamRead(self0 uint32, len0 uint64, result *cm.Result[cm.List[uint8], cm.List[uint8], StreamError]) +func wasmimport_InputStreamRead(self0 uint32, len0 uint64) //go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.skip //go:noescape -func wasmimport_InputStreamSkip(self0 uint32, len0 uint64, result *cm.Result[uint64, uint64, StreamError]) +func wasmimport_InputStreamSkip(self0 uint32, len0 uint64) //go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.subscribe //go:noescape -func wasmimport_InputStreamSubscribe(self0 uint32) (result0 uint32) +func wasmimport_InputStreamSubscribe(self0 uint32) //go:wasmimport wasi:io/streams@0.2.0 [resource-drop]output-stream //go:noescape @@ -38,40 +34,40 @@ func wasmimport_OutputStreamResourceDrop(self0 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-flush //go:noescape -func wasmimport_OutputStreamBlockingFlush(self0 uint32, result *cm.Result[StreamError, struct{}, StreamError]) +func wasmimport_OutputStreamBlockingFlush(self0 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-splice //go:noescape -func wasmimport_OutputStreamBlockingSplice(self0 uint32, src0 uint32, len0 uint64, result *cm.Result[uint64, uint64, StreamError]) +func wasmimport_OutputStreamBlockingSplice(self0 uint32, src0 uint32, len0 uint64) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-write-and-flush //go:noescape -func wasmimport_OutputStreamBlockingWriteAndFlush(self0 uint32, contents0 *uint8, contents1 uint32, result *cm.Result[StreamError, struct{}, StreamError]) +func wasmimport_OutputStreamBlockingWriteAndFlush(self0 uint32, contents0 *uint8, contents1 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-write-zeroes-and-flush //go:noescape -func wasmimport_OutputStreamBlockingWriteZeroesAndFlush(self0 uint32, len0 uint64, result *cm.Result[StreamError, struct{}, StreamError]) +func wasmimport_OutputStreamBlockingWriteZeroesAndFlush(self0 uint32, len0 uint64) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.check-write //go:noescape -func wasmimport_OutputStreamCheckWrite(self0 uint32, result *cm.Result[uint64, uint64, StreamError]) +func wasmimport_OutputStreamCheckWrite(self0 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.flush //go:noescape -func wasmimport_OutputStreamFlush(self0 uint32, result *cm.Result[StreamError, struct{}, StreamError]) +func wasmimport_OutputStreamFlush(self0 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.splice //go:noescape -func wasmimport_OutputStreamSplice(self0 uint32, src0 uint32, len0 uint64, result *cm.Result[uint64, uint64, StreamError]) +func wasmimport_OutputStreamSplice(self0 uint32, src0 uint32, len0 uint64) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.subscribe //go:noescape -func wasmimport_OutputStreamSubscribe(self0 uint32) (result0 uint32) +func wasmimport_OutputStreamSubscribe(self0 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.write //go:noescape -func wasmimport_OutputStreamWrite(self0 uint32, contents0 *uint8, contents1 uint32, result *cm.Result[StreamError, struct{}, StreamError]) +func wasmimport_OutputStreamWrite(self0 uint32, contents0 *uint8, contents1 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.write-zeroes //go:noescape -func wasmimport_OutputStreamWriteZeroes(self0 uint32, len0 uint64, result *cm.Result[StreamError, struct{}, StreamError]) +func wasmimport_OutputStreamWriteZeroes(self0 uint32, len0 uint64) diff --git a/examples/component/http-password-checker/gen/wasi/io/streams/streams.wit.go b/examples/component/http-password-checker/gen/wasi/io/streams/streams.wit.go index 2c09b975..8183977d 100755 --- a/examples/component/http-password-checker/gen/wasi/io/streams/streams.wit.go +++ b/examples/component/http-password-checker/gen/wasi/io/streams/streams.wit.go @@ -76,61 +76,60 @@ func (self InputStream) ResourceDrop() { // BlockingRead represents the imported method "blocking-read". // -// blocking-read: func(len: u64) -> result, stream-error> +// blocking-read: func(len: u64) // //go:nosplit -func (self InputStream) BlockingRead(len_ uint64) (result cm.Result[cm.List[uint8], cm.List[uint8], StreamError]) { +func (self InputStream) BlockingRead(len_ uint64) { self0 := cm.Reinterpret[uint32](self) len0 := (uint64)(len_) - wasmimport_InputStreamBlockingRead((uint32)(self0), (uint64)(len0), &result) + wasmimport_InputStreamBlockingRead((uint32)(self0), (uint64)(len0)) return } // BlockingSkip represents the imported method "blocking-skip". // -// blocking-skip: func(len: u64) -> result +// blocking-skip: func(len: u64) // //go:nosplit -func (self InputStream) BlockingSkip(len_ uint64) (result cm.Result[uint64, uint64, StreamError]) { +func (self InputStream) BlockingSkip(len_ uint64) { self0 := cm.Reinterpret[uint32](self) len0 := (uint64)(len_) - wasmimport_InputStreamBlockingSkip((uint32)(self0), (uint64)(len0), &result) + wasmimport_InputStreamBlockingSkip((uint32)(self0), (uint64)(len0)) return } // Read represents the imported method "read". // -// read: func(len: u64) -> result, stream-error> +// read: func(len: u64) // //go:nosplit -func (self InputStream) Read(len_ uint64) (result cm.Result[cm.List[uint8], cm.List[uint8], StreamError]) { +func (self InputStream) Read(len_ uint64) { self0 := cm.Reinterpret[uint32](self) len0 := (uint64)(len_) - wasmimport_InputStreamRead((uint32)(self0), (uint64)(len0), &result) + wasmimport_InputStreamRead((uint32)(self0), (uint64)(len0)) return } // Skip represents the imported method "skip". // -// skip: func(len: u64) -> result +// skip: func(len: u64) // //go:nosplit -func (self InputStream) Skip(len_ uint64) (result cm.Result[uint64, uint64, StreamError]) { +func (self InputStream) Skip(len_ uint64) { self0 := cm.Reinterpret[uint32](self) len0 := (uint64)(len_) - wasmimport_InputStreamSkip((uint32)(self0), (uint64)(len0), &result) + wasmimport_InputStreamSkip((uint32)(self0), (uint64)(len0)) return } // Subscribe represents the imported method "subscribe". // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self InputStream) Subscribe() (result Pollable) { +func (self InputStream) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_InputStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_InputStreamSubscribe((uint32)(self0)) return } @@ -152,119 +151,118 @@ func (self OutputStream) ResourceDrop() { // BlockingFlush represents the imported method "blocking-flush". // -// blocking-flush: func() -> result<_, stream-error> +// blocking-flush: func() // //go:nosplit -func (self OutputStream) BlockingFlush() (result cm.Result[StreamError, struct{}, StreamError]) { +func (self OutputStream) BlockingFlush() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamBlockingFlush((uint32)(self0), &result) + wasmimport_OutputStreamBlockingFlush((uint32)(self0)) return } // BlockingSplice represents the imported method "blocking-splice". // -// blocking-splice: func(src: borrow, len: u64) -> result +// blocking-splice: func(src: borrow, len: u64) // //go:nosplit -func (self OutputStream) BlockingSplice(src InputStream, len_ uint64) (result cm.Result[uint64, uint64, StreamError]) { +func (self OutputStream) BlockingSplice(src InputStream, len_ uint64) { self0 := cm.Reinterpret[uint32](self) src0 := cm.Reinterpret[uint32](src) len0 := (uint64)(len_) - wasmimport_OutputStreamBlockingSplice((uint32)(self0), (uint32)(src0), (uint64)(len0), &result) + wasmimport_OutputStreamBlockingSplice((uint32)(self0), (uint32)(src0), (uint64)(len0)) return } // BlockingWriteAndFlush represents the imported method "blocking-write-and-flush". // -// blocking-write-and-flush: func(contents: list) -> result<_, stream-error> +// blocking-write-and-flush: func(contents: list) // //go:nosplit -func (self OutputStream) BlockingWriteAndFlush(contents cm.List[uint8]) (result cm.Result[StreamError, struct{}, StreamError]) { +func (self OutputStream) BlockingWriteAndFlush(contents cm.List[uint8]) { self0 := cm.Reinterpret[uint32](self) contents0, contents1 := cm.LowerList(contents) - wasmimport_OutputStreamBlockingWriteAndFlush((uint32)(self0), (*uint8)(contents0), (uint32)(contents1), &result) + wasmimport_OutputStreamBlockingWriteAndFlush((uint32)(self0), (*uint8)(contents0), (uint32)(contents1)) return } // BlockingWriteZeroesAndFlush represents the imported method "blocking-write-zeroes-and-flush". // -// blocking-write-zeroes-and-flush: func(len: u64) -> result<_, stream-error> +// blocking-write-zeroes-and-flush: func(len: u64) // //go:nosplit -func (self OutputStream) BlockingWriteZeroesAndFlush(len_ uint64) (result cm.Result[StreamError, struct{}, StreamError]) { +func (self OutputStream) BlockingWriteZeroesAndFlush(len_ uint64) { self0 := cm.Reinterpret[uint32](self) len0 := (uint64)(len_) - wasmimport_OutputStreamBlockingWriteZeroesAndFlush((uint32)(self0), (uint64)(len0), &result) + wasmimport_OutputStreamBlockingWriteZeroesAndFlush((uint32)(self0), (uint64)(len0)) return } // CheckWrite represents the imported method "check-write". // -// check-write: func() -> result +// check-write: func() // //go:nosplit -func (self OutputStream) CheckWrite() (result cm.Result[uint64, uint64, StreamError]) { +func (self OutputStream) CheckWrite() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamCheckWrite((uint32)(self0), &result) + wasmimport_OutputStreamCheckWrite((uint32)(self0)) return } // Flush represents the imported method "flush". // -// flush: func() -> result<_, stream-error> +// flush: func() // //go:nosplit -func (self OutputStream) Flush() (result cm.Result[StreamError, struct{}, StreamError]) { +func (self OutputStream) Flush() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamFlush((uint32)(self0), &result) + wasmimport_OutputStreamFlush((uint32)(self0)) return } // Splice represents the imported method "splice". // -// splice: func(src: borrow, len: u64) -> result +// splice: func(src: borrow, len: u64) // //go:nosplit -func (self OutputStream) Splice(src InputStream, len_ uint64) (result cm.Result[uint64, uint64, StreamError]) { +func (self OutputStream) Splice(src InputStream, len_ uint64) { self0 := cm.Reinterpret[uint32](self) src0 := cm.Reinterpret[uint32](src) len0 := (uint64)(len_) - wasmimport_OutputStreamSplice((uint32)(self0), (uint32)(src0), (uint64)(len0), &result) + wasmimport_OutputStreamSplice((uint32)(self0), (uint32)(src0), (uint64)(len0)) return } // Subscribe represents the imported method "subscribe". // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self OutputStream) Subscribe() (result Pollable) { +func (self OutputStream) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutputStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_OutputStreamSubscribe((uint32)(self0)) return } // Write represents the imported method "write". // -// write: func(contents: list) -> result<_, stream-error> +// write: func(contents: list) // //go:nosplit -func (self OutputStream) Write(contents cm.List[uint8]) (result cm.Result[StreamError, struct{}, StreamError]) { +func (self OutputStream) Write(contents cm.List[uint8]) { self0 := cm.Reinterpret[uint32](self) contents0, contents1 := cm.LowerList(contents) - wasmimport_OutputStreamWrite((uint32)(self0), (*uint8)(contents0), (uint32)(contents1), &result) + wasmimport_OutputStreamWrite((uint32)(self0), (*uint8)(contents0), (uint32)(contents1)) return } // WriteZeroes represents the imported method "write-zeroes". // -// write-zeroes: func(len: u64) -> result<_, stream-error> +// write-zeroes: func(len: u64) // //go:nosplit -func (self OutputStream) WriteZeroes(len_ uint64) (result cm.Result[StreamError, struct{}, StreamError]) { +func (self OutputStream) WriteZeroes(len_ uint64) { self0 := cm.Reinterpret[uint32](self) len0 := (uint64)(len_) - wasmimport_OutputStreamWriteZeroes((uint32)(self0), (uint64)(len0), &result) + wasmimport_OutputStreamWriteZeroes((uint32)(self0), (uint64)(len0)) return } diff --git a/examples/component/http-password-checker/gen/wasi/random/insecure-seed/insecure-seed.wit.go b/examples/component/http-password-checker/gen/wasi/random/insecure-seed/insecure-seed.wit.go index e701d1b4..6b9afd75 100755 --- a/examples/component/http-password-checker/gen/wasi/random/insecure-seed/insecure-seed.wit.go +++ b/examples/component/http-password-checker/gen/wasi/random/insecure-seed/insecure-seed.wit.go @@ -5,10 +5,10 @@ package insecureseed // InsecureSeed represents the imported function "insecure-seed". // -// insecure-seed: func() -> tuple +// insecure-seed: func() // //go:nosplit -func InsecureSeed() (result [2]uint64) { - wasmimport_InsecureSeed(&result) +func InsecureSeed() { + wasmimport_InsecureSeed() return } diff --git a/examples/component/http-password-checker/gen/wasi/random/insecure-seed/insecureseed.wasm.go b/examples/component/http-password-checker/gen/wasi/random/insecure-seed/insecureseed.wasm.go index e94356df..6dc19c0b 100755 --- a/examples/component/http-password-checker/gen/wasi/random/insecure-seed/insecureseed.wasm.go +++ b/examples/component/http-password-checker/gen/wasi/random/insecure-seed/insecureseed.wasm.go @@ -6,4 +6,4 @@ package insecureseed //go:wasmimport wasi:random/insecure-seed@0.2.0 insecure-seed //go:noescape -func wasmimport_InsecureSeed(result *[2]uint64) +func wasmimport_InsecureSeed() diff --git a/examples/component/http-password-checker/gen/wasi/random/insecure/insecure.wasm.go b/examples/component/http-password-checker/gen/wasi/random/insecure/insecure.wasm.go index 498bfe4a..41ffb551 100755 --- a/examples/component/http-password-checker/gen/wasi/random/insecure/insecure.wasm.go +++ b/examples/component/http-password-checker/gen/wasi/random/insecure/insecure.wasm.go @@ -2,16 +2,12 @@ package insecure -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". //go:wasmimport wasi:random/insecure@0.2.0 get-insecure-random-bytes //go:noescape -func wasmimport_GetInsecureRandomBytes(len0 uint64, result *cm.List[uint8]) +func wasmimport_GetInsecureRandomBytes(len0 uint64) //go:wasmimport wasi:random/insecure@0.2.0 get-insecure-random-u64 //go:noescape -func wasmimport_GetInsecureRandomU64() (result0 uint64) +func wasmimport_GetInsecureRandomU64() diff --git a/examples/component/http-password-checker/gen/wasi/random/insecure/insecure.wit.go b/examples/component/http-password-checker/gen/wasi/random/insecure/insecure.wit.go index f32282c6..add35465 100755 --- a/examples/component/http-password-checker/gen/wasi/random/insecure/insecure.wit.go +++ b/examples/component/http-password-checker/gen/wasi/random/insecure/insecure.wit.go @@ -3,28 +3,23 @@ // Package insecure represents the imported interface "wasi:random/insecure@0.2.0". package insecure -import ( - "go.bytecodealliance.org/cm" -) - // GetInsecureRandomBytes represents the imported function "get-insecure-random-bytes". // -// get-insecure-random-bytes: func(len: u64) -> list +// get-insecure-random-bytes: func(len: u64) // //go:nosplit -func GetInsecureRandomBytes(len_ uint64) (result cm.List[uint8]) { +func GetInsecureRandomBytes(len_ uint64) { len0 := (uint64)(len_) - wasmimport_GetInsecureRandomBytes((uint64)(len0), &result) + wasmimport_GetInsecureRandomBytes((uint64)(len0)) return } // GetInsecureRandomU64 represents the imported function "get-insecure-random-u64". // -// get-insecure-random-u64: func() -> u64 +// get-insecure-random-u64: func() // //go:nosplit -func GetInsecureRandomU64() (result uint64) { - result0 := wasmimport_GetInsecureRandomU64() - result = (uint64)((uint64)(result0)) +func GetInsecureRandomU64() { + wasmimport_GetInsecureRandomU64() return } diff --git a/examples/component/http-password-checker/gen/wasi/random/random/random.wasm.go b/examples/component/http-password-checker/gen/wasi/random/random/random.wasm.go index 9096457b..512ee826 100755 --- a/examples/component/http-password-checker/gen/wasi/random/random/random.wasm.go +++ b/examples/component/http-password-checker/gen/wasi/random/random/random.wasm.go @@ -2,16 +2,12 @@ package random -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". //go:wasmimport wasi:random/random@0.2.0 get-random-bytes //go:noescape -func wasmimport_GetRandomBytes(len0 uint64, result *cm.List[uint8]) +func wasmimport_GetRandomBytes(len0 uint64) //go:wasmimport wasi:random/random@0.2.0 get-random-u64 //go:noescape -func wasmimport_GetRandomU64() (result0 uint64) +func wasmimport_GetRandomU64() diff --git a/examples/component/http-password-checker/gen/wasi/random/random/random.wit.go b/examples/component/http-password-checker/gen/wasi/random/random/random.wit.go index 98bb7779..f11f988d 100755 --- a/examples/component/http-password-checker/gen/wasi/random/random/random.wit.go +++ b/examples/component/http-password-checker/gen/wasi/random/random/random.wit.go @@ -3,28 +3,23 @@ // Package random represents the imported interface "wasi:random/random@0.2.0". package random -import ( - "go.bytecodealliance.org/cm" -) - // GetRandomBytes represents the imported function "get-random-bytes". // -// get-random-bytes: func(len: u64) -> list +// get-random-bytes: func(len: u64) // //go:nosplit -func GetRandomBytes(len_ uint64) (result cm.List[uint8]) { +func GetRandomBytes(len_ uint64) { len0 := (uint64)(len_) - wasmimport_GetRandomBytes((uint64)(len0), &result) + wasmimport_GetRandomBytes((uint64)(len0)) return } // GetRandomU64 represents the imported function "get-random-u64". // -// get-random-u64: func() -> u64 +// get-random-u64: func() // //go:nosplit -func GetRandomU64() (result uint64) { - result0 := wasmimport_GetRandomU64() - result = (uint64)((uint64)(result0)) +func GetRandomU64() { + wasmimport_GetRandomU64() return } diff --git a/examples/component/http-password-checker/gen/wasi/sockets/instance-network/instance-network.wit.go b/examples/component/http-password-checker/gen/wasi/sockets/instance-network/instance-network.wit.go index afee8939..46426da3 100755 --- a/examples/component/http-password-checker/gen/wasi/sockets/instance-network/instance-network.wit.go +++ b/examples/component/http-password-checker/gen/wasi/sockets/instance-network/instance-network.wit.go @@ -4,7 +4,6 @@ package instancenetwork import ( - "go.bytecodealliance.org/cm" "http-password-checker/gen/wasi/sockets/network" ) @@ -15,11 +14,10 @@ type Network = network.Network // InstanceNetwork represents the imported function "instance-network". // -// instance-network: func() -> network +// instance-network: func() // //go:nosplit -func InstanceNetwork() (result Network) { - result0 := wasmimport_InstanceNetwork() - result = cm.Reinterpret[Network]((uint32)(result0)) +func InstanceNetwork() { + wasmimport_InstanceNetwork() return } diff --git a/examples/component/http-password-checker/gen/wasi/sockets/instance-network/instancenetwork.wasm.go b/examples/component/http-password-checker/gen/wasi/sockets/instance-network/instancenetwork.wasm.go index eb113e21..01fc4839 100755 --- a/examples/component/http-password-checker/gen/wasi/sockets/instance-network/instancenetwork.wasm.go +++ b/examples/component/http-password-checker/gen/wasi/sockets/instance-network/instancenetwork.wasm.go @@ -6,4 +6,4 @@ package instancenetwork //go:wasmimport wasi:sockets/instance-network@0.2.0 instance-network //go:noescape -func wasmimport_InstanceNetwork() (result0 uint32) +func wasmimport_InstanceNetwork() diff --git a/examples/component/http-password-checker/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go b/examples/component/http-password-checker/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go index 5355e0fa..df1313b5 100755 --- a/examples/component/http-password-checker/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go +++ b/examples/component/http-password-checker/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go @@ -47,36 +47,34 @@ func (self ResolveAddressStream) ResourceDrop() { // ResolveNextAddress represents the imported method "resolve-next-address". // -// resolve-next-address: func() -> result, error-code> +// resolve-next-address: func() // //go:nosplit -func (self ResolveAddressStream) ResolveNextAddress() (result cm.Result[OptionIPAddressShape, cm.Option[IPAddress], ErrorCode]) { +func (self ResolveAddressStream) ResolveNextAddress() { self0 := cm.Reinterpret[uint32](self) - wasmimport_ResolveAddressStreamResolveNextAddress((uint32)(self0), &result) + wasmimport_ResolveAddressStreamResolveNextAddress((uint32)(self0)) return } // Subscribe represents the imported method "subscribe". // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self ResolveAddressStream) Subscribe() (result Pollable) { +func (self ResolveAddressStream) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_ResolveAddressStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_ResolveAddressStreamSubscribe((uint32)(self0)) return } // ResolveAddresses represents the imported function "resolve-addresses". // -// resolve-addresses: func(network: borrow, name: string) -> result +// resolve-addresses: func(network: borrow, name: string) // //go:nosplit -func ResolveAddresses(network_ Network, name string) (result cm.Result[ResolveAddressStream, ResolveAddressStream, ErrorCode]) { +func ResolveAddresses(network_ Network, name string) { network0 := cm.Reinterpret[uint32](network_) name0, name1 := cm.LowerString(name) - wasmimport_ResolveAddresses((uint32)(network0), (*uint8)(name0), (uint32)(name1), &result) + wasmimport_ResolveAddresses((uint32)(network0), (*uint8)(name0), (uint32)(name1)) return } diff --git a/examples/component/http-password-checker/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go b/examples/component/http-password-checker/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go index da5fb000..df4d85bc 100755 --- a/examples/component/http-password-checker/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go +++ b/examples/component/http-password-checker/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go @@ -2,10 +2,6 @@ package ipnamelookup -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". //go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 [resource-drop]resolve-address-stream @@ -14,12 +10,12 @@ func wasmimport_ResolveAddressStreamResourceDrop(self0 uint32) //go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 [method]resolve-address-stream.resolve-next-address //go:noescape -func wasmimport_ResolveAddressStreamResolveNextAddress(self0 uint32, result *cm.Result[OptionIPAddressShape, cm.Option[IPAddress], ErrorCode]) +func wasmimport_ResolveAddressStreamResolveNextAddress(self0 uint32) //go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 [method]resolve-address-stream.subscribe //go:noescape -func wasmimport_ResolveAddressStreamSubscribe(self0 uint32) (result0 uint32) +func wasmimport_ResolveAddressStreamSubscribe(self0 uint32) //go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 resolve-addresses //go:noescape -func wasmimport_ResolveAddresses(network0 uint32, name0 *uint8, name1 uint32, result *cm.Result[ResolveAddressStream, ResolveAddressStream, ErrorCode]) +func wasmimport_ResolveAddresses(network0 uint32, name0 *uint8, name1 uint32) diff --git a/examples/component/http-password-checker/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go b/examples/component/http-password-checker/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go index 279cf89f..edefdb57 100755 --- a/examples/component/http-password-checker/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go +++ b/examples/component/http-password-checker/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go @@ -4,7 +4,6 @@ package tcpcreatesocket import ( - "go.bytecodealliance.org/cm" "http-password-checker/gen/wasi/sockets/network" "http-password-checker/gen/wasi/sockets/tcp" ) @@ -31,12 +30,11 @@ type TCPSocket = tcp.TCPSocket // CreateTCPSocket represents the imported function "create-tcp-socket". // -// create-tcp-socket: func(address-family: ip-address-family) -> result +// create-tcp-socket: func(address-family: ip-address-family) // //go:nosplit -func CreateTCPSocket(addressFamily IPAddressFamily) (result cm.Result[TCPSocket, TCPSocket, ErrorCode]) { +func CreateTCPSocket(addressFamily IPAddressFamily) { addressFamily0 := (uint32)(addressFamily) - wasmimport_CreateTCPSocket((uint32)(addressFamily0), &result) + wasmimport_CreateTCPSocket((uint32)(addressFamily0)) return } diff --git a/examples/component/http-password-checker/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go b/examples/component/http-password-checker/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go index b7b43155..48d9b113 100755 --- a/examples/component/http-password-checker/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go +++ b/examples/component/http-password-checker/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go @@ -2,12 +2,8 @@ package tcpcreatesocket -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". //go:wasmimport wasi:sockets/tcp-create-socket@0.2.0 create-tcp-socket //go:noescape -func wasmimport_CreateTCPSocket(addressFamily0 uint32, result *cm.Result[TCPSocket, TCPSocket, ErrorCode]) +func wasmimport_CreateTCPSocket(addressFamily0 uint32) diff --git a/examples/component/http-password-checker/gen/wasi/sockets/tcp/abi.go b/examples/component/http-password-checker/gen/wasi/sockets/tcp/abi.go index 6807674b..89b1a288 100755 --- a/examples/component/http-password-checker/gen/wasi/sockets/tcp/abi.go +++ b/examples/component/http-password-checker/gen/wasi/sockets/tcp/abi.go @@ -5,27 +5,8 @@ package tcp import ( "go.bytecodealliance.org/cm" "http-password-checker/gen/wasi/sockets/network" - "unsafe" ) -// TupleTCPSocketInputStreamOutputStreamShape is used for storage in variant or result types. -type TupleTCPSocketInputStreamOutputStreamShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Tuple3[TCPSocket, InputStream, OutputStream]{})]byte -} - -// TupleInputStreamOutputStreamShape is used for storage in variant or result types. -type TupleInputStreamOutputStreamShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Tuple[InputStream, OutputStream]{})]byte -} - -// IPSocketAddressShape is used for storage in variant or result types. -type IPSocketAddressShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(network.IPSocketAddress{})]byte -} - func lower_IPv4Address(v network.IPv4Address) (f0 uint32, f1 uint32, f2 uint32, f3 uint32) { f0 = (uint32)(v[0]) f1 = (uint32)(v[1]) diff --git a/examples/component/http-password-checker/gen/wasi/sockets/tcp/tcp.wasm.go b/examples/component/http-password-checker/gen/wasi/sockets/tcp/tcp.wasm.go index 56247525..3d3553be 100755 --- a/examples/component/http-password-checker/gen/wasi/sockets/tcp/tcp.wasm.go +++ b/examples/component/http-password-checker/gen/wasi/sockets/tcp/tcp.wasm.go @@ -2,10 +2,6 @@ package tcp -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". //go:wasmimport wasi:sockets/tcp@0.2.0 [resource-drop]tcp-socket @@ -14,112 +10,112 @@ func wasmimport_TCPSocketResourceDrop(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.accept //go:noescape -func wasmimport_TCPSocketAccept(self0 uint32, result *cm.Result[TupleTCPSocketInputStreamOutputStreamShape, cm.Tuple3[TCPSocket, InputStream, OutputStream], ErrorCode]) +func wasmimport_TCPSocketAccept(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.address-family //go:noescape -func wasmimport_TCPSocketAddressFamily(self0 uint32) (result0 uint32) +func wasmimport_TCPSocketAddressFamily(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-bind //go:noescape -func wasmimport_TCPSocketFinishBind(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketFinishBind(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-connect //go:noescape -func wasmimport_TCPSocketFinishConnect(self0 uint32, result *cm.Result[TupleInputStreamOutputStreamShape, cm.Tuple[InputStream, OutputStream], ErrorCode]) +func wasmimport_TCPSocketFinishConnect(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-listen //go:noescape -func wasmimport_TCPSocketFinishListen(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketFinishListen(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.hop-limit //go:noescape -func wasmimport_TCPSocketHopLimit(self0 uint32, result *cm.Result[uint8, uint8, ErrorCode]) +func wasmimport_TCPSocketHopLimit(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.is-listening //go:noescape -func wasmimport_TCPSocketIsListening(self0 uint32) (result0 uint32) +func wasmimport_TCPSocketIsListening(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-count //go:noescape -func wasmimport_TCPSocketKeepAliveCount(self0 uint32, result *cm.Result[uint32, uint32, ErrorCode]) +func wasmimport_TCPSocketKeepAliveCount(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-enabled //go:noescape -func wasmimport_TCPSocketKeepAliveEnabled(self0 uint32, result *cm.Result[bool, bool, ErrorCode]) +func wasmimport_TCPSocketKeepAliveEnabled(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-idle-time //go:noescape -func wasmimport_TCPSocketKeepAliveIdleTime(self0 uint32, result *cm.Result[uint64, Duration, ErrorCode]) +func wasmimport_TCPSocketKeepAliveIdleTime(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-interval //go:noescape -func wasmimport_TCPSocketKeepAliveInterval(self0 uint32, result *cm.Result[uint64, Duration, ErrorCode]) +func wasmimport_TCPSocketKeepAliveInterval(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.local-address //go:noescape -func wasmimport_TCPSocketLocalAddress(self0 uint32, result *cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) +func wasmimport_TCPSocketLocalAddress(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.receive-buffer-size //go:noescape -func wasmimport_TCPSocketReceiveBufferSize(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) +func wasmimport_TCPSocketReceiveBufferSize(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.remote-address //go:noescape -func wasmimport_TCPSocketRemoteAddress(self0 uint32, result *cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) +func wasmimport_TCPSocketRemoteAddress(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.send-buffer-size //go:noescape -func wasmimport_TCPSocketSendBufferSize(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) +func wasmimport_TCPSocketSendBufferSize(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-hop-limit //go:noescape -func wasmimport_TCPSocketSetHopLimit(self0 uint32, value0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetHopLimit(self0 uint32, value0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-count //go:noescape -func wasmimport_TCPSocketSetKeepAliveCount(self0 uint32, value0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetKeepAliveCount(self0 uint32, value0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-enabled //go:noescape -func wasmimport_TCPSocketSetKeepAliveEnabled(self0 uint32, value0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetKeepAliveEnabled(self0 uint32, value0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-idle-time //go:noescape -func wasmimport_TCPSocketSetKeepAliveIdleTime(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetKeepAliveIdleTime(self0 uint32, value0 uint64) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-interval //go:noescape -func wasmimport_TCPSocketSetKeepAliveInterval(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetKeepAliveInterval(self0 uint32, value0 uint64) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-listen-backlog-size //go:noescape -func wasmimport_TCPSocketSetListenBacklogSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetListenBacklogSize(self0 uint32, value0 uint64) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-receive-buffer-size //go:noescape -func wasmimport_TCPSocketSetReceiveBufferSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetReceiveBufferSize(self0 uint32, value0 uint64) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-send-buffer-size //go:noescape -func wasmimport_TCPSocketSetSendBufferSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetSendBufferSize(self0 uint32, value0 uint64) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.shutdown //go:noescape -func wasmimport_TCPSocketShutdown(self0 uint32, shutdownType0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketShutdown(self0 uint32, shutdownType0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-bind //go:noescape -func wasmimport_TCPSocketStartBind(self0 uint32, network0 uint32, localAddress0 uint32, localAddress1 uint32, localAddress2 uint32, localAddress3 uint32, localAddress4 uint32, localAddress5 uint32, localAddress6 uint32, localAddress7 uint32, localAddress8 uint32, localAddress9 uint32, localAddress10 uint32, localAddress11 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketStartBind(self0 uint32, network0 uint32, localAddress0 uint32, localAddress1 uint32, localAddress2 uint32, localAddress3 uint32, localAddress4 uint32, localAddress5 uint32, localAddress6 uint32, localAddress7 uint32, localAddress8 uint32, localAddress9 uint32, localAddress10 uint32, localAddress11 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-connect //go:noescape -func wasmimport_TCPSocketStartConnect(self0 uint32, network0 uint32, remoteAddress0 uint32, remoteAddress1 uint32, remoteAddress2 uint32, remoteAddress3 uint32, remoteAddress4 uint32, remoteAddress5 uint32, remoteAddress6 uint32, remoteAddress7 uint32, remoteAddress8 uint32, remoteAddress9 uint32, remoteAddress10 uint32, remoteAddress11 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketStartConnect(self0 uint32, network0 uint32, remoteAddress0 uint32, remoteAddress1 uint32, remoteAddress2 uint32, remoteAddress3 uint32, remoteAddress4 uint32, remoteAddress5 uint32, remoteAddress6 uint32, remoteAddress7 uint32, remoteAddress8 uint32, remoteAddress9 uint32, remoteAddress10 uint32, remoteAddress11 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-listen //go:noescape -func wasmimport_TCPSocketStartListen(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketStartListen(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.subscribe //go:noescape -func wasmimport_TCPSocketSubscribe(self0 uint32) (result0 uint32) +func wasmimport_TCPSocketSubscribe(self0 uint32) diff --git a/examples/component/http-password-checker/gen/wasi/sockets/tcp/tcp.wit.go b/examples/component/http-password-checker/gen/wasi/sockets/tcp/tcp.wit.go index c033e23a..737969cc 100755 --- a/examples/component/http-password-checker/gen/wasi/sockets/tcp/tcp.wit.go +++ b/examples/component/http-password-checker/gen/wasi/sockets/tcp/tcp.wit.go @@ -95,326 +95,321 @@ func (self TCPSocket) ResourceDrop() { // Accept represents the imported method "accept". // -// accept: func() -> result, error-code> +// accept: func() // //go:nosplit -func (self TCPSocket) Accept() (result cm.Result[TupleTCPSocketInputStreamOutputStreamShape, cm.Tuple3[TCPSocket, InputStream, OutputStream], ErrorCode]) { +func (self TCPSocket) Accept() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketAccept((uint32)(self0), &result) + wasmimport_TCPSocketAccept((uint32)(self0)) return } // AddressFamily represents the imported method "address-family". // -// address-family: func() -> ip-address-family +// address-family: func() // //go:nosplit -func (self TCPSocket) AddressFamily() (result IPAddressFamily) { +func (self TCPSocket) AddressFamily() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_TCPSocketAddressFamily((uint32)(self0)) - result = (network.IPAddressFamily)((uint32)(result0)) + wasmimport_TCPSocketAddressFamily((uint32)(self0)) return } // FinishBind represents the imported method "finish-bind". // -// finish-bind: func() -> result<_, error-code> +// finish-bind: func() // //go:nosplit -func (self TCPSocket) FinishBind() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) FinishBind() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketFinishBind((uint32)(self0), &result) + wasmimport_TCPSocketFinishBind((uint32)(self0)) return } // FinishConnect represents the imported method "finish-connect". // -// finish-connect: func() -> result, error-code> +// finish-connect: func() // //go:nosplit -func (self TCPSocket) FinishConnect() (result cm.Result[TupleInputStreamOutputStreamShape, cm.Tuple[InputStream, OutputStream], ErrorCode]) { +func (self TCPSocket) FinishConnect() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketFinishConnect((uint32)(self0), &result) + wasmimport_TCPSocketFinishConnect((uint32)(self0)) return } // FinishListen represents the imported method "finish-listen". // -// finish-listen: func() -> result<_, error-code> +// finish-listen: func() // //go:nosplit -func (self TCPSocket) FinishListen() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) FinishListen() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketFinishListen((uint32)(self0), &result) + wasmimport_TCPSocketFinishListen((uint32)(self0)) return } // HopLimit represents the imported method "hop-limit". // -// hop-limit: func() -> result +// hop-limit: func() // //go:nosplit -func (self TCPSocket) HopLimit() (result cm.Result[uint8, uint8, ErrorCode]) { +func (self TCPSocket) HopLimit() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketHopLimit((uint32)(self0), &result) + wasmimport_TCPSocketHopLimit((uint32)(self0)) return } // IsListening represents the imported method "is-listening". // -// is-listening: func() -> bool +// is-listening: func() // //go:nosplit -func (self TCPSocket) IsListening() (result bool) { +func (self TCPSocket) IsListening() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_TCPSocketIsListening((uint32)(self0)) - result = (bool)(cm.U32ToBool((uint32)(result0))) + wasmimport_TCPSocketIsListening((uint32)(self0)) return } // KeepAliveCount represents the imported method "keep-alive-count". // -// keep-alive-count: func() -> result +// keep-alive-count: func() // //go:nosplit -func (self TCPSocket) KeepAliveCount() (result cm.Result[uint32, uint32, ErrorCode]) { +func (self TCPSocket) KeepAliveCount() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveCount((uint32)(self0), &result) + wasmimport_TCPSocketKeepAliveCount((uint32)(self0)) return } // KeepAliveEnabled represents the imported method "keep-alive-enabled". // -// keep-alive-enabled: func() -> result +// keep-alive-enabled: func() // //go:nosplit -func (self TCPSocket) KeepAliveEnabled() (result cm.Result[bool, bool, ErrorCode]) { +func (self TCPSocket) KeepAliveEnabled() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveEnabled((uint32)(self0), &result) + wasmimport_TCPSocketKeepAliveEnabled((uint32)(self0)) return } // KeepAliveIdleTime represents the imported method "keep-alive-idle-time". // -// keep-alive-idle-time: func() -> result +// keep-alive-idle-time: func() // //go:nosplit -func (self TCPSocket) KeepAliveIdleTime() (result cm.Result[uint64, Duration, ErrorCode]) { +func (self TCPSocket) KeepAliveIdleTime() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveIdleTime((uint32)(self0), &result) + wasmimport_TCPSocketKeepAliveIdleTime((uint32)(self0)) return } // KeepAliveInterval represents the imported method "keep-alive-interval". // -// keep-alive-interval: func() -> result +// keep-alive-interval: func() // //go:nosplit -func (self TCPSocket) KeepAliveInterval() (result cm.Result[uint64, Duration, ErrorCode]) { +func (self TCPSocket) KeepAliveInterval() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveInterval((uint32)(self0), &result) + wasmimport_TCPSocketKeepAliveInterval((uint32)(self0)) return } // LocalAddress represents the imported method "local-address". // -// local-address: func() -> result +// local-address: func() // //go:nosplit -func (self TCPSocket) LocalAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) { +func (self TCPSocket) LocalAddress() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketLocalAddress((uint32)(self0), &result) + wasmimport_TCPSocketLocalAddress((uint32)(self0)) return } // ReceiveBufferSize represents the imported method "receive-buffer-size". // -// receive-buffer-size: func() -> result +// receive-buffer-size: func() // //go:nosplit -func (self TCPSocket) ReceiveBufferSize() (result cm.Result[uint64, uint64, ErrorCode]) { +func (self TCPSocket) ReceiveBufferSize() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketReceiveBufferSize((uint32)(self0), &result) + wasmimport_TCPSocketReceiveBufferSize((uint32)(self0)) return } // RemoteAddress represents the imported method "remote-address". // -// remote-address: func() -> result +// remote-address: func() // //go:nosplit -func (self TCPSocket) RemoteAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) { +func (self TCPSocket) RemoteAddress() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketRemoteAddress((uint32)(self0), &result) + wasmimport_TCPSocketRemoteAddress((uint32)(self0)) return } // SendBufferSize represents the imported method "send-buffer-size". // -// send-buffer-size: func() -> result +// send-buffer-size: func() // //go:nosplit -func (self TCPSocket) SendBufferSize() (result cm.Result[uint64, uint64, ErrorCode]) { +func (self TCPSocket) SendBufferSize() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketSendBufferSize((uint32)(self0), &result) + wasmimport_TCPSocketSendBufferSize((uint32)(self0)) return } // SetHopLimit represents the imported method "set-hop-limit". // -// set-hop-limit: func(value: u8) -> result<_, error-code> +// set-hop-limit: func(value: u8) // //go:nosplit -func (self TCPSocket) SetHopLimit(value uint8) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetHopLimit(value uint8) { self0 := cm.Reinterpret[uint32](self) value0 := (uint32)(value) - wasmimport_TCPSocketSetHopLimit((uint32)(self0), (uint32)(value0), &result) + wasmimport_TCPSocketSetHopLimit((uint32)(self0), (uint32)(value0)) return } // SetKeepAliveCount represents the imported method "set-keep-alive-count". // -// set-keep-alive-count: func(value: u32) -> result<_, error-code> +// set-keep-alive-count: func(value: u32) // //go:nosplit -func (self TCPSocket) SetKeepAliveCount(value uint32) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetKeepAliveCount(value uint32) { self0 := cm.Reinterpret[uint32](self) value0 := (uint32)(value) - wasmimport_TCPSocketSetKeepAliveCount((uint32)(self0), (uint32)(value0), &result) + wasmimport_TCPSocketSetKeepAliveCount((uint32)(self0), (uint32)(value0)) return } // SetKeepAliveEnabled represents the imported method "set-keep-alive-enabled". // -// set-keep-alive-enabled: func(value: bool) -> result<_, error-code> +// set-keep-alive-enabled: func(value: bool) // //go:nosplit -func (self TCPSocket) SetKeepAliveEnabled(value bool) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetKeepAliveEnabled(value bool) { self0 := cm.Reinterpret[uint32](self) value0 := (uint32)(cm.BoolToU32(value)) - wasmimport_TCPSocketSetKeepAliveEnabled((uint32)(self0), (uint32)(value0), &result) + wasmimport_TCPSocketSetKeepAliveEnabled((uint32)(self0), (uint32)(value0)) return } // SetKeepAliveIdleTime represents the imported method "set-keep-alive-idle-time". // -// set-keep-alive-idle-time: func(value: duration) -> result<_, error-code> +// set-keep-alive-idle-time: func(value: duration) // //go:nosplit -func (self TCPSocket) SetKeepAliveIdleTime(value Duration) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetKeepAliveIdleTime(value Duration) { self0 := cm.Reinterpret[uint32](self) value0 := (uint64)(value) - wasmimport_TCPSocketSetKeepAliveIdleTime((uint32)(self0), (uint64)(value0), &result) + wasmimport_TCPSocketSetKeepAliveIdleTime((uint32)(self0), (uint64)(value0)) return } // SetKeepAliveInterval represents the imported method "set-keep-alive-interval". // -// set-keep-alive-interval: func(value: duration) -> result<_, error-code> +// set-keep-alive-interval: func(value: duration) // //go:nosplit -func (self TCPSocket) SetKeepAliveInterval(value Duration) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetKeepAliveInterval(value Duration) { self0 := cm.Reinterpret[uint32](self) value0 := (uint64)(value) - wasmimport_TCPSocketSetKeepAliveInterval((uint32)(self0), (uint64)(value0), &result) + wasmimport_TCPSocketSetKeepAliveInterval((uint32)(self0), (uint64)(value0)) return } // SetListenBacklogSize represents the imported method "set-listen-backlog-size". // -// set-listen-backlog-size: func(value: u64) -> result<_, error-code> +// set-listen-backlog-size: func(value: u64) // //go:nosplit -func (self TCPSocket) SetListenBacklogSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetListenBacklogSize(value uint64) { self0 := cm.Reinterpret[uint32](self) value0 := (uint64)(value) - wasmimport_TCPSocketSetListenBacklogSize((uint32)(self0), (uint64)(value0), &result) + wasmimport_TCPSocketSetListenBacklogSize((uint32)(self0), (uint64)(value0)) return } // SetReceiveBufferSize represents the imported method "set-receive-buffer-size". // -// set-receive-buffer-size: func(value: u64) -> result<_, error-code> +// set-receive-buffer-size: func(value: u64) // //go:nosplit -func (self TCPSocket) SetReceiveBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetReceiveBufferSize(value uint64) { self0 := cm.Reinterpret[uint32](self) value0 := (uint64)(value) - wasmimport_TCPSocketSetReceiveBufferSize((uint32)(self0), (uint64)(value0), &result) + wasmimport_TCPSocketSetReceiveBufferSize((uint32)(self0), (uint64)(value0)) return } // SetSendBufferSize represents the imported method "set-send-buffer-size". // -// set-send-buffer-size: func(value: u64) -> result<_, error-code> +// set-send-buffer-size: func(value: u64) // //go:nosplit -func (self TCPSocket) SetSendBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetSendBufferSize(value uint64) { self0 := cm.Reinterpret[uint32](self) value0 := (uint64)(value) - wasmimport_TCPSocketSetSendBufferSize((uint32)(self0), (uint64)(value0), &result) + wasmimport_TCPSocketSetSendBufferSize((uint32)(self0), (uint64)(value0)) return } // Shutdown represents the imported method "shutdown". // -// shutdown: func(shutdown-type: shutdown-type) -> result<_, error-code> +// shutdown: func(shutdown-type: shutdown-type) // //go:nosplit -func (self TCPSocket) Shutdown(shutdownType ShutdownType) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) Shutdown(shutdownType ShutdownType) { self0 := cm.Reinterpret[uint32](self) shutdownType0 := (uint32)(shutdownType) - wasmimport_TCPSocketShutdown((uint32)(self0), (uint32)(shutdownType0), &result) + wasmimport_TCPSocketShutdown((uint32)(self0), (uint32)(shutdownType0)) return } // StartBind represents the imported method "start-bind". // -// start-bind: func(network: borrow, local-address: ip-socket-address) -> -// result<_, error-code> +// start-bind: func(network: borrow, local-address: ip-socket-address) // //go:nosplit -func (self TCPSocket) StartBind(network_ Network, localAddress IPSocketAddress) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) StartBind(network_ Network, localAddress IPSocketAddress) { self0 := cm.Reinterpret[uint32](self) network0 := cm.Reinterpret[uint32](network_) localAddress0, localAddress1, localAddress2, localAddress3, localAddress4, localAddress5, localAddress6, localAddress7, localAddress8, localAddress9, localAddress10, localAddress11 := lower_IPSocketAddress(localAddress) - wasmimport_TCPSocketStartBind((uint32)(self0), (uint32)(network0), (uint32)(localAddress0), (uint32)(localAddress1), (uint32)(localAddress2), (uint32)(localAddress3), (uint32)(localAddress4), (uint32)(localAddress5), (uint32)(localAddress6), (uint32)(localAddress7), (uint32)(localAddress8), (uint32)(localAddress9), (uint32)(localAddress10), (uint32)(localAddress11), &result) + wasmimport_TCPSocketStartBind((uint32)(self0), (uint32)(network0), (uint32)(localAddress0), (uint32)(localAddress1), (uint32)(localAddress2), (uint32)(localAddress3), (uint32)(localAddress4), (uint32)(localAddress5), (uint32)(localAddress6), (uint32)(localAddress7), (uint32)(localAddress8), (uint32)(localAddress9), (uint32)(localAddress10), (uint32)(localAddress11)) return } // StartConnect represents the imported method "start-connect". // // start-connect: func(network: borrow, remote-address: ip-socket-address) -// -> result<_, error-code> // //go:nosplit -func (self TCPSocket) StartConnect(network_ Network, remoteAddress IPSocketAddress) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) StartConnect(network_ Network, remoteAddress IPSocketAddress) { self0 := cm.Reinterpret[uint32](self) network0 := cm.Reinterpret[uint32](network_) remoteAddress0, remoteAddress1, remoteAddress2, remoteAddress3, remoteAddress4, remoteAddress5, remoteAddress6, remoteAddress7, remoteAddress8, remoteAddress9, remoteAddress10, remoteAddress11 := lower_IPSocketAddress(remoteAddress) - wasmimport_TCPSocketStartConnect((uint32)(self0), (uint32)(network0), (uint32)(remoteAddress0), (uint32)(remoteAddress1), (uint32)(remoteAddress2), (uint32)(remoteAddress3), (uint32)(remoteAddress4), (uint32)(remoteAddress5), (uint32)(remoteAddress6), (uint32)(remoteAddress7), (uint32)(remoteAddress8), (uint32)(remoteAddress9), (uint32)(remoteAddress10), (uint32)(remoteAddress11), &result) + wasmimport_TCPSocketStartConnect((uint32)(self0), (uint32)(network0), (uint32)(remoteAddress0), (uint32)(remoteAddress1), (uint32)(remoteAddress2), (uint32)(remoteAddress3), (uint32)(remoteAddress4), (uint32)(remoteAddress5), (uint32)(remoteAddress6), (uint32)(remoteAddress7), (uint32)(remoteAddress8), (uint32)(remoteAddress9), (uint32)(remoteAddress10), (uint32)(remoteAddress11)) return } // StartListen represents the imported method "start-listen". // -// start-listen: func() -> result<_, error-code> +// start-listen: func() // //go:nosplit -func (self TCPSocket) StartListen() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) StartListen() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketStartListen((uint32)(self0), &result) + wasmimport_TCPSocketStartListen((uint32)(self0)) return } // Subscribe represents the imported method "subscribe". // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self TCPSocket) Subscribe() (result Pollable) { +func (self TCPSocket) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_TCPSocketSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_TCPSocketSubscribe((uint32)(self0)) return } diff --git a/examples/component/http-password-checker/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go b/examples/component/http-password-checker/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go index 45c76624..693307e4 100755 --- a/examples/component/http-password-checker/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go +++ b/examples/component/http-password-checker/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go @@ -4,7 +4,6 @@ package udpcreatesocket import ( - "go.bytecodealliance.org/cm" "http-password-checker/gen/wasi/sockets/network" "http-password-checker/gen/wasi/sockets/udp" ) @@ -31,12 +30,11 @@ type UDPSocket = udp.UDPSocket // CreateUDPSocket represents the imported function "create-udp-socket". // -// create-udp-socket: func(address-family: ip-address-family) -> result +// create-udp-socket: func(address-family: ip-address-family) // //go:nosplit -func CreateUDPSocket(addressFamily IPAddressFamily) (result cm.Result[UDPSocket, UDPSocket, ErrorCode]) { +func CreateUDPSocket(addressFamily IPAddressFamily) { addressFamily0 := (uint32)(addressFamily) - wasmimport_CreateUDPSocket((uint32)(addressFamily0), &result) + wasmimport_CreateUDPSocket((uint32)(addressFamily0)) return } diff --git a/examples/component/http-password-checker/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go b/examples/component/http-password-checker/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go index 94b1ab67..dfe49e18 100755 --- a/examples/component/http-password-checker/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go +++ b/examples/component/http-password-checker/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go @@ -2,12 +2,8 @@ package udpcreatesocket -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". //go:wasmimport wasi:sockets/udp-create-socket@0.2.0 create-udp-socket //go:noescape -func wasmimport_CreateUDPSocket(addressFamily0 uint32, result *cm.Result[UDPSocket, UDPSocket, ErrorCode]) +func wasmimport_CreateUDPSocket(addressFamily0 uint32) diff --git a/examples/component/http-password-checker/gen/wasi/sockets/udp/abi.go b/examples/component/http-password-checker/gen/wasi/sockets/udp/abi.go index eb3b605d..b1537c04 100755 --- a/examples/component/http-password-checker/gen/wasi/sockets/udp/abi.go +++ b/examples/component/http-password-checker/gen/wasi/sockets/udp/abi.go @@ -5,15 +5,8 @@ package udp import ( "go.bytecodealliance.org/cm" "http-password-checker/gen/wasi/sockets/network" - "unsafe" ) -// IPSocketAddressShape is used for storage in variant or result types. -type IPSocketAddressShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(network.IPSocketAddress{})]byte -} - func lower_IPv4Address(v network.IPv4Address) (f0 uint32, f1 uint32, f2 uint32, f3 uint32) { f0 = (uint32)(v[0]) f1 = (uint32)(v[1]) @@ -75,12 +68,6 @@ func lower_IPSocketAddress(v network.IPSocketAddress) (f0 uint32, f1 uint32, f2 return } -// TupleIncomingDatagramStreamOutgoingDatagramStreamShape is used for storage in variant or result types. -type TupleIncomingDatagramStreamOutgoingDatagramStreamShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Tuple[IncomingDatagramStream, OutgoingDatagramStream]{})]byte -} - func lower_OptionIPSocketAddress(v cm.Option[IPSocketAddress]) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32, f11 uint32, f12 uint32) { some := v.Some() if some != nil { diff --git a/examples/component/http-password-checker/gen/wasi/sockets/udp/udp.wasm.go b/examples/component/http-password-checker/gen/wasi/sockets/udp/udp.wasm.go index 83ce8ca7..0b0fd6ba 100755 --- a/examples/component/http-password-checker/gen/wasi/sockets/udp/udp.wasm.go +++ b/examples/component/http-password-checker/gen/wasi/sockets/udp/udp.wasm.go @@ -2,10 +2,6 @@ package udp -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". //go:wasmimport wasi:sockets/udp@0.2.0 [resource-drop]udp-socket @@ -14,55 +10,55 @@ func wasmimport_UDPSocketResourceDrop(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.address-family //go:noescape -func wasmimport_UDPSocketAddressFamily(self0 uint32) (result0 uint32) +func wasmimport_UDPSocketAddressFamily(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.finish-bind //go:noescape -func wasmimport_UDPSocketFinishBind(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_UDPSocketFinishBind(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.local-address //go:noescape -func wasmimport_UDPSocketLocalAddress(self0 uint32, result *cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) +func wasmimport_UDPSocketLocalAddress(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.receive-buffer-size //go:noescape -func wasmimport_UDPSocketReceiveBufferSize(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) +func wasmimport_UDPSocketReceiveBufferSize(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.remote-address //go:noescape -func wasmimport_UDPSocketRemoteAddress(self0 uint32, result *cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) +func wasmimport_UDPSocketRemoteAddress(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.send-buffer-size //go:noescape -func wasmimport_UDPSocketSendBufferSize(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) +func wasmimport_UDPSocketSendBufferSize(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.set-receive-buffer-size //go:noescape -func wasmimport_UDPSocketSetReceiveBufferSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_UDPSocketSetReceiveBufferSize(self0 uint32, value0 uint64) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.set-send-buffer-size //go:noescape -func wasmimport_UDPSocketSetSendBufferSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_UDPSocketSetSendBufferSize(self0 uint32, value0 uint64) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.set-unicast-hop-limit //go:noescape -func wasmimport_UDPSocketSetUnicastHopLimit(self0 uint32, value0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_UDPSocketSetUnicastHopLimit(self0 uint32, value0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.start-bind //go:noescape -func wasmimport_UDPSocketStartBind(self0 uint32, network0 uint32, localAddress0 uint32, localAddress1 uint32, localAddress2 uint32, localAddress3 uint32, localAddress4 uint32, localAddress5 uint32, localAddress6 uint32, localAddress7 uint32, localAddress8 uint32, localAddress9 uint32, localAddress10 uint32, localAddress11 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_UDPSocketStartBind(self0 uint32, network0 uint32, localAddress0 uint32, localAddress1 uint32, localAddress2 uint32, localAddress3 uint32, localAddress4 uint32, localAddress5 uint32, localAddress6 uint32, localAddress7 uint32, localAddress8 uint32, localAddress9 uint32, localAddress10 uint32, localAddress11 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.stream //go:noescape -func wasmimport_UDPSocketStream(self0 uint32, remoteAddress0 uint32, remoteAddress1 uint32, remoteAddress2 uint32, remoteAddress3 uint32, remoteAddress4 uint32, remoteAddress5 uint32, remoteAddress6 uint32, remoteAddress7 uint32, remoteAddress8 uint32, remoteAddress9 uint32, remoteAddress10 uint32, remoteAddress11 uint32, remoteAddress12 uint32, result *cm.Result[TupleIncomingDatagramStreamOutgoingDatagramStreamShape, cm.Tuple[IncomingDatagramStream, OutgoingDatagramStream], ErrorCode]) +func wasmimport_UDPSocketStream(self0 uint32, remoteAddress0 uint32, remoteAddress1 uint32, remoteAddress2 uint32, remoteAddress3 uint32, remoteAddress4 uint32, remoteAddress5 uint32, remoteAddress6 uint32, remoteAddress7 uint32, remoteAddress8 uint32, remoteAddress9 uint32, remoteAddress10 uint32, remoteAddress11 uint32, remoteAddress12 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.subscribe //go:noescape -func wasmimport_UDPSocketSubscribe(self0 uint32) (result0 uint32) +func wasmimport_UDPSocketSubscribe(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.unicast-hop-limit //go:noescape -func wasmimport_UDPSocketUnicastHopLimit(self0 uint32, result *cm.Result[uint8, uint8, ErrorCode]) +func wasmimport_UDPSocketUnicastHopLimit(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [resource-drop]incoming-datagram-stream //go:noescape @@ -70,11 +66,11 @@ func wasmimport_IncomingDatagramStreamResourceDrop(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]incoming-datagram-stream.receive //go:noescape -func wasmimport_IncomingDatagramStreamReceive(self0 uint32, maxResults0 uint64, result *cm.Result[cm.List[IncomingDatagram], cm.List[IncomingDatagram], ErrorCode]) +func wasmimport_IncomingDatagramStreamReceive(self0 uint32, maxResults0 uint64) //go:wasmimport wasi:sockets/udp@0.2.0 [method]incoming-datagram-stream.subscribe //go:noescape -func wasmimport_IncomingDatagramStreamSubscribe(self0 uint32) (result0 uint32) +func wasmimport_IncomingDatagramStreamSubscribe(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [resource-drop]outgoing-datagram-stream //go:noescape @@ -82,12 +78,12 @@ func wasmimport_OutgoingDatagramStreamResourceDrop(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]outgoing-datagram-stream.check-send //go:noescape -func wasmimport_OutgoingDatagramStreamCheckSend(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) +func wasmimport_OutgoingDatagramStreamCheckSend(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]outgoing-datagram-stream.send //go:noescape -func wasmimport_OutgoingDatagramStreamSend(self0 uint32, datagrams0 *OutgoingDatagram, datagrams1 uint32, result *cm.Result[uint64, uint64, ErrorCode]) +func wasmimport_OutgoingDatagramStreamSend(self0 uint32, datagrams0 *OutgoingDatagram, datagrams1 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]outgoing-datagram-stream.subscribe //go:noescape -func wasmimport_OutgoingDatagramStreamSubscribe(self0 uint32) (result0 uint32) +func wasmimport_OutgoingDatagramStreamSubscribe(self0 uint32) diff --git a/examples/component/http-password-checker/gen/wasi/sockets/udp/udp.wit.go b/examples/component/http-password-checker/gen/wasi/sockets/udp/udp.wit.go index c847e037..92595d42 100755 --- a/examples/component/http-password-checker/gen/wasi/sockets/udp/udp.wit.go +++ b/examples/component/http-password-checker/gen/wasi/sockets/udp/udp.wit.go @@ -76,154 +76,150 @@ func (self UDPSocket) ResourceDrop() { // AddressFamily represents the imported method "address-family". // -// address-family: func() -> ip-address-family +// address-family: func() // //go:nosplit -func (self UDPSocket) AddressFamily() (result IPAddressFamily) { +func (self UDPSocket) AddressFamily() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_UDPSocketAddressFamily((uint32)(self0)) - result = (network.IPAddressFamily)((uint32)(result0)) + wasmimport_UDPSocketAddressFamily((uint32)(self0)) return } // FinishBind represents the imported method "finish-bind". // -// finish-bind: func() -> result<_, error-code> +// finish-bind: func() // //go:nosplit -func (self UDPSocket) FinishBind() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self UDPSocket) FinishBind() { self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketFinishBind((uint32)(self0), &result) + wasmimport_UDPSocketFinishBind((uint32)(self0)) return } // LocalAddress represents the imported method "local-address". // -// local-address: func() -> result +// local-address: func() // //go:nosplit -func (self UDPSocket) LocalAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) { +func (self UDPSocket) LocalAddress() { self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketLocalAddress((uint32)(self0), &result) + wasmimport_UDPSocketLocalAddress((uint32)(self0)) return } // ReceiveBufferSize represents the imported method "receive-buffer-size". // -// receive-buffer-size: func() -> result +// receive-buffer-size: func() // //go:nosplit -func (self UDPSocket) ReceiveBufferSize() (result cm.Result[uint64, uint64, ErrorCode]) { +func (self UDPSocket) ReceiveBufferSize() { self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketReceiveBufferSize((uint32)(self0), &result) + wasmimport_UDPSocketReceiveBufferSize((uint32)(self0)) return } // RemoteAddress represents the imported method "remote-address". // -// remote-address: func() -> result +// remote-address: func() // //go:nosplit -func (self UDPSocket) RemoteAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) { +func (self UDPSocket) RemoteAddress() { self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketRemoteAddress((uint32)(self0), &result) + wasmimport_UDPSocketRemoteAddress((uint32)(self0)) return } // SendBufferSize represents the imported method "send-buffer-size". // -// send-buffer-size: func() -> result +// send-buffer-size: func() // //go:nosplit -func (self UDPSocket) SendBufferSize() (result cm.Result[uint64, uint64, ErrorCode]) { +func (self UDPSocket) SendBufferSize() { self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketSendBufferSize((uint32)(self0), &result) + wasmimport_UDPSocketSendBufferSize((uint32)(self0)) return } // SetReceiveBufferSize represents the imported method "set-receive-buffer-size". // -// set-receive-buffer-size: func(value: u64) -> result<_, error-code> +// set-receive-buffer-size: func(value: u64) // //go:nosplit -func (self UDPSocket) SetReceiveBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self UDPSocket) SetReceiveBufferSize(value uint64) { self0 := cm.Reinterpret[uint32](self) value0 := (uint64)(value) - wasmimport_UDPSocketSetReceiveBufferSize((uint32)(self0), (uint64)(value0), &result) + wasmimport_UDPSocketSetReceiveBufferSize((uint32)(self0), (uint64)(value0)) return } // SetSendBufferSize represents the imported method "set-send-buffer-size". // -// set-send-buffer-size: func(value: u64) -> result<_, error-code> +// set-send-buffer-size: func(value: u64) // //go:nosplit -func (self UDPSocket) SetSendBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self UDPSocket) SetSendBufferSize(value uint64) { self0 := cm.Reinterpret[uint32](self) value0 := (uint64)(value) - wasmimport_UDPSocketSetSendBufferSize((uint32)(self0), (uint64)(value0), &result) + wasmimport_UDPSocketSetSendBufferSize((uint32)(self0), (uint64)(value0)) return } // SetUnicastHopLimit represents the imported method "set-unicast-hop-limit". // -// set-unicast-hop-limit: func(value: u8) -> result<_, error-code> +// set-unicast-hop-limit: func(value: u8) // //go:nosplit -func (self UDPSocket) SetUnicastHopLimit(value uint8) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self UDPSocket) SetUnicastHopLimit(value uint8) { self0 := cm.Reinterpret[uint32](self) value0 := (uint32)(value) - wasmimport_UDPSocketSetUnicastHopLimit((uint32)(self0), (uint32)(value0), &result) + wasmimport_UDPSocketSetUnicastHopLimit((uint32)(self0), (uint32)(value0)) return } // StartBind represents the imported method "start-bind". // -// start-bind: func(network: borrow, local-address: ip-socket-address) -> -// result<_, error-code> +// start-bind: func(network: borrow, local-address: ip-socket-address) // //go:nosplit -func (self UDPSocket) StartBind(network_ Network, localAddress IPSocketAddress) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self UDPSocket) StartBind(network_ Network, localAddress IPSocketAddress) { self0 := cm.Reinterpret[uint32](self) network0 := cm.Reinterpret[uint32](network_) localAddress0, localAddress1, localAddress2, localAddress3, localAddress4, localAddress5, localAddress6, localAddress7, localAddress8, localAddress9, localAddress10, localAddress11 := lower_IPSocketAddress(localAddress) - wasmimport_UDPSocketStartBind((uint32)(self0), (uint32)(network0), (uint32)(localAddress0), (uint32)(localAddress1), (uint32)(localAddress2), (uint32)(localAddress3), (uint32)(localAddress4), (uint32)(localAddress5), (uint32)(localAddress6), (uint32)(localAddress7), (uint32)(localAddress8), (uint32)(localAddress9), (uint32)(localAddress10), (uint32)(localAddress11), &result) + wasmimport_UDPSocketStartBind((uint32)(self0), (uint32)(network0), (uint32)(localAddress0), (uint32)(localAddress1), (uint32)(localAddress2), (uint32)(localAddress3), (uint32)(localAddress4), (uint32)(localAddress5), (uint32)(localAddress6), (uint32)(localAddress7), (uint32)(localAddress8), (uint32)(localAddress9), (uint32)(localAddress10), (uint32)(localAddress11)) return } // Stream represents the imported method "stream". // -// %stream: func(remote-address: option) -> result, error-code> +// %stream: func(remote-address: option) // //go:nosplit -func (self UDPSocket) Stream(remoteAddress cm.Option[IPSocketAddress]) (result cm.Result[TupleIncomingDatagramStreamOutgoingDatagramStreamShape, cm.Tuple[IncomingDatagramStream, OutgoingDatagramStream], ErrorCode]) { +func (self UDPSocket) Stream(remoteAddress cm.Option[IPSocketAddress]) { self0 := cm.Reinterpret[uint32](self) remoteAddress0, remoteAddress1, remoteAddress2, remoteAddress3, remoteAddress4, remoteAddress5, remoteAddress6, remoteAddress7, remoteAddress8, remoteAddress9, remoteAddress10, remoteAddress11, remoteAddress12 := lower_OptionIPSocketAddress(remoteAddress) - wasmimport_UDPSocketStream((uint32)(self0), (uint32)(remoteAddress0), (uint32)(remoteAddress1), (uint32)(remoteAddress2), (uint32)(remoteAddress3), (uint32)(remoteAddress4), (uint32)(remoteAddress5), (uint32)(remoteAddress6), (uint32)(remoteAddress7), (uint32)(remoteAddress8), (uint32)(remoteAddress9), (uint32)(remoteAddress10), (uint32)(remoteAddress11), (uint32)(remoteAddress12), &result) + wasmimport_UDPSocketStream((uint32)(self0), (uint32)(remoteAddress0), (uint32)(remoteAddress1), (uint32)(remoteAddress2), (uint32)(remoteAddress3), (uint32)(remoteAddress4), (uint32)(remoteAddress5), (uint32)(remoteAddress6), (uint32)(remoteAddress7), (uint32)(remoteAddress8), (uint32)(remoteAddress9), (uint32)(remoteAddress10), (uint32)(remoteAddress11), (uint32)(remoteAddress12)) return } // Subscribe represents the imported method "subscribe". // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self UDPSocket) Subscribe() (result Pollable) { +func (self UDPSocket) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_UDPSocketSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_UDPSocketSubscribe((uint32)(self0)) return } // UnicastHopLimit represents the imported method "unicast-hop-limit". // -// unicast-hop-limit: func() -> result +// unicast-hop-limit: func() // //go:nosplit -func (self UDPSocket) UnicastHopLimit() (result cm.Result[uint8, uint8, ErrorCode]) { +func (self UDPSocket) UnicastHopLimit() { self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketUnicastHopLimit((uint32)(self0), &result) + wasmimport_UDPSocketUnicastHopLimit((uint32)(self0)) return } @@ -245,25 +241,24 @@ func (self IncomingDatagramStream) ResourceDrop() { // Receive represents the imported method "receive". // -// receive: func(max-results: u64) -> result, error-code> +// receive: func(max-results: u64) // //go:nosplit -func (self IncomingDatagramStream) Receive(maxResults uint64) (result cm.Result[cm.List[IncomingDatagram], cm.List[IncomingDatagram], ErrorCode]) { +func (self IncomingDatagramStream) Receive(maxResults uint64) { self0 := cm.Reinterpret[uint32](self) maxResults0 := (uint64)(maxResults) - wasmimport_IncomingDatagramStreamReceive((uint32)(self0), (uint64)(maxResults0), &result) + wasmimport_IncomingDatagramStreamReceive((uint32)(self0), (uint64)(maxResults0)) return } // Subscribe represents the imported method "subscribe". // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self IncomingDatagramStream) Subscribe() (result Pollable) { +func (self IncomingDatagramStream) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_IncomingDatagramStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_IncomingDatagramStreamSubscribe((uint32)(self0)) return } @@ -285,35 +280,34 @@ func (self OutgoingDatagramStream) ResourceDrop() { // CheckSend represents the imported method "check-send". // -// check-send: func() -> result +// check-send: func() // //go:nosplit -func (self OutgoingDatagramStream) CheckSend() (result cm.Result[uint64, uint64, ErrorCode]) { +func (self OutgoingDatagramStream) CheckSend() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingDatagramStreamCheckSend((uint32)(self0), &result) + wasmimport_OutgoingDatagramStreamCheckSend((uint32)(self0)) return } // Send represents the imported method "send". // -// send: func(datagrams: list) -> result +// send: func(datagrams: list) // //go:nosplit -func (self OutgoingDatagramStream) Send(datagrams cm.List[OutgoingDatagram]) (result cm.Result[uint64, uint64, ErrorCode]) { +func (self OutgoingDatagramStream) Send(datagrams cm.List[OutgoingDatagram]) { self0 := cm.Reinterpret[uint32](self) datagrams0, datagrams1 := cm.LowerList(datagrams) - wasmimport_OutgoingDatagramStreamSend((uint32)(self0), (*OutgoingDatagram)(datagrams0), (uint32)(datagrams1), &result) + wasmimport_OutgoingDatagramStreamSend((uint32)(self0), (*OutgoingDatagram)(datagrams0), (uint32)(datagrams1)) return } // Subscribe represents the imported method "subscribe". // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self OutgoingDatagramStream) Subscribe() (result Pollable) { +func (self OutgoingDatagramStream) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutgoingDatagramStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_OutgoingDatagramStreamSubscribe((uint32)(self0)) return } diff --git a/examples/component/http-password-checker/gen/wasmcloud/bus/lattice/lattice.wasm.go b/examples/component/http-password-checker/gen/wasmcloud/bus/lattice/lattice.wasm.go index 7c7b9094..6c044549 100755 --- a/examples/component/http-password-checker/gen/wasmcloud/bus/lattice/lattice.wasm.go +++ b/examples/component/http-password-checker/gen/wasmcloud/bus/lattice/lattice.wasm.go @@ -10,7 +10,7 @@ func wasmimport_CallTargetInterfaceResourceDrop(self0 uint32) //go:wasmimport wasmcloud:bus/lattice@1.0.0 [constructor]call-target-interface //go:noescape -func wasmimport_NewCallTargetInterface(namespace0 *uint8, namespace1 uint32, package0 *uint8, package1 uint32, interface0 *uint8, interface1 uint32) (result0 uint32) +func wasmimport_NewCallTargetInterface(namespace0 *uint8, namespace1 uint32, package0 *uint8, package1 uint32, interface0 *uint8, interface1 uint32) //go:wasmimport wasmcloud:bus/lattice@1.0.0 set-link-name //go:noescape diff --git a/examples/component/http-password-checker/gen/wasmcloud/bus/lattice/lattice.wit.go b/examples/component/http-password-checker/gen/wasmcloud/bus/lattice/lattice.wit.go index ba34d30c..af5d44b6 100755 --- a/examples/component/http-password-checker/gen/wasmcloud/bus/lattice/lattice.wit.go +++ b/examples/component/http-password-checker/gen/wasmcloud/bus/lattice/lattice.wit.go @@ -28,12 +28,11 @@ func (self CallTargetInterface) ResourceDrop() { // constructor(namespace: string, %package: string, %interface: string) // //go:nosplit -func NewCallTargetInterface(namespace string, package_ string, interface_ string) (result CallTargetInterface) { +func NewCallTargetInterface(namespace string, package_ string, interface_ string) { namespace0, namespace1 := cm.LowerString(namespace) package0, package1 := cm.LowerString(package_) interface0, interface1 := cm.LowerString(interface_) - result0 := wasmimport_NewCallTargetInterface((*uint8)(namespace0), (uint32)(namespace1), (*uint8)(package0), (uint32)(package1), (*uint8)(interface0), (uint32)(interface1)) - result = cm.Reinterpret[CallTargetInterface]((uint32)(result0)) + wasmimport_NewCallTargetInterface((*uint8)(namespace0), (uint32)(namespace1), (*uint8)(package0), (uint32)(package1), (*uint8)(interface0), (uint32)(interface1)) return } diff --git a/examples/component/http-password-checker/gen/wasmcloud/secrets/reveal/reveal.wasm.go b/examples/component/http-password-checker/gen/wasmcloud/secrets/reveal/reveal.wasm.go index 65404eb3..a6d83174 100755 --- a/examples/component/http-password-checker/gen/wasmcloud/secrets/reveal/reveal.wasm.go +++ b/examples/component/http-password-checker/gen/wasmcloud/secrets/reveal/reveal.wasm.go @@ -6,4 +6,4 @@ package reveal //go:wasmimport wasmcloud:secrets/reveal@0.1.0-draft reveal //go:noescape -func wasmimport_Reveal(s0 uint32, result *SecretValue) +func wasmimport_Reveal(s0 uint32) diff --git a/examples/component/http-password-checker/gen/wasmcloud/secrets/reveal/reveal.wit.go b/examples/component/http-password-checker/gen/wasmcloud/secrets/reveal/reveal.wit.go index ad083f56..419f0e1c 100755 --- a/examples/component/http-password-checker/gen/wasmcloud/secrets/reveal/reveal.wit.go +++ b/examples/component/http-password-checker/gen/wasmcloud/secrets/reveal/reveal.wit.go @@ -20,11 +20,11 @@ type SecretValue = store.SecretValue // Reveal represents the imported function "reveal". // -// reveal: func(s: borrow) -> secret-value +// reveal: func(s: borrow) // //go:nosplit -func Reveal(s Secret) (result SecretValue) { +func Reveal(s Secret) { s0 := cm.Reinterpret[uint32](s) - wasmimport_Reveal((uint32)(s0), &result) + wasmimport_Reveal((uint32)(s0)) return } diff --git a/examples/component/http-password-checker/gen/wasmcloud/secrets/store/store.wasm.go b/examples/component/http-password-checker/gen/wasmcloud/secrets/store/store.wasm.go index cc94c517..4ef43490 100755 --- a/examples/component/http-password-checker/gen/wasmcloud/secrets/store/store.wasm.go +++ b/examples/component/http-password-checker/gen/wasmcloud/secrets/store/store.wasm.go @@ -2,10 +2,6 @@ package store -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasmcloud:secrets@0.1.0-draft". //go:wasmimport wasmcloud:secrets/store@0.1.0-draft [resource-drop]secret @@ -14,4 +10,4 @@ func wasmimport_SecretResourceDrop(self0 uint32) //go:wasmimport wasmcloud:secrets/store@0.1.0-draft get //go:noescape -func wasmimport_Get(key0 *uint8, key1 uint32, result *cm.Result[SecretsErrorShape, Secret, SecretsError]) +func wasmimport_Get(key0 *uint8, key1 uint32) diff --git a/examples/component/http-password-checker/gen/wasmcloud/secrets/store/store.wit.go b/examples/component/http-password-checker/gen/wasmcloud/secrets/store/store.wit.go index d3465e4f..405555fa 100755 --- a/examples/component/http-password-checker/gen/wasmcloud/secrets/store/store.wit.go +++ b/examples/component/http-password-checker/gen/wasmcloud/secrets/store/store.wit.go @@ -114,11 +114,11 @@ func (self Secret) ResourceDrop() { // Get represents the imported function "get". // -// get: func(key: string) -> result +// get: func(key: string) // //go:nosplit -func Get(key string) (result cm.Result[SecretsErrorShape, Secret, SecretsError]) { +func Get(key string) { key0, key1 := cm.LowerString(key) - wasmimport_Get((*uint8)(key0), (uint32)(key1), &result) + wasmimport_Get((*uint8)(key0), (uint32)(key1)) return } diff --git a/examples/component/http-server/README.md b/examples/component/http-server/README.md index fb6b0ceb..6cdc47d1 100644 --- a/examples/component/http-server/README.md +++ b/examples/component/http-server/README.md @@ -18,13 +18,6 @@ The application... ## 📦 Dependencies -> [!WARNING] -> Due to incompatibilities introduced in `wasm-tools` v1.226.0, a version of -> `wasm-tools` <= 1.225.0 is **required** for running this example. -> -> You can install `wasm-tools` [v1.225.0 from upstream releases](https://github.com/bytecodealliance/wasm-tools/releases/tag/v1.225.0), or use -> `cargo` ([Rust toolchain](https://doc.rust-lang.org/cargo/getting-started/installation.html)) -- (i.e. `cargo install --locked wasm-tools@1.225.0`) - Before starting, ensure that you have the following installed in addition to the Go (1.23+) toolchain: - [`tinygo`](https://tinygo.org/getting-started/install/) for compiling Go (always use the latest version) @@ -196,6 +189,10 @@ You can cancel the `wash dev` process with `Ctrl-C`. ## ⚠️ Issues/FAQ +### Build errors + +New releases of `wasm-tools` may introduce compatibility issues that can result in build errors. If you encounter issues, try using v1.225.0, which is currently the most consistent for Go builds. You can install `wasm-tools` [v1.225.0 from upstream releases](https://github.com/bytecodealliance/wasm-tools/releases/tag/v1.225.0), or use `cargo` ([Rust toolchain](https://doc.rust-lang.org/cargo/getting-started/installation.html)) -- (i.e. `cargo install --locked wasm-tools@1.225.0`) + ### `curl` produces a "failed to invoke" error If `curl`ing produces... diff --git a/examples/component/http-server/gen/wasi/cli/environment/environment.wasm.go b/examples/component/http-server/gen/wasi/cli/environment/environment.wasm.go index 89bb596b..b4c02ba4 100755 --- a/examples/component/http-server/gen/wasi/cli/environment/environment.wasm.go +++ b/examples/component/http-server/gen/wasi/cli/environment/environment.wasm.go @@ -2,20 +2,16 @@ package environment -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". //go:wasmimport wasi:cli/environment@0.2.0 get-environment //go:noescape -func wasmimport_GetEnvironment(result *cm.List[[2]string]) +func wasmimport_GetEnvironment() //go:wasmimport wasi:cli/environment@0.2.0 get-arguments //go:noescape -func wasmimport_GetArguments(result *cm.List[string]) +func wasmimport_GetArguments() //go:wasmimport wasi:cli/environment@0.2.0 initial-cwd //go:noescape -func wasmimport_InitialCWD(result *cm.Option[string]) +func wasmimport_InitialCWD() diff --git a/examples/component/http-server/gen/wasi/cli/environment/environment.wit.go b/examples/component/http-server/gen/wasi/cli/environment/environment.wit.go index 068bed33..7d1f8133 100755 --- a/examples/component/http-server/gen/wasi/cli/environment/environment.wit.go +++ b/examples/component/http-server/gen/wasi/cli/environment/environment.wit.go @@ -3,36 +3,32 @@ // Package environment represents the imported interface "wasi:cli/environment@0.2.0". package environment -import ( - "go.bytecodealliance.org/cm" -) - // GetEnvironment represents the imported function "get-environment". // -// get-environment: func() -> list> +// get-environment: func() // //go:nosplit -func GetEnvironment() (result cm.List[[2]string]) { - wasmimport_GetEnvironment(&result) +func GetEnvironment() { + wasmimport_GetEnvironment() return } // GetArguments represents the imported function "get-arguments". // -// get-arguments: func() -> list +// get-arguments: func() // //go:nosplit -func GetArguments() (result cm.List[string]) { - wasmimport_GetArguments(&result) +func GetArguments() { + wasmimport_GetArguments() return } // InitialCWD represents the imported function "initial-cwd". // -// initial-cwd: func() -> option +// initial-cwd: func() // //go:nosplit -func InitialCWD() (result cm.Option[string]) { - wasmimport_InitialCWD(&result) +func InitialCWD() { + wasmimport_InitialCWD() return } diff --git a/examples/component/http-server/gen/wasi/cli/stderr/stderr.wasm.go b/examples/component/http-server/gen/wasi/cli/stderr/stderr.wasm.go index 462cf172..9c5bcdb9 100755 --- a/examples/component/http-server/gen/wasi/cli/stderr/stderr.wasm.go +++ b/examples/component/http-server/gen/wasi/cli/stderr/stderr.wasm.go @@ -6,4 +6,4 @@ package stderr //go:wasmimport wasi:cli/stderr@0.2.0 get-stderr //go:noescape -func wasmimport_GetStderr() (result0 uint32) +func wasmimport_GetStderr() diff --git a/examples/component/http-server/gen/wasi/cli/stderr/stderr.wit.go b/examples/component/http-server/gen/wasi/cli/stderr/stderr.wit.go index 3d53a114..e8ba9eba 100755 --- a/examples/component/http-server/gen/wasi/cli/stderr/stderr.wit.go +++ b/examples/component/http-server/gen/wasi/cli/stderr/stderr.wit.go @@ -5,7 +5,6 @@ package stderr import ( "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/io/streams" - "go.bytecodealliance.org/cm" ) // OutputStream represents the imported type alias "wasi:cli/stderr@0.2.0#output-stream". @@ -15,11 +14,10 @@ type OutputStream = streams.OutputStream // GetStderr represents the imported function "get-stderr". // -// get-stderr: func() -> output-stream +// get-stderr: func() // //go:nosplit -func GetStderr() (result OutputStream) { - result0 := wasmimport_GetStderr() - result = cm.Reinterpret[OutputStream]((uint32)(result0)) +func GetStderr() { + wasmimport_GetStderr() return } diff --git a/examples/component/http-server/gen/wasi/cli/stdin/stdin.wasm.go b/examples/component/http-server/gen/wasi/cli/stdin/stdin.wasm.go index 374eb253..090f2e31 100755 --- a/examples/component/http-server/gen/wasi/cli/stdin/stdin.wasm.go +++ b/examples/component/http-server/gen/wasi/cli/stdin/stdin.wasm.go @@ -6,4 +6,4 @@ package stdin //go:wasmimport wasi:cli/stdin@0.2.0 get-stdin //go:noescape -func wasmimport_GetStdin() (result0 uint32) +func wasmimport_GetStdin() diff --git a/examples/component/http-server/gen/wasi/cli/stdin/stdin.wit.go b/examples/component/http-server/gen/wasi/cli/stdin/stdin.wit.go index 0469ced1..64af9b07 100755 --- a/examples/component/http-server/gen/wasi/cli/stdin/stdin.wit.go +++ b/examples/component/http-server/gen/wasi/cli/stdin/stdin.wit.go @@ -5,7 +5,6 @@ package stdin import ( "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/io/streams" - "go.bytecodealliance.org/cm" ) // InputStream represents the imported type alias "wasi:cli/stdin@0.2.0#input-stream". @@ -15,11 +14,10 @@ type InputStream = streams.InputStream // GetStdin represents the imported function "get-stdin". // -// get-stdin: func() -> input-stream +// get-stdin: func() // //go:nosplit -func GetStdin() (result InputStream) { - result0 := wasmimport_GetStdin() - result = cm.Reinterpret[InputStream]((uint32)(result0)) +func GetStdin() { + wasmimport_GetStdin() return } diff --git a/examples/component/http-server/gen/wasi/cli/stdout/stdout.wasm.go b/examples/component/http-server/gen/wasi/cli/stdout/stdout.wasm.go index 68e4a3da..1a1a2650 100755 --- a/examples/component/http-server/gen/wasi/cli/stdout/stdout.wasm.go +++ b/examples/component/http-server/gen/wasi/cli/stdout/stdout.wasm.go @@ -6,4 +6,4 @@ package stdout //go:wasmimport wasi:cli/stdout@0.2.0 get-stdout //go:noescape -func wasmimport_GetStdout() (result0 uint32) +func wasmimport_GetStdout() diff --git a/examples/component/http-server/gen/wasi/cli/stdout/stdout.wit.go b/examples/component/http-server/gen/wasi/cli/stdout/stdout.wit.go index 8d9d7fda..ac8463a0 100755 --- a/examples/component/http-server/gen/wasi/cli/stdout/stdout.wit.go +++ b/examples/component/http-server/gen/wasi/cli/stdout/stdout.wit.go @@ -5,7 +5,6 @@ package stdout import ( "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/io/streams" - "go.bytecodealliance.org/cm" ) // OutputStream represents the imported type alias "wasi:cli/stdout@0.2.0#output-stream". @@ -15,11 +14,10 @@ type OutputStream = streams.OutputStream // GetStdout represents the imported function "get-stdout". // -// get-stdout: func() -> output-stream +// get-stdout: func() // //go:nosplit -func GetStdout() (result OutputStream) { - result0 := wasmimport_GetStdout() - result = cm.Reinterpret[OutputStream]((uint32)(result0)) +func GetStdout() { + wasmimport_GetStdout() return } diff --git a/examples/component/http-server/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go b/examples/component/http-server/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go index d6a1585a..74325c62 100755 --- a/examples/component/http-server/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go +++ b/examples/component/http-server/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go @@ -5,7 +5,6 @@ package terminalstderr import ( terminaloutput "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/cli/terminal-output" - "go.bytecodealliance.org/cm" ) // TerminalOutput represents the imported type alias "wasi:cli/terminal-stderr@0.2.0#terminal-output". @@ -15,10 +14,10 @@ type TerminalOutput = terminaloutput.TerminalOutput // GetTerminalStderr represents the imported function "get-terminal-stderr". // -// get-terminal-stderr: func() -> option +// get-terminal-stderr: func() // //go:nosplit -func GetTerminalStderr() (result cm.Option[TerminalOutput]) { - wasmimport_GetTerminalStderr(&result) +func GetTerminalStderr() { + wasmimport_GetTerminalStderr() return } diff --git a/examples/component/http-server/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go b/examples/component/http-server/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go index be9af72f..03cbe909 100755 --- a/examples/component/http-server/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go +++ b/examples/component/http-server/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go @@ -2,12 +2,8 @@ package terminalstderr -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". //go:wasmimport wasi:cli/terminal-stderr@0.2.0 get-terminal-stderr //go:noescape -func wasmimport_GetTerminalStderr(result *cm.Option[TerminalOutput]) +func wasmimport_GetTerminalStderr() diff --git a/examples/component/http-server/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go b/examples/component/http-server/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go index 1d37efee..4bb86337 100755 --- a/examples/component/http-server/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go +++ b/examples/component/http-server/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go @@ -5,7 +5,6 @@ package terminalstdin import ( terminalinput "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/cli/terminal-input" - "go.bytecodealliance.org/cm" ) // TerminalInput represents the imported type alias "wasi:cli/terminal-stdin@0.2.0#terminal-input". @@ -15,10 +14,10 @@ type TerminalInput = terminalinput.TerminalInput // GetTerminalStdin represents the imported function "get-terminal-stdin". // -// get-terminal-stdin: func() -> option +// get-terminal-stdin: func() // //go:nosplit -func GetTerminalStdin() (result cm.Option[TerminalInput]) { - wasmimport_GetTerminalStdin(&result) +func GetTerminalStdin() { + wasmimport_GetTerminalStdin() return } diff --git a/examples/component/http-server/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go b/examples/component/http-server/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go index e3b3ac61..1a59d9fd 100755 --- a/examples/component/http-server/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go +++ b/examples/component/http-server/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go @@ -2,12 +2,8 @@ package terminalstdin -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". //go:wasmimport wasi:cli/terminal-stdin@0.2.0 get-terminal-stdin //go:noescape -func wasmimport_GetTerminalStdin(result *cm.Option[TerminalInput]) +func wasmimport_GetTerminalStdin() diff --git a/examples/component/http-server/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go b/examples/component/http-server/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go index a45762ea..17e4d7da 100755 --- a/examples/component/http-server/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go +++ b/examples/component/http-server/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go @@ -5,7 +5,6 @@ package terminalstdout import ( terminaloutput "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/cli/terminal-output" - "go.bytecodealliance.org/cm" ) // TerminalOutput represents the imported type alias "wasi:cli/terminal-stdout@0.2.0#terminal-output". @@ -15,10 +14,10 @@ type TerminalOutput = terminaloutput.TerminalOutput // GetTerminalStdout represents the imported function "get-terminal-stdout". // -// get-terminal-stdout: func() -> option +// get-terminal-stdout: func() // //go:nosplit -func GetTerminalStdout() (result cm.Option[TerminalOutput]) { - wasmimport_GetTerminalStdout(&result) +func GetTerminalStdout() { + wasmimport_GetTerminalStdout() return } diff --git a/examples/component/http-server/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go b/examples/component/http-server/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go index fa750ad9..c45db1d2 100755 --- a/examples/component/http-server/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go +++ b/examples/component/http-server/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go @@ -2,12 +2,8 @@ package terminalstdout -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". //go:wasmimport wasi:cli/terminal-stdout@0.2.0 get-terminal-stdout //go:noescape -func wasmimport_GetTerminalStdout(result *cm.Option[TerminalOutput]) +func wasmimport_GetTerminalStdout() diff --git a/examples/component/http-server/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go b/examples/component/http-server/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go index 1dffa9d9..ef5072ba 100755 --- a/examples/component/http-server/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go +++ b/examples/component/http-server/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go @@ -5,7 +5,6 @@ package monotonicclock import ( "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/io/poll" - "go.bytecodealliance.org/cm" ) // Pollable represents the imported type alias "wasi:clocks/monotonic-clock@0.2.0#pollable". @@ -25,46 +24,42 @@ type Duration uint64 // Now represents the imported function "now". // -// now: func() -> instant +// now: func() // //go:nosplit -func Now() (result Instant) { - result0 := wasmimport_Now() - result = (Instant)((uint64)(result0)) +func Now() { + wasmimport_Now() return } // Resolution represents the imported function "resolution". // -// resolution: func() -> duration +// resolution: func() // //go:nosplit -func Resolution() (result Duration) { - result0 := wasmimport_Resolution() - result = (Duration)((uint64)(result0)) +func Resolution() { + wasmimport_Resolution() return } // SubscribeInstant represents the imported function "subscribe-instant". // -// subscribe-instant: func(when: instant) -> pollable +// subscribe-instant: func(when: instant) // //go:nosplit -func SubscribeInstant(when Instant) (result Pollable) { +func SubscribeInstant(when Instant) { when0 := (uint64)(when) - result0 := wasmimport_SubscribeInstant((uint64)(when0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_SubscribeInstant((uint64)(when0)) return } // SubscribeDuration represents the imported function "subscribe-duration". // -// subscribe-duration: func(when: duration) -> pollable +// subscribe-duration: func(when: duration) // //go:nosplit -func SubscribeDuration(when Duration) (result Pollable) { +func SubscribeDuration(when Duration) { when0 := (uint64)(when) - result0 := wasmimport_SubscribeDuration((uint64)(when0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_SubscribeDuration((uint64)(when0)) return } diff --git a/examples/component/http-server/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go b/examples/component/http-server/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go index 36a1720a..4494c61a 100755 --- a/examples/component/http-server/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go +++ b/examples/component/http-server/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go @@ -6,16 +6,16 @@ package monotonicclock //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 now //go:noescape -func wasmimport_Now() (result0 uint64) +func wasmimport_Now() //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 resolution //go:noescape -func wasmimport_Resolution() (result0 uint64) +func wasmimport_Resolution() //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 subscribe-instant //go:noescape -func wasmimport_SubscribeInstant(when0 uint64) (result0 uint32) +func wasmimport_SubscribeInstant(when0 uint64) //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 subscribe-duration //go:noescape -func wasmimport_SubscribeDuration(when0 uint64) (result0 uint32) +func wasmimport_SubscribeDuration(when0 uint64) diff --git a/examples/component/http-server/gen/wasi/clocks/wall-clock/wall-clock.wit.go b/examples/component/http-server/gen/wasi/clocks/wall-clock/wall-clock.wit.go index e3f35395..308f0910 100755 --- a/examples/component/http-server/gen/wasi/clocks/wall-clock/wall-clock.wit.go +++ b/examples/component/http-server/gen/wasi/clocks/wall-clock/wall-clock.wit.go @@ -21,20 +21,20 @@ type DateTime struct { // Now represents the imported function "now". // -// now: func() -> datetime +// now: func() // //go:nosplit -func Now() (result DateTime) { - wasmimport_Now(&result) +func Now() { + wasmimport_Now() return } // Resolution represents the imported function "resolution". // -// resolution: func() -> datetime +// resolution: func() // //go:nosplit -func Resolution() (result DateTime) { - wasmimport_Resolution(&result) +func Resolution() { + wasmimport_Resolution() return } diff --git a/examples/component/http-server/gen/wasi/clocks/wall-clock/wallclock.wasm.go b/examples/component/http-server/gen/wasi/clocks/wall-clock/wallclock.wasm.go index 321ff3f1..4efbaf84 100755 --- a/examples/component/http-server/gen/wasi/clocks/wall-clock/wallclock.wasm.go +++ b/examples/component/http-server/gen/wasi/clocks/wall-clock/wallclock.wasm.go @@ -6,8 +6,8 @@ package wallclock //go:wasmimport wasi:clocks/wall-clock@0.2.0 now //go:noescape -func wasmimport_Now(result *DateTime) +func wasmimport_Now() //go:wasmimport wasi:clocks/wall-clock@0.2.0 resolution //go:noescape -func wasmimport_Resolution(result *DateTime) +func wasmimport_Resolution() diff --git a/examples/component/http-server/gen/wasi/config/runtime/runtime.wasm.go b/examples/component/http-server/gen/wasi/config/runtime/runtime.wasm.go index 8ce17d5e..4abfb286 100755 --- a/examples/component/http-server/gen/wasi/config/runtime/runtime.wasm.go +++ b/examples/component/http-server/gen/wasi/config/runtime/runtime.wasm.go @@ -2,16 +2,12 @@ package runtime -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:config@0.2.0-draft". //go:wasmimport wasi:config/runtime@0.2.0-draft get //go:noescape -func wasmimport_Get(key0 *uint8, key1 uint32, result *cm.Result[OptionStringShape, cm.Option[string], ConfigError]) +func wasmimport_Get(key0 *uint8, key1 uint32) //go:wasmimport wasi:config/runtime@0.2.0-draft get-all //go:noescape -func wasmimport_GetAll(result *cm.Result[ConfigErrorShape, cm.List[[2]string], ConfigError]) +func wasmimport_GetAll() diff --git a/examples/component/http-server/gen/wasi/config/runtime/runtime.wit.go b/examples/component/http-server/gen/wasi/config/runtime/runtime.wit.go index 99a739d1..204a5c0c 100755 --- a/examples/component/http-server/gen/wasi/config/runtime/runtime.wit.go +++ b/examples/component/http-server/gen/wasi/config/runtime/runtime.wit.go @@ -47,21 +47,21 @@ func (v ConfigError) String() string { // Get represents the imported function "get". // -// get: func(key: string) -> result, config-error> +// get: func(key: string) // //go:nosplit -func Get(key string) (result cm.Result[OptionStringShape, cm.Option[string], ConfigError]) { +func Get(key string) { key0, key1 := cm.LowerString(key) - wasmimport_Get((*uint8)(key0), (uint32)(key1), &result) + wasmimport_Get((*uint8)(key0), (uint32)(key1)) return } // GetAll represents the imported function "get-all". // -// get-all: func() -> result>, config-error> +// get-all: func() // //go:nosplit -func GetAll() (result cm.Result[ConfigErrorShape, cm.List[[2]string], ConfigError]) { - wasmimport_GetAll(&result) +func GetAll() { + wasmimport_GetAll() return } diff --git a/examples/component/http-server/gen/wasi/filesystem/preopens/preopens.wasm.go b/examples/component/http-server/gen/wasi/filesystem/preopens/preopens.wasm.go index 1bcd416a..50885ee0 100755 --- a/examples/component/http-server/gen/wasi/filesystem/preopens/preopens.wasm.go +++ b/examples/component/http-server/gen/wasi/filesystem/preopens/preopens.wasm.go @@ -2,12 +2,8 @@ package preopens -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:filesystem@0.2.0". //go:wasmimport wasi:filesystem/preopens@0.2.0 get-directories //go:noescape -func wasmimport_GetDirectories(result *cm.List[cm.Tuple[Descriptor, string]]) +func wasmimport_GetDirectories() diff --git a/examples/component/http-server/gen/wasi/filesystem/preopens/preopens.wit.go b/examples/component/http-server/gen/wasi/filesystem/preopens/preopens.wit.go index e287b2b3..1174092a 100755 --- a/examples/component/http-server/gen/wasi/filesystem/preopens/preopens.wit.go +++ b/examples/component/http-server/gen/wasi/filesystem/preopens/preopens.wit.go @@ -5,7 +5,6 @@ package preopens import ( "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/filesystem/types" - "go.bytecodealliance.org/cm" ) // Descriptor represents the imported type alias "wasi:filesystem/preopens@0.2.0#descriptor". @@ -15,10 +14,10 @@ type Descriptor = types.Descriptor // GetDirectories represents the imported function "get-directories". // -// get-directories: func() -> list> +// get-directories: func() // //go:nosplit -func GetDirectories() (result cm.List[cm.Tuple[Descriptor, string]]) { - wasmimport_GetDirectories(&result) +func GetDirectories() { + wasmimport_GetDirectories() return } diff --git a/examples/component/http-server/gen/wasi/filesystem/types/abi.go b/examples/component/http-server/gen/wasi/filesystem/types/abi.go index f5ed743a..ccc8a541 100755 --- a/examples/component/http-server/gen/wasi/filesystem/types/abi.go +++ b/examples/component/http-server/gen/wasi/filesystem/types/abi.go @@ -5,21 +5,8 @@ package types import ( wallclock "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/clocks/wall-clock" "go.bytecodealliance.org/cm" - "unsafe" ) -// MetadataHashValueShape is used for storage in variant or result types. -type MetadataHashValueShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(MetadataHashValue{})]byte -} - -// TupleListU8BoolShape is used for storage in variant or result types. -type TupleListU8BoolShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Tuple[cm.List[uint8], bool]{})]byte -} - func lower_DateTime(v wallclock.DateTime) (f0 uint64, f1 uint32) { f0 = (uint64)(v.Seconds) f1 = (uint32)(v.Nanoseconds) @@ -36,15 +23,3 @@ func lower_NewTimestamp(v NewTimestamp) (f0 uint32, f1 uint64, f2 uint32) { } return } - -// DescriptorStatShape is used for storage in variant or result types. -type DescriptorStatShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(DescriptorStat{})]byte -} - -// OptionDirectoryEntryShape is used for storage in variant or result types. -type OptionDirectoryEntryShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Option[DirectoryEntry]{})]byte -} diff --git a/examples/component/http-server/gen/wasi/filesystem/types/types.wasm.go b/examples/component/http-server/gen/wasi/filesystem/types/types.wasm.go index b97dad84..7a2b9993 100755 --- a/examples/component/http-server/gen/wasi/filesystem/types/types.wasm.go +++ b/examples/component/http-server/gen/wasi/filesystem/types/types.wasm.go @@ -2,10 +2,6 @@ package types -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:filesystem@0.2.0". //go:wasmimport wasi:filesystem/types@0.2.0 [resource-drop]descriptor @@ -14,111 +10,111 @@ func wasmimport_DescriptorResourceDrop(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.advise //go:noescape -func wasmimport_DescriptorAdvise(self0 uint32, offset0 uint64, length0 uint64, advice0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorAdvise(self0 uint32, offset0 uint64, length0 uint64, advice0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.append-via-stream //go:noescape -func wasmimport_DescriptorAppendViaStream(self0 uint32, result *cm.Result[OutputStream, OutputStream, ErrorCode]) +func wasmimport_DescriptorAppendViaStream(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.create-directory-at //go:noescape -func wasmimport_DescriptorCreateDirectoryAt(self0 uint32, path0 *uint8, path1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorCreateDirectoryAt(self0 uint32, path0 *uint8, path1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.get-flags //go:noescape -func wasmimport_DescriptorGetFlags(self0 uint32, result *cm.Result[DescriptorFlags, DescriptorFlags, ErrorCode]) +func wasmimport_DescriptorGetFlags(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.get-type //go:noescape -func wasmimport_DescriptorGetType(self0 uint32, result *cm.Result[DescriptorType, DescriptorType, ErrorCode]) +func wasmimport_DescriptorGetType(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.is-same-object //go:noescape -func wasmimport_DescriptorIsSameObject(self0 uint32, other0 uint32) (result0 uint32) +func wasmimport_DescriptorIsSameObject(self0 uint32, other0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.link-at //go:noescape -func wasmimport_DescriptorLinkAt(self0 uint32, oldPathFlags0 uint32, oldPath0 *uint8, oldPath1 uint32, newDescriptor0 uint32, newPath0 *uint8, newPath1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorLinkAt(self0 uint32, oldPathFlags0 uint32, oldPath0 *uint8, oldPath1 uint32, newDescriptor0 uint32, newPath0 *uint8, newPath1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.metadata-hash //go:noescape -func wasmimport_DescriptorMetadataHash(self0 uint32, result *cm.Result[MetadataHashValueShape, MetadataHashValue, ErrorCode]) +func wasmimport_DescriptorMetadataHash(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.metadata-hash-at //go:noescape -func wasmimport_DescriptorMetadataHashAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, result *cm.Result[MetadataHashValueShape, MetadataHashValue, ErrorCode]) +func wasmimport_DescriptorMetadataHashAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.open-at //go:noescape -func wasmimport_DescriptorOpenAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, openFlags0 uint32, flags0 uint32, result *cm.Result[Descriptor, Descriptor, ErrorCode]) +func wasmimport_DescriptorOpenAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, openFlags0 uint32, flags0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.read //go:noescape -func wasmimport_DescriptorRead(self0 uint32, length0 uint64, offset0 uint64, result *cm.Result[TupleListU8BoolShape, cm.Tuple[cm.List[uint8], bool], ErrorCode]) +func wasmimport_DescriptorRead(self0 uint32, length0 uint64, offset0 uint64) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.read-directory //go:noescape -func wasmimport_DescriptorReadDirectory(self0 uint32, result *cm.Result[DirectoryEntryStream, DirectoryEntryStream, ErrorCode]) +func wasmimport_DescriptorReadDirectory(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.read-via-stream //go:noescape -func wasmimport_DescriptorReadViaStream(self0 uint32, offset0 uint64, result *cm.Result[InputStream, InputStream, ErrorCode]) +func wasmimport_DescriptorReadViaStream(self0 uint32, offset0 uint64) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.readlink-at //go:noescape -func wasmimport_DescriptorReadLinkAt(self0 uint32, path0 *uint8, path1 uint32, result *cm.Result[string, string, ErrorCode]) +func wasmimport_DescriptorReadLinkAt(self0 uint32, path0 *uint8, path1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.remove-directory-at //go:noescape -func wasmimport_DescriptorRemoveDirectoryAt(self0 uint32, path0 *uint8, path1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorRemoveDirectoryAt(self0 uint32, path0 *uint8, path1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.rename-at //go:noescape -func wasmimport_DescriptorRenameAt(self0 uint32, oldPath0 *uint8, oldPath1 uint32, newDescriptor0 uint32, newPath0 *uint8, newPath1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorRenameAt(self0 uint32, oldPath0 *uint8, oldPath1 uint32, newDescriptor0 uint32, newPath0 *uint8, newPath1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.set-size //go:noescape -func wasmimport_DescriptorSetSize(self0 uint32, size0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorSetSize(self0 uint32, size0 uint64) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.set-times //go:noescape -func wasmimport_DescriptorSetTimes(self0 uint32, dataAccessTimestamp0 uint32, dataAccessTimestamp1 uint64, dataAccessTimestamp2 uint32, dataModificationTimestamp0 uint32, dataModificationTimestamp1 uint64, dataModificationTimestamp2 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorSetTimes(self0 uint32, dataAccessTimestamp0 uint32, dataAccessTimestamp1 uint64, dataAccessTimestamp2 uint32, dataModificationTimestamp0 uint32, dataModificationTimestamp1 uint64, dataModificationTimestamp2 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.set-times-at //go:noescape -func wasmimport_DescriptorSetTimesAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, dataAccessTimestamp0 uint32, dataAccessTimestamp1 uint64, dataAccessTimestamp2 uint32, dataModificationTimestamp0 uint32, dataModificationTimestamp1 uint64, dataModificationTimestamp2 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorSetTimesAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, dataAccessTimestamp0 uint32, dataAccessTimestamp1 uint64, dataAccessTimestamp2 uint32, dataModificationTimestamp0 uint32, dataModificationTimestamp1 uint64, dataModificationTimestamp2 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.stat //go:noescape -func wasmimport_DescriptorStat(self0 uint32, result *cm.Result[DescriptorStatShape, DescriptorStat, ErrorCode]) +func wasmimport_DescriptorStat(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.stat-at //go:noescape -func wasmimport_DescriptorStatAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, result *cm.Result[DescriptorStatShape, DescriptorStat, ErrorCode]) +func wasmimport_DescriptorStatAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.symlink-at //go:noescape -func wasmimport_DescriptorSymlinkAt(self0 uint32, oldPath0 *uint8, oldPath1 uint32, newPath0 *uint8, newPath1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorSymlinkAt(self0 uint32, oldPath0 *uint8, oldPath1 uint32, newPath0 *uint8, newPath1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.sync //go:noescape -func wasmimport_DescriptorSync(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorSync(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.sync-data //go:noescape -func wasmimport_DescriptorSyncData(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorSyncData(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.unlink-file-at //go:noescape -func wasmimport_DescriptorUnlinkFileAt(self0 uint32, path0 *uint8, path1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorUnlinkFileAt(self0 uint32, path0 *uint8, path1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.write //go:noescape -func wasmimport_DescriptorWrite(self0 uint32, buffer0 *uint8, buffer1 uint32, offset0 uint64, result *cm.Result[uint64, FileSize, ErrorCode]) +func wasmimport_DescriptorWrite(self0 uint32, buffer0 *uint8, buffer1 uint32, offset0 uint64) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.write-via-stream //go:noescape -func wasmimport_DescriptorWriteViaStream(self0 uint32, offset0 uint64, result *cm.Result[OutputStream, OutputStream, ErrorCode]) +func wasmimport_DescriptorWriteViaStream(self0 uint32, offset0 uint64) //go:wasmimport wasi:filesystem/types@0.2.0 [resource-drop]directory-entry-stream //go:noescape @@ -126,8 +122,8 @@ func wasmimport_DirectoryEntryStreamResourceDrop(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]directory-entry-stream.read-directory-entry //go:noescape -func wasmimport_DirectoryEntryStreamReadDirectoryEntry(self0 uint32, result *cm.Result[OptionDirectoryEntryShape, cm.Option[DirectoryEntry], ErrorCode]) +func wasmimport_DirectoryEntryStreamReadDirectoryEntry(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 filesystem-error-code //go:noescape -func wasmimport_FilesystemErrorCode(err0 uint32, result *cm.Option[ErrorCode]) +func wasmimport_FilesystemErrorCode(err0 uint32) diff --git a/examples/component/http-server/gen/wasi/filesystem/types/types.wit.go b/examples/component/http-server/gen/wasi/filesystem/types/types.wit.go index d55c5790..d475f157 100755 --- a/examples/component/http-server/gen/wasi/filesystem/types/types.wit.go +++ b/examples/component/http-server/gen/wasi/filesystem/types/types.wit.go @@ -406,345 +406,341 @@ func (self Descriptor) ResourceDrop() { // Advise represents the imported method "advise". // -// advise: func(offset: filesize, length: filesize, advice: advice) -> result<_, error-code> +// advise: func(offset: filesize, length: filesize, advice: advice) // //go:nosplit -func (self Descriptor) Advise(offset FileSize, length FileSize, advice Advice) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) Advise(offset FileSize, length FileSize, advice Advice) { self0 := cm.Reinterpret[uint32](self) offset0 := (uint64)(offset) length0 := (uint64)(length) advice0 := (uint32)(advice) - wasmimport_DescriptorAdvise((uint32)(self0), (uint64)(offset0), (uint64)(length0), (uint32)(advice0), &result) + wasmimport_DescriptorAdvise((uint32)(self0), (uint64)(offset0), (uint64)(length0), (uint32)(advice0)) return } // AppendViaStream represents the imported method "append-via-stream". // -// append-via-stream: func() -> result +// append-via-stream: func() // //go:nosplit -func (self Descriptor) AppendViaStream() (result cm.Result[OutputStream, OutputStream, ErrorCode]) { +func (self Descriptor) AppendViaStream() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorAppendViaStream((uint32)(self0), &result) + wasmimport_DescriptorAppendViaStream((uint32)(self0)) return } // CreateDirectoryAt represents the imported method "create-directory-at". // -// create-directory-at: func(path: string) -> result<_, error-code> +// create-directory-at: func(path: string) // //go:nosplit -func (self Descriptor) CreateDirectoryAt(path string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) CreateDirectoryAt(path string) { self0 := cm.Reinterpret[uint32](self) path0, path1 := cm.LowerString(path) - wasmimport_DescriptorCreateDirectoryAt((uint32)(self0), (*uint8)(path0), (uint32)(path1), &result) + wasmimport_DescriptorCreateDirectoryAt((uint32)(self0), (*uint8)(path0), (uint32)(path1)) return } // GetFlags represents the imported method "get-flags". // -// get-flags: func() -> result +// get-flags: func() // //go:nosplit -func (self Descriptor) GetFlags() (result cm.Result[DescriptorFlags, DescriptorFlags, ErrorCode]) { +func (self Descriptor) GetFlags() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorGetFlags((uint32)(self0), &result) + wasmimport_DescriptorGetFlags((uint32)(self0)) return } // GetType represents the imported method "get-type". // -// get-type: func() -> result +// get-type: func() // //go:nosplit -func (self Descriptor) GetType() (result cm.Result[DescriptorType, DescriptorType, ErrorCode]) { +func (self Descriptor) GetType() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorGetType((uint32)(self0), &result) + wasmimport_DescriptorGetType((uint32)(self0)) return } // IsSameObject represents the imported method "is-same-object". // -// is-same-object: func(other: borrow) -> bool +// is-same-object: func(other: borrow) // //go:nosplit -func (self Descriptor) IsSameObject(other Descriptor) (result bool) { +func (self Descriptor) IsSameObject(other Descriptor) { self0 := cm.Reinterpret[uint32](self) other0 := cm.Reinterpret[uint32](other) - result0 := wasmimport_DescriptorIsSameObject((uint32)(self0), (uint32)(other0)) - result = (bool)(cm.U32ToBool((uint32)(result0))) + wasmimport_DescriptorIsSameObject((uint32)(self0), (uint32)(other0)) return } // LinkAt represents the imported method "link-at". // // link-at: func(old-path-flags: path-flags, old-path: string, new-descriptor: borrow, -// new-path: string) -> result<_, error-code> +// new-path: string) // //go:nosplit -func (self Descriptor) LinkAt(oldPathFlags PathFlags, oldPath string, newDescriptor Descriptor, newPath string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) LinkAt(oldPathFlags PathFlags, oldPath string, newDescriptor Descriptor, newPath string) { self0 := cm.Reinterpret[uint32](self) oldPathFlags0 := (uint32)(oldPathFlags) oldPath0, oldPath1 := cm.LowerString(oldPath) newDescriptor0 := cm.Reinterpret[uint32](newDescriptor) newPath0, newPath1 := cm.LowerString(newPath) - wasmimport_DescriptorLinkAt((uint32)(self0), (uint32)(oldPathFlags0), (*uint8)(oldPath0), (uint32)(oldPath1), (uint32)(newDescriptor0), (*uint8)(newPath0), (uint32)(newPath1), &result) + wasmimport_DescriptorLinkAt((uint32)(self0), (uint32)(oldPathFlags0), (*uint8)(oldPath0), (uint32)(oldPath1), (uint32)(newDescriptor0), (*uint8)(newPath0), (uint32)(newPath1)) return } // MetadataHash represents the imported method "metadata-hash". // -// metadata-hash: func() -> result +// metadata-hash: func() // //go:nosplit -func (self Descriptor) MetadataHash() (result cm.Result[MetadataHashValueShape, MetadataHashValue, ErrorCode]) { +func (self Descriptor) MetadataHash() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorMetadataHash((uint32)(self0), &result) + wasmimport_DescriptorMetadataHash((uint32)(self0)) return } // MetadataHashAt represents the imported method "metadata-hash-at". // -// metadata-hash-at: func(path-flags: path-flags, path: string) -> result +// metadata-hash-at: func(path-flags: path-flags, path: string) // //go:nosplit -func (self Descriptor) MetadataHashAt(pathFlags PathFlags, path string) (result cm.Result[MetadataHashValueShape, MetadataHashValue, ErrorCode]) { +func (self Descriptor) MetadataHashAt(pathFlags PathFlags, path string) { self0 := cm.Reinterpret[uint32](self) pathFlags0 := (uint32)(pathFlags) path0, path1 := cm.LowerString(path) - wasmimport_DescriptorMetadataHashAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), &result) + wasmimport_DescriptorMetadataHashAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1)) return } // OpenAt represents the imported method "open-at". // // open-at: func(path-flags: path-flags, path: string, open-flags: open-flags, %flags: -// descriptor-flags) -> result +// descriptor-flags) // //go:nosplit -func (self Descriptor) OpenAt(pathFlags PathFlags, path string, openFlags OpenFlags, flags DescriptorFlags) (result cm.Result[Descriptor, Descriptor, ErrorCode]) { +func (self Descriptor) OpenAt(pathFlags PathFlags, path string, openFlags OpenFlags, flags DescriptorFlags) { self0 := cm.Reinterpret[uint32](self) pathFlags0 := (uint32)(pathFlags) path0, path1 := cm.LowerString(path) openFlags0 := (uint32)(openFlags) flags0 := (uint32)(flags) - wasmimport_DescriptorOpenAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), (uint32)(openFlags0), (uint32)(flags0), &result) + wasmimport_DescriptorOpenAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), (uint32)(openFlags0), (uint32)(flags0)) return } // Read represents the imported method "read". // -// read: func(length: filesize, offset: filesize) -> result, bool>, -// error-code> +// read: func(length: filesize, offset: filesize) // //go:nosplit -func (self Descriptor) Read(length FileSize, offset FileSize) (result cm.Result[TupleListU8BoolShape, cm.Tuple[cm.List[uint8], bool], ErrorCode]) { +func (self Descriptor) Read(length FileSize, offset FileSize) { self0 := cm.Reinterpret[uint32](self) length0 := (uint64)(length) offset0 := (uint64)(offset) - wasmimport_DescriptorRead((uint32)(self0), (uint64)(length0), (uint64)(offset0), &result) + wasmimport_DescriptorRead((uint32)(self0), (uint64)(length0), (uint64)(offset0)) return } // ReadDirectory represents the imported method "read-directory". // -// read-directory: func() -> result +// read-directory: func() // //go:nosplit -func (self Descriptor) ReadDirectory() (result cm.Result[DirectoryEntryStream, DirectoryEntryStream, ErrorCode]) { +func (self Descriptor) ReadDirectory() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorReadDirectory((uint32)(self0), &result) + wasmimport_DescriptorReadDirectory((uint32)(self0)) return } // ReadViaStream represents the imported method "read-via-stream". // -// read-via-stream: func(offset: filesize) -> result +// read-via-stream: func(offset: filesize) // //go:nosplit -func (self Descriptor) ReadViaStream(offset FileSize) (result cm.Result[InputStream, InputStream, ErrorCode]) { +func (self Descriptor) ReadViaStream(offset FileSize) { self0 := cm.Reinterpret[uint32](self) offset0 := (uint64)(offset) - wasmimport_DescriptorReadViaStream((uint32)(self0), (uint64)(offset0), &result) + wasmimport_DescriptorReadViaStream((uint32)(self0), (uint64)(offset0)) return } // ReadLinkAt represents the imported method "readlink-at". // -// readlink-at: func(path: string) -> result +// readlink-at: func(path: string) // //go:nosplit -func (self Descriptor) ReadLinkAt(path string) (result cm.Result[string, string, ErrorCode]) { +func (self Descriptor) ReadLinkAt(path string) { self0 := cm.Reinterpret[uint32](self) path0, path1 := cm.LowerString(path) - wasmimport_DescriptorReadLinkAt((uint32)(self0), (*uint8)(path0), (uint32)(path1), &result) + wasmimport_DescriptorReadLinkAt((uint32)(self0), (*uint8)(path0), (uint32)(path1)) return } // RemoveDirectoryAt represents the imported method "remove-directory-at". // -// remove-directory-at: func(path: string) -> result<_, error-code> +// remove-directory-at: func(path: string) // //go:nosplit -func (self Descriptor) RemoveDirectoryAt(path string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) RemoveDirectoryAt(path string) { self0 := cm.Reinterpret[uint32](self) path0, path1 := cm.LowerString(path) - wasmimport_DescriptorRemoveDirectoryAt((uint32)(self0), (*uint8)(path0), (uint32)(path1), &result) + wasmimport_DescriptorRemoveDirectoryAt((uint32)(self0), (*uint8)(path0), (uint32)(path1)) return } // RenameAt represents the imported method "rename-at". // // rename-at: func(old-path: string, new-descriptor: borrow, new-path: -// string) -> result<_, error-code> +// string) // //go:nosplit -func (self Descriptor) RenameAt(oldPath string, newDescriptor Descriptor, newPath string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) RenameAt(oldPath string, newDescriptor Descriptor, newPath string) { self0 := cm.Reinterpret[uint32](self) oldPath0, oldPath1 := cm.LowerString(oldPath) newDescriptor0 := cm.Reinterpret[uint32](newDescriptor) newPath0, newPath1 := cm.LowerString(newPath) - wasmimport_DescriptorRenameAt((uint32)(self0), (*uint8)(oldPath0), (uint32)(oldPath1), (uint32)(newDescriptor0), (*uint8)(newPath0), (uint32)(newPath1), &result) + wasmimport_DescriptorRenameAt((uint32)(self0), (*uint8)(oldPath0), (uint32)(oldPath1), (uint32)(newDescriptor0), (*uint8)(newPath0), (uint32)(newPath1)) return } // SetSize represents the imported method "set-size". // -// set-size: func(size: filesize) -> result<_, error-code> +// set-size: func(size: filesize) // //go:nosplit -func (self Descriptor) SetSize(size FileSize) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) SetSize(size FileSize) { self0 := cm.Reinterpret[uint32](self) size0 := (uint64)(size) - wasmimport_DescriptorSetSize((uint32)(self0), (uint64)(size0), &result) + wasmimport_DescriptorSetSize((uint32)(self0), (uint64)(size0)) return } // SetTimes represents the imported method "set-times". // // set-times: func(data-access-timestamp: new-timestamp, data-modification-timestamp: -// new-timestamp) -> result<_, error-code> +// new-timestamp) // //go:nosplit -func (self Descriptor) SetTimes(dataAccessTimestamp NewTimestamp, dataModificationTimestamp NewTimestamp) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) SetTimes(dataAccessTimestamp NewTimestamp, dataModificationTimestamp NewTimestamp) { self0 := cm.Reinterpret[uint32](self) dataAccessTimestamp0, dataAccessTimestamp1, dataAccessTimestamp2 := lower_NewTimestamp(dataAccessTimestamp) dataModificationTimestamp0, dataModificationTimestamp1, dataModificationTimestamp2 := lower_NewTimestamp(dataModificationTimestamp) - wasmimport_DescriptorSetTimes((uint32)(self0), (uint32)(dataAccessTimestamp0), (uint64)(dataAccessTimestamp1), (uint32)(dataAccessTimestamp2), (uint32)(dataModificationTimestamp0), (uint64)(dataModificationTimestamp1), (uint32)(dataModificationTimestamp2), &result) + wasmimport_DescriptorSetTimes((uint32)(self0), (uint32)(dataAccessTimestamp0), (uint64)(dataAccessTimestamp1), (uint32)(dataAccessTimestamp2), (uint32)(dataModificationTimestamp0), (uint64)(dataModificationTimestamp1), (uint32)(dataModificationTimestamp2)) return } // SetTimesAt represents the imported method "set-times-at". // // set-times-at: func(path-flags: path-flags, path: string, data-access-timestamp: -// new-timestamp, data-modification-timestamp: new-timestamp) -> result<_, error-code> +// new-timestamp, data-modification-timestamp: new-timestamp) // //go:nosplit -func (self Descriptor) SetTimesAt(pathFlags PathFlags, path string, dataAccessTimestamp NewTimestamp, dataModificationTimestamp NewTimestamp) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) SetTimesAt(pathFlags PathFlags, path string, dataAccessTimestamp NewTimestamp, dataModificationTimestamp NewTimestamp) { self0 := cm.Reinterpret[uint32](self) pathFlags0 := (uint32)(pathFlags) path0, path1 := cm.LowerString(path) dataAccessTimestamp0, dataAccessTimestamp1, dataAccessTimestamp2 := lower_NewTimestamp(dataAccessTimestamp) dataModificationTimestamp0, dataModificationTimestamp1, dataModificationTimestamp2 := lower_NewTimestamp(dataModificationTimestamp) - wasmimport_DescriptorSetTimesAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), (uint32)(dataAccessTimestamp0), (uint64)(dataAccessTimestamp1), (uint32)(dataAccessTimestamp2), (uint32)(dataModificationTimestamp0), (uint64)(dataModificationTimestamp1), (uint32)(dataModificationTimestamp2), &result) + wasmimport_DescriptorSetTimesAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), (uint32)(dataAccessTimestamp0), (uint64)(dataAccessTimestamp1), (uint32)(dataAccessTimestamp2), (uint32)(dataModificationTimestamp0), (uint64)(dataModificationTimestamp1), (uint32)(dataModificationTimestamp2)) return } // Stat represents the imported method "stat". // -// stat: func() -> result +// stat: func() // //go:nosplit -func (self Descriptor) Stat() (result cm.Result[DescriptorStatShape, DescriptorStat, ErrorCode]) { +func (self Descriptor) Stat() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorStat((uint32)(self0), &result) + wasmimport_DescriptorStat((uint32)(self0)) return } // StatAt represents the imported method "stat-at". // -// stat-at: func(path-flags: path-flags, path: string) -> result +// stat-at: func(path-flags: path-flags, path: string) // //go:nosplit -func (self Descriptor) StatAt(pathFlags PathFlags, path string) (result cm.Result[DescriptorStatShape, DescriptorStat, ErrorCode]) { +func (self Descriptor) StatAt(pathFlags PathFlags, path string) { self0 := cm.Reinterpret[uint32](self) pathFlags0 := (uint32)(pathFlags) path0, path1 := cm.LowerString(path) - wasmimport_DescriptorStatAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), &result) + wasmimport_DescriptorStatAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1)) return } // SymlinkAt represents the imported method "symlink-at". // -// symlink-at: func(old-path: string, new-path: string) -> result<_, error-code> +// symlink-at: func(old-path: string, new-path: string) // //go:nosplit -func (self Descriptor) SymlinkAt(oldPath string, newPath string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) SymlinkAt(oldPath string, newPath string) { self0 := cm.Reinterpret[uint32](self) oldPath0, oldPath1 := cm.LowerString(oldPath) newPath0, newPath1 := cm.LowerString(newPath) - wasmimport_DescriptorSymlinkAt((uint32)(self0), (*uint8)(oldPath0), (uint32)(oldPath1), (*uint8)(newPath0), (uint32)(newPath1), &result) + wasmimport_DescriptorSymlinkAt((uint32)(self0), (*uint8)(oldPath0), (uint32)(oldPath1), (*uint8)(newPath0), (uint32)(newPath1)) return } // Sync represents the imported method "sync". // -// sync: func() -> result<_, error-code> +// sync: func() // //go:nosplit -func (self Descriptor) Sync() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) Sync() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorSync((uint32)(self0), &result) + wasmimport_DescriptorSync((uint32)(self0)) return } // SyncData represents the imported method "sync-data". // -// sync-data: func() -> result<_, error-code> +// sync-data: func() // //go:nosplit -func (self Descriptor) SyncData() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) SyncData() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorSyncData((uint32)(self0), &result) + wasmimport_DescriptorSyncData((uint32)(self0)) return } // UnlinkFileAt represents the imported method "unlink-file-at". // -// unlink-file-at: func(path: string) -> result<_, error-code> +// unlink-file-at: func(path: string) // //go:nosplit -func (self Descriptor) UnlinkFileAt(path string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) UnlinkFileAt(path string) { self0 := cm.Reinterpret[uint32](self) path0, path1 := cm.LowerString(path) - wasmimport_DescriptorUnlinkFileAt((uint32)(self0), (*uint8)(path0), (uint32)(path1), &result) + wasmimport_DescriptorUnlinkFileAt((uint32)(self0), (*uint8)(path0), (uint32)(path1)) return } // Write represents the imported method "write". // -// write: func(buffer: list, offset: filesize) -> result +// write: func(buffer: list, offset: filesize) // //go:nosplit -func (self Descriptor) Write(buffer cm.List[uint8], offset FileSize) (result cm.Result[uint64, FileSize, ErrorCode]) { +func (self Descriptor) Write(buffer cm.List[uint8], offset FileSize) { self0 := cm.Reinterpret[uint32](self) buffer0, buffer1 := cm.LowerList(buffer) offset0 := (uint64)(offset) - wasmimport_DescriptorWrite((uint32)(self0), (*uint8)(buffer0), (uint32)(buffer1), (uint64)(offset0), &result) + wasmimport_DescriptorWrite((uint32)(self0), (*uint8)(buffer0), (uint32)(buffer1), (uint64)(offset0)) return } // WriteViaStream represents the imported method "write-via-stream". // -// write-via-stream: func(offset: filesize) -> result +// write-via-stream: func(offset: filesize) // //go:nosplit -func (self Descriptor) WriteViaStream(offset FileSize) (result cm.Result[OutputStream, OutputStream, ErrorCode]) { +func (self Descriptor) WriteViaStream(offset FileSize) { self0 := cm.Reinterpret[uint32](self) offset0 := (uint64)(offset) - wasmimport_DescriptorWriteViaStream((uint32)(self0), (uint64)(offset0), &result) + wasmimport_DescriptorWriteViaStream((uint32)(self0), (uint64)(offset0)) return } @@ -766,22 +762,22 @@ func (self DirectoryEntryStream) ResourceDrop() { // ReadDirectoryEntry represents the imported method "read-directory-entry". // -// read-directory-entry: func() -> result, error-code> +// read-directory-entry: func() // //go:nosplit -func (self DirectoryEntryStream) ReadDirectoryEntry() (result cm.Result[OptionDirectoryEntryShape, cm.Option[DirectoryEntry], ErrorCode]) { +func (self DirectoryEntryStream) ReadDirectoryEntry() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DirectoryEntryStreamReadDirectoryEntry((uint32)(self0), &result) + wasmimport_DirectoryEntryStreamReadDirectoryEntry((uint32)(self0)) return } // FilesystemErrorCode represents the imported function "filesystem-error-code". // -// filesystem-error-code: func(err: borrow) -> option +// filesystem-error-code: func(err: borrow) // //go:nosplit -func FilesystemErrorCode(err Error) (result cm.Option[ErrorCode]) { +func FilesystemErrorCode(err Error) { err0 := cm.Reinterpret[uint32](err) - wasmimport_FilesystemErrorCode((uint32)(err0), &result) + wasmimport_FilesystemErrorCode((uint32)(err0)) return } diff --git a/examples/component/http-server/gen/wasi/http/outgoing-handler/abi.go b/examples/component/http-server/gen/wasi/http/outgoing-handler/abi.go index 334f455c..5c6a7b48 100755 --- a/examples/component/http-server/gen/wasi/http/outgoing-handler/abi.go +++ b/examples/component/http-server/gen/wasi/http/outgoing-handler/abi.go @@ -3,17 +3,9 @@ package outgoinghandler import ( - "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/http/types" "go.bytecodealliance.org/cm" - "unsafe" ) -// ErrorCodeShape is used for storage in variant or result types. -type ErrorCodeShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(types.ErrorCode{})]byte -} - func lower_OptionRequestOptions(v cm.Option[RequestOptions]) (f0 uint32, f1 uint32) { some := v.Some() if some != nil { diff --git a/examples/component/http-server/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go b/examples/component/http-server/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go index 48d756fb..7c81b9dc 100755 --- a/examples/component/http-server/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go +++ b/examples/component/http-server/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go @@ -44,13 +44,12 @@ type ErrorCode = types.ErrorCode // or not allowed to be made. Otherwise, protocol errors are reported // through the `future-incoming-response`. // -// handle: func(request: outgoing-request, options: option) -> result +// handle: func(request: outgoing-request, options: option) // //go:nosplit -func Handle(request OutgoingRequest, options cm.Option[RequestOptions]) (result cm.Result[ErrorCodeShape, FutureIncomingResponse, ErrorCode]) { +func Handle(request OutgoingRequest, options cm.Option[RequestOptions]) { request0 := cm.Reinterpret[uint32](request) options0, options1 := lower_OptionRequestOptions(options) - wasmimport_Handle((uint32)(request0), (uint32)(options0), (uint32)(options1), &result) + wasmimport_Handle((uint32)(request0), (uint32)(options0), (uint32)(options1)) return } diff --git a/examples/component/http-server/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go b/examples/component/http-server/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go index 6b3f3828..1f362c2a 100755 --- a/examples/component/http-server/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go +++ b/examples/component/http-server/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go @@ -2,12 +2,8 @@ package outgoinghandler -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:http@0.2.0". //go:wasmimport wasi:http/outgoing-handler@0.2.0 handle //go:noescape -func wasmimport_Handle(request0 uint32, options0 uint32, options1 uint32, result *cm.Result[ErrorCodeShape, FutureIncomingResponse, ErrorCode]) +func wasmimport_Handle(request0 uint32, options0 uint32, options1 uint32) diff --git a/examples/component/http-server/gen/wasi/http/types/types.wasm.go b/examples/component/http-server/gen/wasi/http/types/types.wasm.go index b025b2af..584e55ae 100755 --- a/examples/component/http-server/gen/wasi/http/types/types.wasm.go +++ b/examples/component/http-server/gen/wasi/http/types/types.wasm.go @@ -14,39 +14,39 @@ func wasmimport_FieldsResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [constructor]fields //go:noescape -func wasmimport_NewFields() (result0 uint32) +func wasmimport_NewFields() //go:wasmimport wasi:http/types@0.2.0 [static]fields.from-list //go:noescape -func wasmimport_FieldsFromList(entries0 *cm.Tuple[FieldKey, FieldValue], entries1 uint32, result *cm.Result[Fields, Fields, HeaderError]) +func wasmimport_FieldsFromList(entries0 *cm.Tuple[FieldKey, FieldValue], entries1 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]fields.append //go:noescape -func wasmimport_FieldsAppend(self0 uint32, name0 *uint8, name1 uint32, value0 *uint8, value1 uint32, result *cm.Result[HeaderError, struct{}, HeaderError]) +func wasmimport_FieldsAppend(self0 uint32, name0 *uint8, name1 uint32, value0 *uint8, value1 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]fields.clone //go:noescape -func wasmimport_FieldsClone(self0 uint32) (result0 uint32) +func wasmimport_FieldsClone(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]fields.delete //go:noescape -func wasmimport_FieldsDelete(self0 uint32, name0 *uint8, name1 uint32, result *cm.Result[HeaderError, struct{}, HeaderError]) +func wasmimport_FieldsDelete(self0 uint32, name0 *uint8, name1 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]fields.entries //go:noescape -func wasmimport_FieldsEntries(self0 uint32, result *cm.List[cm.Tuple[FieldKey, FieldValue]]) +func wasmimport_FieldsEntries(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]fields.get //go:noescape -func wasmimport_FieldsGet(self0 uint32, name0 *uint8, name1 uint32, result *cm.List[FieldValue]) +func wasmimport_FieldsGet(self0 uint32, name0 *uint8, name1 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]fields.has //go:noescape -func wasmimport_FieldsHas(self0 uint32, name0 *uint8, name1 uint32) (result0 uint32) +func wasmimport_FieldsHas(self0 uint32, name0 *uint8, name1 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]fields.set //go:noescape -func wasmimport_FieldsSet(self0 uint32, name0 *uint8, name1 uint32, value0 *FieldValue, value1 uint32, result *cm.Result[HeaderError, struct{}, HeaderError]) +func wasmimport_FieldsSet(self0 uint32, name0 *uint8, name1 uint32, value0 *FieldValue, value1 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]incoming-request //go:noescape @@ -54,27 +54,27 @@ func wasmimport_IncomingRequestResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.authority //go:noescape -func wasmimport_IncomingRequestAuthority(self0 uint32, result *cm.Option[string]) +func wasmimport_IncomingRequestAuthority(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.consume //go:noescape -func wasmimport_IncomingRequestConsume(self0 uint32, result *cm.Result[IncomingBody, IncomingBody, struct{}]) +func wasmimport_IncomingRequestConsume(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.headers //go:noescape -func wasmimport_IncomingRequestHeaders(self0 uint32) (result0 uint32) +func wasmimport_IncomingRequestHeaders(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.method //go:noescape -func wasmimport_IncomingRequestMethod(self0 uint32, result *Method) +func wasmimport_IncomingRequestMethod(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.path-with-query //go:noescape -func wasmimport_IncomingRequestPathWithQuery(self0 uint32, result *cm.Option[string]) +func wasmimport_IncomingRequestPathWithQuery(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.scheme //go:noescape -func wasmimport_IncomingRequestScheme(self0 uint32, result *cm.Option[Scheme]) +func wasmimport_IncomingRequestScheme(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]outgoing-request //go:noescape @@ -82,47 +82,47 @@ func wasmimport_OutgoingRequestResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [constructor]outgoing-request //go:noescape -func wasmimport_NewOutgoingRequest(headers0 uint32) (result0 uint32) +func wasmimport_NewOutgoingRequest(headers0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.authority //go:noescape -func wasmimport_OutgoingRequestAuthority(self0 uint32, result *cm.Option[string]) +func wasmimport_OutgoingRequestAuthority(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.body //go:noescape -func wasmimport_OutgoingRequestBody(self0 uint32, result *cm.Result[OutgoingBody, OutgoingBody, struct{}]) +func wasmimport_OutgoingRequestBody(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.headers //go:noescape -func wasmimport_OutgoingRequestHeaders(self0 uint32) (result0 uint32) +func wasmimport_OutgoingRequestHeaders(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.method //go:noescape -func wasmimport_OutgoingRequestMethod(self0 uint32, result *Method) +func wasmimport_OutgoingRequestMethod(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.path-with-query //go:noescape -func wasmimport_OutgoingRequestPathWithQuery(self0 uint32, result *cm.Option[string]) +func wasmimport_OutgoingRequestPathWithQuery(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.scheme //go:noescape -func wasmimport_OutgoingRequestScheme(self0 uint32, result *cm.Option[Scheme]) +func wasmimport_OutgoingRequestScheme(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-authority //go:noescape -func wasmimport_OutgoingRequestSetAuthority(self0 uint32, authority0 uint32, authority1 *uint8, authority2 uint32) (result0 uint32) +func wasmimport_OutgoingRequestSetAuthority(self0 uint32, authority0 uint32, authority1 *uint8, authority2 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-method //go:noescape -func wasmimport_OutgoingRequestSetMethod(self0 uint32, method0 uint32, method1 *uint8, method2 uint32) (result0 uint32) +func wasmimport_OutgoingRequestSetMethod(self0 uint32, method0 uint32, method1 *uint8, method2 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-path-with-query //go:noescape -func wasmimport_OutgoingRequestSetPathWithQuery(self0 uint32, pathWithQuery0 uint32, pathWithQuery1 *uint8, pathWithQuery2 uint32) (result0 uint32) +func wasmimport_OutgoingRequestSetPathWithQuery(self0 uint32, pathWithQuery0 uint32, pathWithQuery1 *uint8, pathWithQuery2 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-scheme //go:noescape -func wasmimport_OutgoingRequestSetScheme(self0 uint32, scheme0 uint32, scheme1 uint32, scheme2 *uint8, scheme3 uint32) (result0 uint32) +func wasmimport_OutgoingRequestSetScheme(self0 uint32, scheme0 uint32, scheme1 uint32, scheme2 *uint8, scheme3 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]request-options //go:noescape @@ -130,31 +130,31 @@ func wasmimport_RequestOptionsResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [constructor]request-options //go:noescape -func wasmimport_NewRequestOptions() (result0 uint32) +func wasmimport_NewRequestOptions() //go:wasmimport wasi:http/types@0.2.0 [method]request-options.between-bytes-timeout //go:noescape -func wasmimport_RequestOptionsBetweenBytesTimeout(self0 uint32, result *cm.Option[Duration]) +func wasmimport_RequestOptionsBetweenBytesTimeout(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]request-options.connect-timeout //go:noescape -func wasmimport_RequestOptionsConnectTimeout(self0 uint32, result *cm.Option[Duration]) +func wasmimport_RequestOptionsConnectTimeout(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]request-options.first-byte-timeout //go:noescape -func wasmimport_RequestOptionsFirstByteTimeout(self0 uint32, result *cm.Option[Duration]) +func wasmimport_RequestOptionsFirstByteTimeout(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]request-options.set-between-bytes-timeout //go:noescape -func wasmimport_RequestOptionsSetBetweenBytesTimeout(self0 uint32, duration0 uint32, duration1 uint64) (result0 uint32) +func wasmimport_RequestOptionsSetBetweenBytesTimeout(self0 uint32, duration0 uint32, duration1 uint64) //go:wasmimport wasi:http/types@0.2.0 [method]request-options.set-connect-timeout //go:noescape -func wasmimport_RequestOptionsSetConnectTimeout(self0 uint32, duration0 uint32, duration1 uint64) (result0 uint32) +func wasmimport_RequestOptionsSetConnectTimeout(self0 uint32, duration0 uint32, duration1 uint64) //go:wasmimport wasi:http/types@0.2.0 [method]request-options.set-first-byte-timeout //go:noescape -func wasmimport_RequestOptionsSetFirstByteTimeout(self0 uint32, duration0 uint32, duration1 uint64) (result0 uint32) +func wasmimport_RequestOptionsSetFirstByteTimeout(self0 uint32, duration0 uint32, duration1 uint64) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]response-outparam //go:noescape @@ -170,15 +170,15 @@ func wasmimport_IncomingResponseResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-response.consume //go:noescape -func wasmimport_IncomingResponseConsume(self0 uint32, result *cm.Result[IncomingBody, IncomingBody, struct{}]) +func wasmimport_IncomingResponseConsume(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-response.headers //go:noescape -func wasmimport_IncomingResponseHeaders(self0 uint32) (result0 uint32) +func wasmimport_IncomingResponseHeaders(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-response.status //go:noescape -func wasmimport_IncomingResponseStatus(self0 uint32) (result0 uint32) +func wasmimport_IncomingResponseStatus(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]incoming-body //go:noescape @@ -186,11 +186,11 @@ func wasmimport_IncomingBodyResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [static]incoming-body.finish //go:noescape -func wasmimport_IncomingBodyFinish(this0 uint32) (result0 uint32) +func wasmimport_IncomingBodyFinish(this0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-body.stream //go:noescape -func wasmimport_IncomingBodyStream(self0 uint32, result *cm.Result[InputStream, InputStream, struct{}]) +func wasmimport_IncomingBodyStream(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]future-trailers //go:noescape @@ -198,11 +198,11 @@ func wasmimport_FutureTrailersResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]future-trailers.get //go:noescape -func wasmimport_FutureTrailersGet(self0 uint32, result *cm.Option[cm.Result[cm.Result[ErrorCodeShape, cm.Option[Trailers], ErrorCode], cm.Result[ErrorCodeShape, cm.Option[Trailers], ErrorCode], struct{}]]) +func wasmimport_FutureTrailersGet(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]future-trailers.subscribe //go:noescape -func wasmimport_FutureTrailersSubscribe(self0 uint32) (result0 uint32) +func wasmimport_FutureTrailersSubscribe(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]outgoing-response //go:noescape @@ -210,23 +210,23 @@ func wasmimport_OutgoingResponseResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [constructor]outgoing-response //go:noescape -func wasmimport_NewOutgoingResponse(headers0 uint32) (result0 uint32) +func wasmimport_NewOutgoingResponse(headers0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.body //go:noescape -func wasmimport_OutgoingResponseBody(self0 uint32, result *cm.Result[OutgoingBody, OutgoingBody, struct{}]) +func wasmimport_OutgoingResponseBody(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.headers //go:noescape -func wasmimport_OutgoingResponseHeaders(self0 uint32) (result0 uint32) +func wasmimport_OutgoingResponseHeaders(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.set-status-code //go:noescape -func wasmimport_OutgoingResponseSetStatusCode(self0 uint32, statusCode0 uint32) (result0 uint32) +func wasmimport_OutgoingResponseSetStatusCode(self0 uint32, statusCode0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.status-code //go:noescape -func wasmimport_OutgoingResponseStatusCode(self0 uint32) (result0 uint32) +func wasmimport_OutgoingResponseStatusCode(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]outgoing-body //go:noescape @@ -234,11 +234,11 @@ func wasmimport_OutgoingBodyResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [static]outgoing-body.finish //go:noescape -func wasmimport_OutgoingBodyFinish(this0 uint32, trailers0 uint32, trailers1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_OutgoingBodyFinish(this0 uint32, trailers0 uint32, trailers1 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-body.write //go:noescape -func wasmimport_OutgoingBodyWrite(self0 uint32, result *cm.Result[OutputStream, OutputStream, struct{}]) +func wasmimport_OutgoingBodyWrite(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]future-incoming-response //go:noescape @@ -246,12 +246,12 @@ func wasmimport_FutureIncomingResponseResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]future-incoming-response.get //go:noescape -func wasmimport_FutureIncomingResponseGet(self0 uint32, result *cm.Option[cm.Result[cm.Result[ErrorCodeShape, IncomingResponse, ErrorCode], cm.Result[ErrorCodeShape, IncomingResponse, ErrorCode], struct{}]]) +func wasmimport_FutureIncomingResponseGet(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]future-incoming-response.subscribe //go:noescape -func wasmimport_FutureIncomingResponseSubscribe(self0 uint32) (result0 uint32) +func wasmimport_FutureIncomingResponseSubscribe(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 http-error-code //go:noescape -func wasmimport_HTTPErrorCode(err0 uint32, result *cm.Option[ErrorCode]) +func wasmimport_HTTPErrorCode(err0 uint32) diff --git a/examples/component/http-server/gen/wasi/http/types/types.wit.go b/examples/component/http-server/gen/wasi/http/types/types.wit.go index a1b516dc..33d42273 100755 --- a/examples/component/http-server/gen/wasi/http/types/types.wit.go +++ b/examples/component/http-server/gen/wasi/http/types/types.wit.go @@ -886,9 +886,8 @@ func (self Fields) ResourceDrop() { // constructor() // //go:nosplit -func NewFields() (result Fields) { - result0 := wasmimport_NewFields() - result = cm.Reinterpret[Fields]((uint32)(result0)) +func NewFields() { + wasmimport_NewFields() return } @@ -910,13 +909,12 @@ func NewFields() (result Fields) { // An error result will be returned if any header or value was // syntactically invalid, or if a header was forbidden. // -// from-list: static func(entries: list>) -> result +// from-list: static func(entries: list>) // //go:nosplit -func FieldsFromList(entries cm.List[cm.Tuple[FieldKey, FieldValue]]) (result cm.Result[Fields, Fields, HeaderError]) { +func FieldsFromList(entries cm.List[cm.Tuple[FieldKey, FieldValue]]) { entries0, entries1 := cm.LowerList(entries) - wasmimport_FieldsFromList((*cm.Tuple[FieldKey, FieldValue])(entries0), (uint32)(entries1), &result) + wasmimport_FieldsFromList((*cm.Tuple[FieldKey, FieldValue])(entries0), (uint32)(entries1)) return } @@ -927,14 +925,14 @@ func FieldsFromList(entries cm.List[cm.Tuple[FieldKey, FieldValue]]) (result cm. // // Fails with `header-error.immutable` if the `fields` are immutable. // -// append: func(name: field-key, value: field-value) -> result<_, header-error> +// append: func(name: field-key, value: field-value) // //go:nosplit -func (self Fields) Append(name FieldKey, value FieldValue) (result cm.Result[HeaderError, struct{}, HeaderError]) { +func (self Fields) Append(name FieldKey, value FieldValue) { self0 := cm.Reinterpret[uint32](self) name0, name1 := cm.LowerString(name) value0, value1 := cm.LowerList(value) - wasmimport_FieldsAppend((uint32)(self0), (*uint8)(name0), (uint32)(name1), (*uint8)(value0), (uint32)(value1), &result) + wasmimport_FieldsAppend((uint32)(self0), (*uint8)(name0), (uint32)(name1), (*uint8)(value0), (uint32)(value1)) return } @@ -944,13 +942,12 @@ func (self Fields) Append(name FieldKey, value FieldValue) (result cm.Result[Hea // `fields` constructor on the return value of `entries`. The resulting // `fields` is mutable. // -// clone: func() -> fields +// clone: func() // //go:nosplit -func (self Fields) Clone() (result Fields) { +func (self Fields) Clone() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_FieldsClone((uint32)(self0)) - result = cm.Reinterpret[Fields]((uint32)(result0)) + wasmimport_FieldsClone((uint32)(self0)) return } @@ -961,13 +958,13 @@ func (self Fields) Clone() (result Fields) { // // Fails with `header-error.immutable` if the `fields` are immutable. // -// delete: func(name: field-key) -> result<_, header-error> +// delete: func(name: field-key) // //go:nosplit -func (self Fields) Delete(name FieldKey) (result cm.Result[HeaderError, struct{}, HeaderError]) { +func (self Fields) Delete(name FieldKey) { self0 := cm.Reinterpret[uint32](self) name0, name1 := cm.LowerString(name) - wasmimport_FieldsDelete((uint32)(self0), (*uint8)(name0), (uint32)(name1), &result) + wasmimport_FieldsDelete((uint32)(self0), (*uint8)(name0), (uint32)(name1)) return } @@ -980,12 +977,12 @@ func (self Fields) Delete(name FieldKey) (result cm.Result[HeaderError, struct{} // which have multiple values are represented by multiple entries in this // list with the same key. // -// entries: func() -> list> +// entries: func() // //go:nosplit -func (self Fields) Entries() (result cm.List[cm.Tuple[FieldKey, FieldValue]]) { +func (self Fields) Entries() { self0 := cm.Reinterpret[uint32](self) - wasmimport_FieldsEntries((uint32)(self0), &result) + wasmimport_FieldsEntries((uint32)(self0)) return } @@ -996,13 +993,13 @@ func (self Fields) Entries() (result cm.List[cm.Tuple[FieldKey, FieldValue]]) { // present but empty, this is represented by a list with one or more // empty field-values present. // -// get: func(name: field-key) -> list +// get: func(name: field-key) // //go:nosplit -func (self Fields) Get(name FieldKey) (result cm.List[FieldValue]) { +func (self Fields) Get(name FieldKey) { self0 := cm.Reinterpret[uint32](self) name0, name1 := cm.LowerString(name) - wasmimport_FieldsGet((uint32)(self0), (*uint8)(name0), (uint32)(name1), &result) + wasmimport_FieldsGet((uint32)(self0), (*uint8)(name0), (uint32)(name1)) return } @@ -1011,14 +1008,13 @@ func (self Fields) Get(name FieldKey) (result cm.List[FieldValue]) { // Returns `true` when the key is present in this `fields`. If the key is // syntactically invalid, `false` is returned. // -// has: func(name: field-key) -> bool +// has: func(name: field-key) // //go:nosplit -func (self Fields) Has(name FieldKey) (result bool) { +func (self Fields) Has(name FieldKey) { self0 := cm.Reinterpret[uint32](self) name0, name1 := cm.LowerString(name) - result0 := wasmimport_FieldsHas((uint32)(self0), (*uint8)(name0), (uint32)(name1)) - result = (bool)(cm.U32ToBool((uint32)(result0))) + wasmimport_FieldsHas((uint32)(self0), (*uint8)(name0), (uint32)(name1)) return } @@ -1029,14 +1025,14 @@ func (self Fields) Has(name FieldKey) (result bool) { // // Fails with `header-error.immutable` if the `fields` are immutable. // -// set: func(name: field-key, value: list) -> result<_, header-error> +// set: func(name: field-key, value: list) // //go:nosplit -func (self Fields) Set(name FieldKey, value cm.List[FieldValue]) (result cm.Result[HeaderError, struct{}, HeaderError]) { +func (self Fields) Set(name FieldKey, value cm.List[FieldValue]) { self0 := cm.Reinterpret[uint32](self) name0, name1 := cm.LowerString(name) value0, value1 := cm.LowerList(value) - wasmimport_FieldsSet((uint32)(self0), (*uint8)(name0), (uint32)(name1), (*FieldValue)(value0), (uint32)(value1), &result) + wasmimport_FieldsSet((uint32)(self0), (*uint8)(name0), (uint32)(name1), (*FieldValue)(value0), (uint32)(value1)) return } @@ -1072,12 +1068,12 @@ func (self IncomingRequest) ResourceDrop() { // // Returns the authority from the request, if it was present. // -// authority: func() -> option +// authority: func() // //go:nosplit -func (self IncomingRequest) Authority() (result cm.Option[string]) { +func (self IncomingRequest) Authority() { self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestAuthority((uint32)(self0), &result) + wasmimport_IncomingRequestAuthority((uint32)(self0)) return } @@ -1086,12 +1082,12 @@ func (self IncomingRequest) Authority() (result cm.Option[string]) { // Gives the `incoming-body` associated with this request. Will only // return success at most once, and subsequent calls will return error. // -// consume: func() -> result +// consume: func() // //go:nosplit -func (self IncomingRequest) Consume() (result cm.Result[IncomingBody, IncomingBody, struct{}]) { +func (self IncomingRequest) Consume() { self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestConsume((uint32)(self0), &result) + wasmimport_IncomingRequestConsume((uint32)(self0)) return } @@ -1106,13 +1102,12 @@ func (self IncomingRequest) Consume() (result cm.Result[IncomingBody, IncomingBo // the parent `incoming-request` is dropped. Dropping this // `incoming-request` before all children are dropped will trap. // -// headers: func() -> headers +// headers: func() // //go:nosplit -func (self IncomingRequest) Headers() (result Headers) { +func (self IncomingRequest) Headers() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_IncomingRequestHeaders((uint32)(self0)) - result = cm.Reinterpret[Headers]((uint32)(result0)) + wasmimport_IncomingRequestHeaders((uint32)(self0)) return } @@ -1120,12 +1115,12 @@ func (self IncomingRequest) Headers() (result Headers) { // // Returns the method of the incoming request. // -// method: func() -> method +// method: func() // //go:nosplit -func (self IncomingRequest) Method() (result Method) { +func (self IncomingRequest) Method() { self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestMethod((uint32)(self0), &result) + wasmimport_IncomingRequestMethod((uint32)(self0)) return } @@ -1133,12 +1128,12 @@ func (self IncomingRequest) Method() (result Method) { // // Returns the path with query parameters from the request, as a string. // -// path-with-query: func() -> option +// path-with-query: func() // //go:nosplit -func (self IncomingRequest) PathWithQuery() (result cm.Option[string]) { +func (self IncomingRequest) PathWithQuery() { self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestPathWithQuery((uint32)(self0), &result) + wasmimport_IncomingRequestPathWithQuery((uint32)(self0)) return } @@ -1146,12 +1141,12 @@ func (self IncomingRequest) PathWithQuery() (result cm.Option[string]) { // // Returns the protocol scheme from the request. // -// scheme: func() -> option +// scheme: func() // //go:nosplit -func (self IncomingRequest) Scheme() (result cm.Option[Scheme]) { +func (self IncomingRequest) Scheme() { self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestScheme((uint32)(self0), &result) + wasmimport_IncomingRequestScheme((uint32)(self0)) return } @@ -1189,10 +1184,9 @@ func (self OutgoingRequest) ResourceDrop() { // constructor(headers: headers) // //go:nosplit -func NewOutgoingRequest(headers Headers) (result OutgoingRequest) { +func NewOutgoingRequest(headers Headers) { headers0 := cm.Reinterpret[uint32](headers) - result0 := wasmimport_NewOutgoingRequest((uint32)(headers0)) - result = cm.Reinterpret[OutgoingRequest]((uint32)(result0)) + wasmimport_NewOutgoingRequest((uint32)(headers0)) return } @@ -1202,12 +1196,12 @@ func NewOutgoingRequest(headers Headers) (result OutgoingRequest) { // with Related Schemes which do not require an Authority. The HTTP and // HTTPS schemes always require an authority. // -// authority: func() -> option +// authority: func() // //go:nosplit -func (self OutgoingRequest) Authority() (result cm.Option[string]) { +func (self OutgoingRequest) Authority() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestAuthority((uint32)(self0), &result) + wasmimport_OutgoingRequestAuthority((uint32)(self0)) return } @@ -1220,12 +1214,12 @@ func (self OutgoingRequest) Authority() (result cm.Option[string]) { // this `outgoing-request` can be retrieved at most once. Subsequent // calls will return error. // -// body: func() -> result +// body: func() // //go:nosplit -func (self OutgoingRequest) Body() (result cm.Result[OutgoingBody, OutgoingBody, struct{}]) { +func (self OutgoingRequest) Body() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestBody((uint32)(self0), &result) + wasmimport_OutgoingRequestBody((uint32)(self0)) return } @@ -1240,13 +1234,12 @@ func (self OutgoingRequest) Body() (result cm.Result[OutgoingBody, OutgoingBody, // `outgoing-request` is dropped, or its ownership is transfered to // another component by e.g. `outgoing-handler.handle`. // -// headers: func() -> headers +// headers: func() // //go:nosplit -func (self OutgoingRequest) Headers() (result Headers) { +func (self OutgoingRequest) Headers() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutgoingRequestHeaders((uint32)(self0)) - result = cm.Reinterpret[Headers]((uint32)(result0)) + wasmimport_OutgoingRequestHeaders((uint32)(self0)) return } @@ -1254,12 +1247,12 @@ func (self OutgoingRequest) Headers() (result Headers) { // // Get the Method for the Request. // -// method: func() -> method +// method: func() // //go:nosplit -func (self OutgoingRequest) Method() (result Method) { +func (self OutgoingRequest) Method() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestMethod((uint32)(self0), &result) + wasmimport_OutgoingRequestMethod((uint32)(self0)) return } @@ -1268,12 +1261,12 @@ func (self OutgoingRequest) Method() (result Method) { // Get the combination of the HTTP Path and Query for the Request. // When `none`, this represents an empty Path and empty Query. // -// path-with-query: func() -> option +// path-with-query: func() // //go:nosplit -func (self OutgoingRequest) PathWithQuery() (result cm.Option[string]) { +func (self OutgoingRequest) PathWithQuery() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestPathWithQuery((uint32)(self0), &result) + wasmimport_OutgoingRequestPathWithQuery((uint32)(self0)) return } @@ -1282,12 +1275,12 @@ func (self OutgoingRequest) PathWithQuery() (result cm.Option[string]) { // Get the HTTP Related Scheme for the Request. When `none`, the // implementation may choose an appropriate default scheme. // -// scheme: func() -> option +// scheme: func() // //go:nosplit -func (self OutgoingRequest) Scheme() (result cm.Option[Scheme]) { +func (self OutgoingRequest) Scheme() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestScheme((uint32)(self0), &result) + wasmimport_OutgoingRequestScheme((uint32)(self0)) return } @@ -1298,14 +1291,13 @@ func (self OutgoingRequest) Scheme() (result cm.Option[Scheme]) { // HTTPS schemes always require an authority. Fails if the string given is // not a syntactically valid uri authority. // -// set-authority: func(authority: option) -> result +// set-authority: func(authority: option) // //go:nosplit -func (self OutgoingRequest) SetAuthority(authority cm.Option[string]) (result cm.BoolResult) { +func (self OutgoingRequest) SetAuthority(authority cm.Option[string]) { self0 := cm.Reinterpret[uint32](self) authority0, authority1, authority2 := lower_OptionString(authority) - result0 := wasmimport_OutgoingRequestSetAuthority((uint32)(self0), (uint32)(authority0), (*uint8)(authority1), (uint32)(authority2)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_OutgoingRequestSetAuthority((uint32)(self0), (uint32)(authority0), (*uint8)(authority1), (uint32)(authority2)) return } @@ -1314,14 +1306,13 @@ func (self OutgoingRequest) SetAuthority(authority cm.Option[string]) (result cm // Set the Method for the Request. Fails if the string present in a // `method.other` argument is not a syntactically valid method. // -// set-method: func(method: method) -> result +// set-method: func(method: method) // //go:nosplit -func (self OutgoingRequest) SetMethod(method Method) (result cm.BoolResult) { +func (self OutgoingRequest) SetMethod(method Method) { self0 := cm.Reinterpret[uint32](self) method0, method1, method2 := lower_Method(method) - result0 := wasmimport_OutgoingRequestSetMethod((uint32)(self0), (uint32)(method0), (*uint8)(method1), (uint32)(method2)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_OutgoingRequestSetMethod((uint32)(self0), (uint32)(method0), (*uint8)(method1), (uint32)(method2)) return } @@ -1331,14 +1322,13 @@ func (self OutgoingRequest) SetMethod(method Method) (result cm.BoolResult) { // When `none`, this represents an empty Path and empty Query. Fails is the // string given is not a syntactically valid path and query uri component. // -// set-path-with-query: func(path-with-query: option) -> result +// set-path-with-query: func(path-with-query: option) // //go:nosplit -func (self OutgoingRequest) SetPathWithQuery(pathWithQuery cm.Option[string]) (result cm.BoolResult) { +func (self OutgoingRequest) SetPathWithQuery(pathWithQuery cm.Option[string]) { self0 := cm.Reinterpret[uint32](self) pathWithQuery0, pathWithQuery1, pathWithQuery2 := lower_OptionString(pathWithQuery) - result0 := wasmimport_OutgoingRequestSetPathWithQuery((uint32)(self0), (uint32)(pathWithQuery0), (*uint8)(pathWithQuery1), (uint32)(pathWithQuery2)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_OutgoingRequestSetPathWithQuery((uint32)(self0), (uint32)(pathWithQuery0), (*uint8)(pathWithQuery1), (uint32)(pathWithQuery2)) return } @@ -1348,14 +1338,13 @@ func (self OutgoingRequest) SetPathWithQuery(pathWithQuery cm.Option[string]) (r // implementation may choose an appropriate default scheme. Fails if the // string given is not a syntactically valid uri scheme. // -// set-scheme: func(scheme: option) -> result +// set-scheme: func(scheme: option) // //go:nosplit -func (self OutgoingRequest) SetScheme(scheme cm.Option[Scheme]) (result cm.BoolResult) { +func (self OutgoingRequest) SetScheme(scheme cm.Option[Scheme]) { self0 := cm.Reinterpret[uint32](self) scheme0, scheme1, scheme2, scheme3 := lower_OptionScheme(scheme) - result0 := wasmimport_OutgoingRequestSetScheme((uint32)(self0), (uint32)(scheme0), (uint32)(scheme1), (*uint8)(scheme2), (uint32)(scheme3)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_OutgoingRequestSetScheme((uint32)(self0), (uint32)(scheme0), (uint32)(scheme1), (*uint8)(scheme2), (uint32)(scheme3)) return } @@ -1389,9 +1378,8 @@ func (self RequestOptions) ResourceDrop() { // constructor() // //go:nosplit -func NewRequestOptions() (result RequestOptions) { - result0 := wasmimport_NewRequestOptions() - result = cm.Reinterpret[RequestOptions]((uint32)(result0)) +func NewRequestOptions() { + wasmimport_NewRequestOptions() return } @@ -1400,12 +1388,12 @@ func NewRequestOptions() (result RequestOptions) { // The timeout for receiving subsequent chunks of bytes in the Response // body stream. // -// between-bytes-timeout: func() -> option +// between-bytes-timeout: func() // //go:nosplit -func (self RequestOptions) BetweenBytesTimeout() (result cm.Option[Duration]) { +func (self RequestOptions) BetweenBytesTimeout() { self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsBetweenBytesTimeout((uint32)(self0), &result) + wasmimport_RequestOptionsBetweenBytesTimeout((uint32)(self0)) return } @@ -1413,12 +1401,12 @@ func (self RequestOptions) BetweenBytesTimeout() (result cm.Option[Duration]) { // // The timeout for the initial connect to the HTTP Server. // -// connect-timeout: func() -> option +// connect-timeout: func() // //go:nosplit -func (self RequestOptions) ConnectTimeout() (result cm.Option[Duration]) { +func (self RequestOptions) ConnectTimeout() { self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsConnectTimeout((uint32)(self0), &result) + wasmimport_RequestOptionsConnectTimeout((uint32)(self0)) return } @@ -1426,12 +1414,12 @@ func (self RequestOptions) ConnectTimeout() (result cm.Option[Duration]) { // // The timeout for receiving the first byte of the Response body. // -// first-byte-timeout: func() -> option +// first-byte-timeout: func() // //go:nosplit -func (self RequestOptions) FirstByteTimeout() (result cm.Option[Duration]) { +func (self RequestOptions) FirstByteTimeout() { self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsFirstByteTimeout((uint32)(self0), &result) + wasmimport_RequestOptionsFirstByteTimeout((uint32)(self0)) return } @@ -1441,14 +1429,13 @@ func (self RequestOptions) FirstByteTimeout() (result cm.Option[Duration]) { // body stream. An error return value indicates that this timeout is not // supported. // -// set-between-bytes-timeout: func(duration: option) -> result +// set-between-bytes-timeout: func(duration: option) // //go:nosplit -func (self RequestOptions) SetBetweenBytesTimeout(duration cm.Option[Duration]) (result cm.BoolResult) { +func (self RequestOptions) SetBetweenBytesTimeout(duration cm.Option[Duration]) { self0 := cm.Reinterpret[uint32](self) duration0, duration1 := lower_OptionDuration(duration) - result0 := wasmimport_RequestOptionsSetBetweenBytesTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_RequestOptionsSetBetweenBytesTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) return } @@ -1457,14 +1444,13 @@ func (self RequestOptions) SetBetweenBytesTimeout(duration cm.Option[Duration]) // Set the timeout for the initial connect to the HTTP Server. An error // return value indicates that this timeout is not supported. // -// set-connect-timeout: func(duration: option) -> result +// set-connect-timeout: func(duration: option) // //go:nosplit -func (self RequestOptions) SetConnectTimeout(duration cm.Option[Duration]) (result cm.BoolResult) { +func (self RequestOptions) SetConnectTimeout(duration cm.Option[Duration]) { self0 := cm.Reinterpret[uint32](self) duration0, duration1 := lower_OptionDuration(duration) - result0 := wasmimport_RequestOptionsSetConnectTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_RequestOptionsSetConnectTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) return } @@ -1473,14 +1459,13 @@ func (self RequestOptions) SetConnectTimeout(duration cm.Option[Duration]) (resu // Set the timeout for receiving the first byte of the Response body. An // error return value indicates that this timeout is not supported. // -// set-first-byte-timeout: func(duration: option) -> result +// set-first-byte-timeout: func(duration: option) // //go:nosplit -func (self RequestOptions) SetFirstByteTimeout(duration cm.Option[Duration]) (result cm.BoolResult) { +func (self RequestOptions) SetFirstByteTimeout(duration cm.Option[Duration]) { self0 := cm.Reinterpret[uint32](self) duration0, duration1 := lower_OptionDuration(duration) - result0 := wasmimport_RequestOptionsSetFirstByteTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_RequestOptionsSetFirstByteTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) return } @@ -1559,12 +1544,12 @@ func (self IncomingResponse) ResourceDrop() { // Returns the incoming body. May be called at most once. Returns error // if called additional times. // -// consume: func() -> result +// consume: func() // //go:nosplit -func (self IncomingResponse) Consume() (result cm.Result[IncomingBody, IncomingBody, struct{}]) { +func (self IncomingResponse) Consume() { self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingResponseConsume((uint32)(self0), &result) + wasmimport_IncomingResponseConsume((uint32)(self0)) return } @@ -1578,13 +1563,12 @@ func (self IncomingResponse) Consume() (result cm.Result[IncomingBody, IncomingB // This headers resource is a child: it must be dropped before the parent // `incoming-response` is dropped. // -// headers: func() -> headers +// headers: func() // //go:nosplit -func (self IncomingResponse) Headers() (result Headers) { +func (self IncomingResponse) Headers() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_IncomingResponseHeaders((uint32)(self0)) - result = cm.Reinterpret[Headers]((uint32)(result0)) + wasmimport_IncomingResponseHeaders((uint32)(self0)) return } @@ -1592,13 +1576,12 @@ func (self IncomingResponse) Headers() (result Headers) { // // Returns the status code from the incoming response. // -// status: func() -> status-code +// status: func() // //go:nosplit -func (self IncomingResponse) Status() (result StatusCode) { +func (self IncomingResponse) Status() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_IncomingResponseStatus((uint32)(self0)) - result = (StatusCode)((uint32)(result0)) + wasmimport_IncomingResponseStatus((uint32)(self0)) return } @@ -1632,13 +1615,12 @@ func (self IncomingBody) ResourceDrop() { // Takes ownership of `incoming-body`, and returns a `future-trailers`. // This function will trap if the `input-stream` child is still alive. // -// finish: static func(this: incoming-body) -> future-trailers +// finish: static func(this: incoming-body) // //go:nosplit -func IncomingBodyFinish(this IncomingBody) (result FutureTrailers) { +func IncomingBodyFinish(this IncomingBody) { this0 := cm.Reinterpret[uint32](this) - result0 := wasmimport_IncomingBodyFinish((uint32)(this0)) - result = cm.Reinterpret[FutureTrailers]((uint32)(result0)) + wasmimport_IncomingBodyFinish((uint32)(this0)) return } @@ -1660,12 +1642,12 @@ func IncomingBodyFinish(this IncomingBody) (result FutureTrailers) { // and for that backpressure to not inhibit delivery of the trailers if // the user does not read the entire body. // -// %stream: func() -> result +// %stream: func() // //go:nosplit -func (self IncomingBody) Stream() (result cm.Result[InputStream, InputStream, struct{}]) { +func (self IncomingBody) Stream() { self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingBodyStream((uint32)(self0), &result) + wasmimport_IncomingBodyStream((uint32)(self0)) return } @@ -1713,12 +1695,12 @@ func (self FutureTrailers) ResourceDrop() { // `delete` methods will return an error, and the resource must be // dropped before the parent `future-trailers` is dropped. // -// get: func() -> option, error-code>>> +// get: func() // //go:nosplit -func (self FutureTrailers) Get() (result cm.Option[cm.Result[cm.Result[ErrorCodeShape, cm.Option[Trailers], ErrorCode], cm.Result[ErrorCodeShape, cm.Option[Trailers], ErrorCode], struct{}]]) { +func (self FutureTrailers) Get() { self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureTrailersGet((uint32)(self0), &result) + wasmimport_FutureTrailersGet((uint32)(self0)) return } @@ -1728,13 +1710,12 @@ func (self FutureTrailers) Get() (result cm.Option[cm.Result[cm.Result[ErrorCode // been received, or an error has occured. When this pollable is ready, // the `get` method will return `some`. // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self FutureTrailers) Subscribe() (result Pollable) { +func (self FutureTrailers) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_FutureTrailersSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_FutureTrailersSubscribe((uint32)(self0)) return } @@ -1767,10 +1748,9 @@ func (self OutgoingResponse) ResourceDrop() { // constructor(headers: headers) // //go:nosplit -func NewOutgoingResponse(headers Headers) (result OutgoingResponse) { +func NewOutgoingResponse(headers Headers) { headers0 := cm.Reinterpret[uint32](headers) - result0 := wasmimport_NewOutgoingResponse((uint32)(headers0)) - result = cm.Reinterpret[OutgoingResponse]((uint32)(result0)) + wasmimport_NewOutgoingResponse((uint32)(headers0)) return } @@ -1782,12 +1762,12 @@ func NewOutgoingResponse(headers Headers) (result OutgoingResponse) { // this `outgoing-response` can be retrieved at most once. Subsequent // calls will return error. // -// body: func() -> result +// body: func() // //go:nosplit -func (self OutgoingResponse) Body() (result cm.Result[OutgoingBody, OutgoingBody, struct{}]) { +func (self OutgoingResponse) Body() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingResponseBody((uint32)(self0), &result) + wasmimport_OutgoingResponseBody((uint32)(self0)) return } @@ -1802,13 +1782,12 @@ func (self OutgoingResponse) Body() (result cm.Result[OutgoingBody, OutgoingBody // `outgoing-request` is dropped, or its ownership is transfered to // another component by e.g. `outgoing-handler.handle`. // -// headers: func() -> headers +// headers: func() // //go:nosplit -func (self OutgoingResponse) Headers() (result Headers) { +func (self OutgoingResponse) Headers() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutgoingResponseHeaders((uint32)(self0)) - result = cm.Reinterpret[Headers]((uint32)(result0)) + wasmimport_OutgoingResponseHeaders((uint32)(self0)) return } @@ -1817,14 +1796,13 @@ func (self OutgoingResponse) Headers() (result Headers) { // Set the HTTP Status Code for the Response. Fails if the status-code // given is not a valid http status code. // -// set-status-code: func(status-code: status-code) -> result +// set-status-code: func(status-code: status-code) // //go:nosplit -func (self OutgoingResponse) SetStatusCode(statusCode StatusCode) (result cm.BoolResult) { +func (self OutgoingResponse) SetStatusCode(statusCode StatusCode) { self0 := cm.Reinterpret[uint32](self) statusCode0 := (uint32)(statusCode) - result0 := wasmimport_OutgoingResponseSetStatusCode((uint32)(self0), (uint32)(statusCode0)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_OutgoingResponseSetStatusCode((uint32)(self0), (uint32)(statusCode0)) return } @@ -1832,13 +1810,12 @@ func (self OutgoingResponse) SetStatusCode(statusCode StatusCode) (result cm.Boo // // Get the HTTP Status Code for the Response. // -// status-code: func() -> status-code +// status-code: func() // //go:nosplit -func (self OutgoingResponse) StatusCode() (result StatusCode) { +func (self OutgoingResponse) StatusCode() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutgoingResponseStatusCode((uint32)(self0)) - result = (StatusCode)((uint32)(result0)) + wasmimport_OutgoingResponseStatusCode((uint32)(self0)) return } @@ -1887,14 +1864,13 @@ func (self OutgoingBody) ResourceDrop() { // to the body (via `write`) does not match the value given in the // Content-Length. // -// finish: static func(this: outgoing-body, trailers: option) -> result<_, -// error-code> +// finish: static func(this: outgoing-body, trailers: option) // //go:nosplit -func OutgoingBodyFinish(this OutgoingBody, trailers cm.Option[Trailers]) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func OutgoingBodyFinish(this OutgoingBody, trailers cm.Option[Trailers]) { this0 := cm.Reinterpret[uint32](this) trailers0, trailers1 := lower_OptionTrailers(trailers) - wasmimport_OutgoingBodyFinish((uint32)(this0), (uint32)(trailers0), (uint32)(trailers1), &result) + wasmimport_OutgoingBodyFinish((uint32)(this0), (uint32)(trailers0), (uint32)(trailers1)) return } @@ -1910,12 +1886,12 @@ func OutgoingBodyFinish(this OutgoingBody, trailers cm.Option[Trailers]) (result // this `outgoing-body` may be retrieved at most once. Subsequent calls // will return error. // -// write: func() -> result +// write: func() // //go:nosplit -func (self OutgoingBody) Write() (result cm.Result[OutputStream, OutputStream, struct{}]) { +func (self OutgoingBody) Write() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingBodyWrite((uint32)(self0), &result) + wasmimport_OutgoingBodyWrite((uint32)(self0)) return } @@ -1958,12 +1934,12 @@ func (self FutureIncomingResponse) ResourceDrop() { // but those will be reported by the `incoming-body` and its // `output-stream` child. // -// get: func() -> option>> +// get: func() // //go:nosplit -func (self FutureIncomingResponse) Get() (result cm.Option[cm.Result[cm.Result[ErrorCodeShape, IncomingResponse, ErrorCode], cm.Result[ErrorCodeShape, IncomingResponse, ErrorCode], struct{}]]) { +func (self FutureIncomingResponse) Get() { self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureIncomingResponseGet((uint32)(self0), &result) + wasmimport_FutureIncomingResponseGet((uint32)(self0)) return } @@ -1973,13 +1949,12 @@ func (self FutureIncomingResponse) Get() (result cm.Option[cm.Result[cm.Result[E // been received, or an error has occured. When this pollable is ready, // the `get` method will return `some`. // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self FutureIncomingResponse) Subscribe() (result Pollable) { +func (self FutureIncomingResponse) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_FutureIncomingResponseSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_FutureIncomingResponseSubscribe((uint32)(self0)) return } @@ -1997,11 +1972,11 @@ func (self FutureIncomingResponse) Subscribe() (result Pollable) { // Note that this function is fallible because not all io-errors are // http-related errors. // -// http-error-code: func(err: borrow) -> option +// http-error-code: func(err: borrow) // //go:nosplit -func HTTPErrorCode(err IOError) (result cm.Option[ErrorCode]) { +func HTTPErrorCode(err IOError) { err0 := cm.Reinterpret[uint32](err) - wasmimport_HTTPErrorCode((uint32)(err0), &result) + wasmimport_HTTPErrorCode((uint32)(err0)) return } diff --git a/examples/component/http-server/gen/wasi/io/error/error.wit.go b/examples/component/http-server/gen/wasi/io/error/error.wit.go index 828e977e..a7ebc7e4 100755 --- a/examples/component/http-server/gen/wasi/io/error/error.wit.go +++ b/examples/component/http-server/gen/wasi/io/error/error.wit.go @@ -25,11 +25,11 @@ func (self Error) ResourceDrop() { // ToDebugString represents the imported method "to-debug-string". // -// to-debug-string: func() -> string +// to-debug-string: func() // //go:nosplit -func (self Error) ToDebugString() (result string) { +func (self Error) ToDebugString() { self0 := cm.Reinterpret[uint32](self) - wasmimport_ErrorToDebugString((uint32)(self0), &result) + wasmimport_ErrorToDebugString((uint32)(self0)) return } diff --git a/examples/component/http-server/gen/wasi/io/error/ioerror.wasm.go b/examples/component/http-server/gen/wasi/io/error/ioerror.wasm.go index e254b5d8..96c77c65 100755 --- a/examples/component/http-server/gen/wasi/io/error/ioerror.wasm.go +++ b/examples/component/http-server/gen/wasi/io/error/ioerror.wasm.go @@ -10,4 +10,4 @@ func wasmimport_ErrorResourceDrop(self0 uint32) //go:wasmimport wasi:io/error@0.2.0 [method]error.to-debug-string //go:noescape -func wasmimport_ErrorToDebugString(self0 uint32, result *string) +func wasmimport_ErrorToDebugString(self0 uint32) diff --git a/examples/component/http-server/gen/wasi/io/poll/poll.wasm.go b/examples/component/http-server/gen/wasi/io/poll/poll.wasm.go index f7c55c3d..d89a9926 100755 --- a/examples/component/http-server/gen/wasi/io/poll/poll.wasm.go +++ b/examples/component/http-server/gen/wasi/io/poll/poll.wasm.go @@ -2,10 +2,6 @@ package poll -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". //go:wasmimport wasi:io/poll@0.2.0 [resource-drop]pollable @@ -18,8 +14,8 @@ func wasmimport_PollableBlock(self0 uint32) //go:wasmimport wasi:io/poll@0.2.0 [method]pollable.ready //go:noescape -func wasmimport_PollableReady(self0 uint32) (result0 uint32) +func wasmimport_PollableReady(self0 uint32) //go:wasmimport wasi:io/poll@0.2.0 poll //go:noescape -func wasmimport_Poll(in0 *Pollable, in1 uint32, result *cm.List[uint32]) +func wasmimport_Poll(in0 *Pollable, in1 uint32) diff --git a/examples/component/http-server/gen/wasi/io/poll/poll.wit.go b/examples/component/http-server/gen/wasi/io/poll/poll.wit.go index ad9e9564..4a952ecf 100755 --- a/examples/component/http-server/gen/wasi/io/poll/poll.wit.go +++ b/examples/component/http-server/gen/wasi/io/poll/poll.wit.go @@ -36,23 +36,22 @@ func (self Pollable) Block() { // Ready represents the imported method "ready". // -// ready: func() -> bool +// ready: func() // //go:nosplit -func (self Pollable) Ready() (result bool) { +func (self Pollable) Ready() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_PollableReady((uint32)(self0)) - result = (bool)(cm.U32ToBool((uint32)(result0))) + wasmimport_PollableReady((uint32)(self0)) return } // Poll represents the imported function "poll". // -// poll: func(in: list>) -> list +// poll: func(in: list>) // //go:nosplit -func Poll(in cm.List[Pollable]) (result cm.List[uint32]) { +func Poll(in cm.List[Pollable]) { in0, in1 := cm.LowerList(in) - wasmimport_Poll((*Pollable)(in0), (uint32)(in1), &result) + wasmimport_Poll((*Pollable)(in0), (uint32)(in1)) return } diff --git a/examples/component/http-server/gen/wasi/io/streams/streams.wasm.go b/examples/component/http-server/gen/wasi/io/streams/streams.wasm.go index eec56645..98543c56 100755 --- a/examples/component/http-server/gen/wasi/io/streams/streams.wasm.go +++ b/examples/component/http-server/gen/wasi/io/streams/streams.wasm.go @@ -2,10 +2,6 @@ package streams -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". //go:wasmimport wasi:io/streams@0.2.0 [resource-drop]input-stream @@ -14,23 +10,23 @@ func wasmimport_InputStreamResourceDrop(self0 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.blocking-read //go:noescape -func wasmimport_InputStreamBlockingRead(self0 uint32, len0 uint64, result *cm.Result[cm.List[uint8], cm.List[uint8], StreamError]) +func wasmimport_InputStreamBlockingRead(self0 uint32, len0 uint64) //go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.blocking-skip //go:noescape -func wasmimport_InputStreamBlockingSkip(self0 uint32, len0 uint64, result *cm.Result[uint64, uint64, StreamError]) +func wasmimport_InputStreamBlockingSkip(self0 uint32, len0 uint64) //go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.read //go:noescape -func wasmimport_InputStreamRead(self0 uint32, len0 uint64, result *cm.Result[cm.List[uint8], cm.List[uint8], StreamError]) +func wasmimport_InputStreamRead(self0 uint32, len0 uint64) //go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.skip //go:noescape -func wasmimport_InputStreamSkip(self0 uint32, len0 uint64, result *cm.Result[uint64, uint64, StreamError]) +func wasmimport_InputStreamSkip(self0 uint32, len0 uint64) //go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.subscribe //go:noescape -func wasmimport_InputStreamSubscribe(self0 uint32) (result0 uint32) +func wasmimport_InputStreamSubscribe(self0 uint32) //go:wasmimport wasi:io/streams@0.2.0 [resource-drop]output-stream //go:noescape @@ -38,40 +34,40 @@ func wasmimport_OutputStreamResourceDrop(self0 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-flush //go:noescape -func wasmimport_OutputStreamBlockingFlush(self0 uint32, result *cm.Result[StreamError, struct{}, StreamError]) +func wasmimport_OutputStreamBlockingFlush(self0 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-splice //go:noescape -func wasmimport_OutputStreamBlockingSplice(self0 uint32, src0 uint32, len0 uint64, result *cm.Result[uint64, uint64, StreamError]) +func wasmimport_OutputStreamBlockingSplice(self0 uint32, src0 uint32, len0 uint64) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-write-and-flush //go:noescape -func wasmimport_OutputStreamBlockingWriteAndFlush(self0 uint32, contents0 *uint8, contents1 uint32, result *cm.Result[StreamError, struct{}, StreamError]) +func wasmimport_OutputStreamBlockingWriteAndFlush(self0 uint32, contents0 *uint8, contents1 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-write-zeroes-and-flush //go:noescape -func wasmimport_OutputStreamBlockingWriteZeroesAndFlush(self0 uint32, len0 uint64, result *cm.Result[StreamError, struct{}, StreamError]) +func wasmimport_OutputStreamBlockingWriteZeroesAndFlush(self0 uint32, len0 uint64) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.check-write //go:noescape -func wasmimport_OutputStreamCheckWrite(self0 uint32, result *cm.Result[uint64, uint64, StreamError]) +func wasmimport_OutputStreamCheckWrite(self0 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.flush //go:noescape -func wasmimport_OutputStreamFlush(self0 uint32, result *cm.Result[StreamError, struct{}, StreamError]) +func wasmimport_OutputStreamFlush(self0 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.splice //go:noescape -func wasmimport_OutputStreamSplice(self0 uint32, src0 uint32, len0 uint64, result *cm.Result[uint64, uint64, StreamError]) +func wasmimport_OutputStreamSplice(self0 uint32, src0 uint32, len0 uint64) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.subscribe //go:noescape -func wasmimport_OutputStreamSubscribe(self0 uint32) (result0 uint32) +func wasmimport_OutputStreamSubscribe(self0 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.write //go:noescape -func wasmimport_OutputStreamWrite(self0 uint32, contents0 *uint8, contents1 uint32, result *cm.Result[StreamError, struct{}, StreamError]) +func wasmimport_OutputStreamWrite(self0 uint32, contents0 *uint8, contents1 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.write-zeroes //go:noescape -func wasmimport_OutputStreamWriteZeroes(self0 uint32, len0 uint64, result *cm.Result[StreamError, struct{}, StreamError]) +func wasmimport_OutputStreamWriteZeroes(self0 uint32, len0 uint64) diff --git a/examples/component/http-server/gen/wasi/io/streams/streams.wit.go b/examples/component/http-server/gen/wasi/io/streams/streams.wit.go index 59250d81..d41c044a 100755 --- a/examples/component/http-server/gen/wasi/io/streams/streams.wit.go +++ b/examples/component/http-server/gen/wasi/io/streams/streams.wit.go @@ -76,61 +76,60 @@ func (self InputStream) ResourceDrop() { // BlockingRead represents the imported method "blocking-read". // -// blocking-read: func(len: u64) -> result, stream-error> +// blocking-read: func(len: u64) // //go:nosplit -func (self InputStream) BlockingRead(len_ uint64) (result cm.Result[cm.List[uint8], cm.List[uint8], StreamError]) { +func (self InputStream) BlockingRead(len_ uint64) { self0 := cm.Reinterpret[uint32](self) len0 := (uint64)(len_) - wasmimport_InputStreamBlockingRead((uint32)(self0), (uint64)(len0), &result) + wasmimport_InputStreamBlockingRead((uint32)(self0), (uint64)(len0)) return } // BlockingSkip represents the imported method "blocking-skip". // -// blocking-skip: func(len: u64) -> result +// blocking-skip: func(len: u64) // //go:nosplit -func (self InputStream) BlockingSkip(len_ uint64) (result cm.Result[uint64, uint64, StreamError]) { +func (self InputStream) BlockingSkip(len_ uint64) { self0 := cm.Reinterpret[uint32](self) len0 := (uint64)(len_) - wasmimport_InputStreamBlockingSkip((uint32)(self0), (uint64)(len0), &result) + wasmimport_InputStreamBlockingSkip((uint32)(self0), (uint64)(len0)) return } // Read represents the imported method "read". // -// read: func(len: u64) -> result, stream-error> +// read: func(len: u64) // //go:nosplit -func (self InputStream) Read(len_ uint64) (result cm.Result[cm.List[uint8], cm.List[uint8], StreamError]) { +func (self InputStream) Read(len_ uint64) { self0 := cm.Reinterpret[uint32](self) len0 := (uint64)(len_) - wasmimport_InputStreamRead((uint32)(self0), (uint64)(len0), &result) + wasmimport_InputStreamRead((uint32)(self0), (uint64)(len0)) return } // Skip represents the imported method "skip". // -// skip: func(len: u64) -> result +// skip: func(len: u64) // //go:nosplit -func (self InputStream) Skip(len_ uint64) (result cm.Result[uint64, uint64, StreamError]) { +func (self InputStream) Skip(len_ uint64) { self0 := cm.Reinterpret[uint32](self) len0 := (uint64)(len_) - wasmimport_InputStreamSkip((uint32)(self0), (uint64)(len0), &result) + wasmimport_InputStreamSkip((uint32)(self0), (uint64)(len0)) return } // Subscribe represents the imported method "subscribe". // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self InputStream) Subscribe() (result Pollable) { +func (self InputStream) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_InputStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_InputStreamSubscribe((uint32)(self0)) return } @@ -152,119 +151,118 @@ func (self OutputStream) ResourceDrop() { // BlockingFlush represents the imported method "blocking-flush". // -// blocking-flush: func() -> result<_, stream-error> +// blocking-flush: func() // //go:nosplit -func (self OutputStream) BlockingFlush() (result cm.Result[StreamError, struct{}, StreamError]) { +func (self OutputStream) BlockingFlush() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamBlockingFlush((uint32)(self0), &result) + wasmimport_OutputStreamBlockingFlush((uint32)(self0)) return } // BlockingSplice represents the imported method "blocking-splice". // -// blocking-splice: func(src: borrow, len: u64) -> result +// blocking-splice: func(src: borrow, len: u64) // //go:nosplit -func (self OutputStream) BlockingSplice(src InputStream, len_ uint64) (result cm.Result[uint64, uint64, StreamError]) { +func (self OutputStream) BlockingSplice(src InputStream, len_ uint64) { self0 := cm.Reinterpret[uint32](self) src0 := cm.Reinterpret[uint32](src) len0 := (uint64)(len_) - wasmimport_OutputStreamBlockingSplice((uint32)(self0), (uint32)(src0), (uint64)(len0), &result) + wasmimport_OutputStreamBlockingSplice((uint32)(self0), (uint32)(src0), (uint64)(len0)) return } // BlockingWriteAndFlush represents the imported method "blocking-write-and-flush". // -// blocking-write-and-flush: func(contents: list) -> result<_, stream-error> +// blocking-write-and-flush: func(contents: list) // //go:nosplit -func (self OutputStream) BlockingWriteAndFlush(contents cm.List[uint8]) (result cm.Result[StreamError, struct{}, StreamError]) { +func (self OutputStream) BlockingWriteAndFlush(contents cm.List[uint8]) { self0 := cm.Reinterpret[uint32](self) contents0, contents1 := cm.LowerList(contents) - wasmimport_OutputStreamBlockingWriteAndFlush((uint32)(self0), (*uint8)(contents0), (uint32)(contents1), &result) + wasmimport_OutputStreamBlockingWriteAndFlush((uint32)(self0), (*uint8)(contents0), (uint32)(contents1)) return } // BlockingWriteZeroesAndFlush represents the imported method "blocking-write-zeroes-and-flush". // -// blocking-write-zeroes-and-flush: func(len: u64) -> result<_, stream-error> +// blocking-write-zeroes-and-flush: func(len: u64) // //go:nosplit -func (self OutputStream) BlockingWriteZeroesAndFlush(len_ uint64) (result cm.Result[StreamError, struct{}, StreamError]) { +func (self OutputStream) BlockingWriteZeroesAndFlush(len_ uint64) { self0 := cm.Reinterpret[uint32](self) len0 := (uint64)(len_) - wasmimport_OutputStreamBlockingWriteZeroesAndFlush((uint32)(self0), (uint64)(len0), &result) + wasmimport_OutputStreamBlockingWriteZeroesAndFlush((uint32)(self0), (uint64)(len0)) return } // CheckWrite represents the imported method "check-write". // -// check-write: func() -> result +// check-write: func() // //go:nosplit -func (self OutputStream) CheckWrite() (result cm.Result[uint64, uint64, StreamError]) { +func (self OutputStream) CheckWrite() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamCheckWrite((uint32)(self0), &result) + wasmimport_OutputStreamCheckWrite((uint32)(self0)) return } // Flush represents the imported method "flush". // -// flush: func() -> result<_, stream-error> +// flush: func() // //go:nosplit -func (self OutputStream) Flush() (result cm.Result[StreamError, struct{}, StreamError]) { +func (self OutputStream) Flush() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamFlush((uint32)(self0), &result) + wasmimport_OutputStreamFlush((uint32)(self0)) return } // Splice represents the imported method "splice". // -// splice: func(src: borrow, len: u64) -> result +// splice: func(src: borrow, len: u64) // //go:nosplit -func (self OutputStream) Splice(src InputStream, len_ uint64) (result cm.Result[uint64, uint64, StreamError]) { +func (self OutputStream) Splice(src InputStream, len_ uint64) { self0 := cm.Reinterpret[uint32](self) src0 := cm.Reinterpret[uint32](src) len0 := (uint64)(len_) - wasmimport_OutputStreamSplice((uint32)(self0), (uint32)(src0), (uint64)(len0), &result) + wasmimport_OutputStreamSplice((uint32)(self0), (uint32)(src0), (uint64)(len0)) return } // Subscribe represents the imported method "subscribe". // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self OutputStream) Subscribe() (result Pollable) { +func (self OutputStream) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutputStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_OutputStreamSubscribe((uint32)(self0)) return } // Write represents the imported method "write". // -// write: func(contents: list) -> result<_, stream-error> +// write: func(contents: list) // //go:nosplit -func (self OutputStream) Write(contents cm.List[uint8]) (result cm.Result[StreamError, struct{}, StreamError]) { +func (self OutputStream) Write(contents cm.List[uint8]) { self0 := cm.Reinterpret[uint32](self) contents0, contents1 := cm.LowerList(contents) - wasmimport_OutputStreamWrite((uint32)(self0), (*uint8)(contents0), (uint32)(contents1), &result) + wasmimport_OutputStreamWrite((uint32)(self0), (*uint8)(contents0), (uint32)(contents1)) return } // WriteZeroes represents the imported method "write-zeroes". // -// write-zeroes: func(len: u64) -> result<_, stream-error> +// write-zeroes: func(len: u64) // //go:nosplit -func (self OutputStream) WriteZeroes(len_ uint64) (result cm.Result[StreamError, struct{}, StreamError]) { +func (self OutputStream) WriteZeroes(len_ uint64) { self0 := cm.Reinterpret[uint32](self) len0 := (uint64)(len_) - wasmimport_OutputStreamWriteZeroes((uint32)(self0), (uint64)(len0), &result) + wasmimport_OutputStreamWriteZeroes((uint32)(self0), (uint64)(len0)) return } diff --git a/examples/component/http-server/gen/wasi/random/insecure-seed/insecure-seed.wit.go b/examples/component/http-server/gen/wasi/random/insecure-seed/insecure-seed.wit.go index e701d1b4..6b9afd75 100755 --- a/examples/component/http-server/gen/wasi/random/insecure-seed/insecure-seed.wit.go +++ b/examples/component/http-server/gen/wasi/random/insecure-seed/insecure-seed.wit.go @@ -5,10 +5,10 @@ package insecureseed // InsecureSeed represents the imported function "insecure-seed". // -// insecure-seed: func() -> tuple +// insecure-seed: func() // //go:nosplit -func InsecureSeed() (result [2]uint64) { - wasmimport_InsecureSeed(&result) +func InsecureSeed() { + wasmimport_InsecureSeed() return } diff --git a/examples/component/http-server/gen/wasi/random/insecure-seed/insecureseed.wasm.go b/examples/component/http-server/gen/wasi/random/insecure-seed/insecureseed.wasm.go index e94356df..6dc19c0b 100755 --- a/examples/component/http-server/gen/wasi/random/insecure-seed/insecureseed.wasm.go +++ b/examples/component/http-server/gen/wasi/random/insecure-seed/insecureseed.wasm.go @@ -6,4 +6,4 @@ package insecureseed //go:wasmimport wasi:random/insecure-seed@0.2.0 insecure-seed //go:noescape -func wasmimport_InsecureSeed(result *[2]uint64) +func wasmimport_InsecureSeed() diff --git a/examples/component/http-server/gen/wasi/random/insecure/insecure.wasm.go b/examples/component/http-server/gen/wasi/random/insecure/insecure.wasm.go index 498bfe4a..41ffb551 100755 --- a/examples/component/http-server/gen/wasi/random/insecure/insecure.wasm.go +++ b/examples/component/http-server/gen/wasi/random/insecure/insecure.wasm.go @@ -2,16 +2,12 @@ package insecure -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". //go:wasmimport wasi:random/insecure@0.2.0 get-insecure-random-bytes //go:noescape -func wasmimport_GetInsecureRandomBytes(len0 uint64, result *cm.List[uint8]) +func wasmimport_GetInsecureRandomBytes(len0 uint64) //go:wasmimport wasi:random/insecure@0.2.0 get-insecure-random-u64 //go:noescape -func wasmimport_GetInsecureRandomU64() (result0 uint64) +func wasmimport_GetInsecureRandomU64() diff --git a/examples/component/http-server/gen/wasi/random/insecure/insecure.wit.go b/examples/component/http-server/gen/wasi/random/insecure/insecure.wit.go index f32282c6..add35465 100755 --- a/examples/component/http-server/gen/wasi/random/insecure/insecure.wit.go +++ b/examples/component/http-server/gen/wasi/random/insecure/insecure.wit.go @@ -3,28 +3,23 @@ // Package insecure represents the imported interface "wasi:random/insecure@0.2.0". package insecure -import ( - "go.bytecodealliance.org/cm" -) - // GetInsecureRandomBytes represents the imported function "get-insecure-random-bytes". // -// get-insecure-random-bytes: func(len: u64) -> list +// get-insecure-random-bytes: func(len: u64) // //go:nosplit -func GetInsecureRandomBytes(len_ uint64) (result cm.List[uint8]) { +func GetInsecureRandomBytes(len_ uint64) { len0 := (uint64)(len_) - wasmimport_GetInsecureRandomBytes((uint64)(len0), &result) + wasmimport_GetInsecureRandomBytes((uint64)(len0)) return } // GetInsecureRandomU64 represents the imported function "get-insecure-random-u64". // -// get-insecure-random-u64: func() -> u64 +// get-insecure-random-u64: func() // //go:nosplit -func GetInsecureRandomU64() (result uint64) { - result0 := wasmimport_GetInsecureRandomU64() - result = (uint64)((uint64)(result0)) +func GetInsecureRandomU64() { + wasmimport_GetInsecureRandomU64() return } diff --git a/examples/component/http-server/gen/wasi/random/random/random.wasm.go b/examples/component/http-server/gen/wasi/random/random/random.wasm.go index 9096457b..512ee826 100755 --- a/examples/component/http-server/gen/wasi/random/random/random.wasm.go +++ b/examples/component/http-server/gen/wasi/random/random/random.wasm.go @@ -2,16 +2,12 @@ package random -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". //go:wasmimport wasi:random/random@0.2.0 get-random-bytes //go:noescape -func wasmimport_GetRandomBytes(len0 uint64, result *cm.List[uint8]) +func wasmimport_GetRandomBytes(len0 uint64) //go:wasmimport wasi:random/random@0.2.0 get-random-u64 //go:noescape -func wasmimport_GetRandomU64() (result0 uint64) +func wasmimport_GetRandomU64() diff --git a/examples/component/http-server/gen/wasi/random/random/random.wit.go b/examples/component/http-server/gen/wasi/random/random/random.wit.go index 98bb7779..f11f988d 100755 --- a/examples/component/http-server/gen/wasi/random/random/random.wit.go +++ b/examples/component/http-server/gen/wasi/random/random/random.wit.go @@ -3,28 +3,23 @@ // Package random represents the imported interface "wasi:random/random@0.2.0". package random -import ( - "go.bytecodealliance.org/cm" -) - // GetRandomBytes represents the imported function "get-random-bytes". // -// get-random-bytes: func(len: u64) -> list +// get-random-bytes: func(len: u64) // //go:nosplit -func GetRandomBytes(len_ uint64) (result cm.List[uint8]) { +func GetRandomBytes(len_ uint64) { len0 := (uint64)(len_) - wasmimport_GetRandomBytes((uint64)(len0), &result) + wasmimport_GetRandomBytes((uint64)(len0)) return } // GetRandomU64 represents the imported function "get-random-u64". // -// get-random-u64: func() -> u64 +// get-random-u64: func() // //go:nosplit -func GetRandomU64() (result uint64) { - result0 := wasmimport_GetRandomU64() - result = (uint64)((uint64)(result0)) +func GetRandomU64() { + wasmimport_GetRandomU64() return } diff --git a/examples/component/http-server/gen/wasi/sockets/instance-network/instance-network.wit.go b/examples/component/http-server/gen/wasi/sockets/instance-network/instance-network.wit.go index 3c126a50..55895cc2 100755 --- a/examples/component/http-server/gen/wasi/sockets/instance-network/instance-network.wit.go +++ b/examples/component/http-server/gen/wasi/sockets/instance-network/instance-network.wit.go @@ -5,7 +5,6 @@ package instancenetwork import ( "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/sockets/network" - "go.bytecodealliance.org/cm" ) // Network represents the imported type alias "wasi:sockets/instance-network@0.2.0#network". @@ -15,11 +14,10 @@ type Network = network.Network // InstanceNetwork represents the imported function "instance-network". // -// instance-network: func() -> network +// instance-network: func() // //go:nosplit -func InstanceNetwork() (result Network) { - result0 := wasmimport_InstanceNetwork() - result = cm.Reinterpret[Network]((uint32)(result0)) +func InstanceNetwork() { + wasmimport_InstanceNetwork() return } diff --git a/examples/component/http-server/gen/wasi/sockets/instance-network/instancenetwork.wasm.go b/examples/component/http-server/gen/wasi/sockets/instance-network/instancenetwork.wasm.go index eb113e21..01fc4839 100755 --- a/examples/component/http-server/gen/wasi/sockets/instance-network/instancenetwork.wasm.go +++ b/examples/component/http-server/gen/wasi/sockets/instance-network/instancenetwork.wasm.go @@ -6,4 +6,4 @@ package instancenetwork //go:wasmimport wasi:sockets/instance-network@0.2.0 instance-network //go:noescape -func wasmimport_InstanceNetwork() (result0 uint32) +func wasmimport_InstanceNetwork() diff --git a/examples/component/http-server/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go b/examples/component/http-server/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go index e446da73..c8d85412 100755 --- a/examples/component/http-server/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go +++ b/examples/component/http-server/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go @@ -47,36 +47,34 @@ func (self ResolveAddressStream) ResourceDrop() { // ResolveNextAddress represents the imported method "resolve-next-address". // -// resolve-next-address: func() -> result, error-code> +// resolve-next-address: func() // //go:nosplit -func (self ResolveAddressStream) ResolveNextAddress() (result cm.Result[OptionIPAddressShape, cm.Option[IPAddress], ErrorCode]) { +func (self ResolveAddressStream) ResolveNextAddress() { self0 := cm.Reinterpret[uint32](self) - wasmimport_ResolveAddressStreamResolveNextAddress((uint32)(self0), &result) + wasmimport_ResolveAddressStreamResolveNextAddress((uint32)(self0)) return } // Subscribe represents the imported method "subscribe". // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self ResolveAddressStream) Subscribe() (result Pollable) { +func (self ResolveAddressStream) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_ResolveAddressStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_ResolveAddressStreamSubscribe((uint32)(self0)) return } // ResolveAddresses represents the imported function "resolve-addresses". // -// resolve-addresses: func(network: borrow, name: string) -> result +// resolve-addresses: func(network: borrow, name: string) // //go:nosplit -func ResolveAddresses(network_ Network, name string) (result cm.Result[ResolveAddressStream, ResolveAddressStream, ErrorCode]) { +func ResolveAddresses(network_ Network, name string) { network0 := cm.Reinterpret[uint32](network_) name0, name1 := cm.LowerString(name) - wasmimport_ResolveAddresses((uint32)(network0), (*uint8)(name0), (uint32)(name1), &result) + wasmimport_ResolveAddresses((uint32)(network0), (*uint8)(name0), (uint32)(name1)) return } diff --git a/examples/component/http-server/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go b/examples/component/http-server/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go index da5fb000..df4d85bc 100755 --- a/examples/component/http-server/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go +++ b/examples/component/http-server/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go @@ -2,10 +2,6 @@ package ipnamelookup -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". //go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 [resource-drop]resolve-address-stream @@ -14,12 +10,12 @@ func wasmimport_ResolveAddressStreamResourceDrop(self0 uint32) //go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 [method]resolve-address-stream.resolve-next-address //go:noescape -func wasmimport_ResolveAddressStreamResolveNextAddress(self0 uint32, result *cm.Result[OptionIPAddressShape, cm.Option[IPAddress], ErrorCode]) +func wasmimport_ResolveAddressStreamResolveNextAddress(self0 uint32) //go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 [method]resolve-address-stream.subscribe //go:noescape -func wasmimport_ResolveAddressStreamSubscribe(self0 uint32) (result0 uint32) +func wasmimport_ResolveAddressStreamSubscribe(self0 uint32) //go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 resolve-addresses //go:noescape -func wasmimport_ResolveAddresses(network0 uint32, name0 *uint8, name1 uint32, result *cm.Result[ResolveAddressStream, ResolveAddressStream, ErrorCode]) +func wasmimport_ResolveAddresses(network0 uint32, name0 *uint8, name1 uint32) diff --git a/examples/component/http-server/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go b/examples/component/http-server/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go index fd65d0f0..094f033d 100755 --- a/examples/component/http-server/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go +++ b/examples/component/http-server/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go @@ -6,7 +6,6 @@ package tcpcreatesocket import ( "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/sockets/network" "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/sockets/tcp" - "go.bytecodealliance.org/cm" ) // Network represents the imported type alias "wasi:sockets/tcp-create-socket@0.2.0#network". @@ -31,12 +30,11 @@ type TCPSocket = tcp.TCPSocket // CreateTCPSocket represents the imported function "create-tcp-socket". // -// create-tcp-socket: func(address-family: ip-address-family) -> result +// create-tcp-socket: func(address-family: ip-address-family) // //go:nosplit -func CreateTCPSocket(addressFamily IPAddressFamily) (result cm.Result[TCPSocket, TCPSocket, ErrorCode]) { +func CreateTCPSocket(addressFamily IPAddressFamily) { addressFamily0 := (uint32)(addressFamily) - wasmimport_CreateTCPSocket((uint32)(addressFamily0), &result) + wasmimport_CreateTCPSocket((uint32)(addressFamily0)) return } diff --git a/examples/component/http-server/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go b/examples/component/http-server/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go index b7b43155..48d9b113 100755 --- a/examples/component/http-server/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go +++ b/examples/component/http-server/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go @@ -2,12 +2,8 @@ package tcpcreatesocket -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". //go:wasmimport wasi:sockets/tcp-create-socket@0.2.0 create-tcp-socket //go:noescape -func wasmimport_CreateTCPSocket(addressFamily0 uint32, result *cm.Result[TCPSocket, TCPSocket, ErrorCode]) +func wasmimport_CreateTCPSocket(addressFamily0 uint32) diff --git a/examples/component/http-server/gen/wasi/sockets/tcp/abi.go b/examples/component/http-server/gen/wasi/sockets/tcp/abi.go index 16eda7fd..3b037ff4 100755 --- a/examples/component/http-server/gen/wasi/sockets/tcp/abi.go +++ b/examples/component/http-server/gen/wasi/sockets/tcp/abi.go @@ -5,27 +5,8 @@ package tcp import ( "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/sockets/network" "go.bytecodealliance.org/cm" - "unsafe" ) -// TupleTCPSocketInputStreamOutputStreamShape is used for storage in variant or result types. -type TupleTCPSocketInputStreamOutputStreamShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Tuple3[TCPSocket, InputStream, OutputStream]{})]byte -} - -// TupleInputStreamOutputStreamShape is used for storage in variant or result types. -type TupleInputStreamOutputStreamShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Tuple[InputStream, OutputStream]{})]byte -} - -// IPSocketAddressShape is used for storage in variant or result types. -type IPSocketAddressShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(network.IPSocketAddress{})]byte -} - func lower_IPv4Address(v network.IPv4Address) (f0 uint32, f1 uint32, f2 uint32, f3 uint32) { f0 = (uint32)(v[0]) f1 = (uint32)(v[1]) diff --git a/examples/component/http-server/gen/wasi/sockets/tcp/tcp.wasm.go b/examples/component/http-server/gen/wasi/sockets/tcp/tcp.wasm.go index 56247525..3d3553be 100755 --- a/examples/component/http-server/gen/wasi/sockets/tcp/tcp.wasm.go +++ b/examples/component/http-server/gen/wasi/sockets/tcp/tcp.wasm.go @@ -2,10 +2,6 @@ package tcp -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". //go:wasmimport wasi:sockets/tcp@0.2.0 [resource-drop]tcp-socket @@ -14,112 +10,112 @@ func wasmimport_TCPSocketResourceDrop(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.accept //go:noescape -func wasmimport_TCPSocketAccept(self0 uint32, result *cm.Result[TupleTCPSocketInputStreamOutputStreamShape, cm.Tuple3[TCPSocket, InputStream, OutputStream], ErrorCode]) +func wasmimport_TCPSocketAccept(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.address-family //go:noescape -func wasmimport_TCPSocketAddressFamily(self0 uint32) (result0 uint32) +func wasmimport_TCPSocketAddressFamily(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-bind //go:noescape -func wasmimport_TCPSocketFinishBind(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketFinishBind(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-connect //go:noescape -func wasmimport_TCPSocketFinishConnect(self0 uint32, result *cm.Result[TupleInputStreamOutputStreamShape, cm.Tuple[InputStream, OutputStream], ErrorCode]) +func wasmimport_TCPSocketFinishConnect(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-listen //go:noescape -func wasmimport_TCPSocketFinishListen(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketFinishListen(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.hop-limit //go:noescape -func wasmimport_TCPSocketHopLimit(self0 uint32, result *cm.Result[uint8, uint8, ErrorCode]) +func wasmimport_TCPSocketHopLimit(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.is-listening //go:noescape -func wasmimport_TCPSocketIsListening(self0 uint32) (result0 uint32) +func wasmimport_TCPSocketIsListening(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-count //go:noescape -func wasmimport_TCPSocketKeepAliveCount(self0 uint32, result *cm.Result[uint32, uint32, ErrorCode]) +func wasmimport_TCPSocketKeepAliveCount(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-enabled //go:noescape -func wasmimport_TCPSocketKeepAliveEnabled(self0 uint32, result *cm.Result[bool, bool, ErrorCode]) +func wasmimport_TCPSocketKeepAliveEnabled(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-idle-time //go:noescape -func wasmimport_TCPSocketKeepAliveIdleTime(self0 uint32, result *cm.Result[uint64, Duration, ErrorCode]) +func wasmimport_TCPSocketKeepAliveIdleTime(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-interval //go:noescape -func wasmimport_TCPSocketKeepAliveInterval(self0 uint32, result *cm.Result[uint64, Duration, ErrorCode]) +func wasmimport_TCPSocketKeepAliveInterval(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.local-address //go:noescape -func wasmimport_TCPSocketLocalAddress(self0 uint32, result *cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) +func wasmimport_TCPSocketLocalAddress(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.receive-buffer-size //go:noescape -func wasmimport_TCPSocketReceiveBufferSize(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) +func wasmimport_TCPSocketReceiveBufferSize(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.remote-address //go:noescape -func wasmimport_TCPSocketRemoteAddress(self0 uint32, result *cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) +func wasmimport_TCPSocketRemoteAddress(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.send-buffer-size //go:noescape -func wasmimport_TCPSocketSendBufferSize(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) +func wasmimport_TCPSocketSendBufferSize(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-hop-limit //go:noescape -func wasmimport_TCPSocketSetHopLimit(self0 uint32, value0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetHopLimit(self0 uint32, value0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-count //go:noescape -func wasmimport_TCPSocketSetKeepAliveCount(self0 uint32, value0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetKeepAliveCount(self0 uint32, value0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-enabled //go:noescape -func wasmimport_TCPSocketSetKeepAliveEnabled(self0 uint32, value0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetKeepAliveEnabled(self0 uint32, value0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-idle-time //go:noescape -func wasmimport_TCPSocketSetKeepAliveIdleTime(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetKeepAliveIdleTime(self0 uint32, value0 uint64) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-interval //go:noescape -func wasmimport_TCPSocketSetKeepAliveInterval(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetKeepAliveInterval(self0 uint32, value0 uint64) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-listen-backlog-size //go:noescape -func wasmimport_TCPSocketSetListenBacklogSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetListenBacklogSize(self0 uint32, value0 uint64) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-receive-buffer-size //go:noescape -func wasmimport_TCPSocketSetReceiveBufferSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetReceiveBufferSize(self0 uint32, value0 uint64) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-send-buffer-size //go:noescape -func wasmimport_TCPSocketSetSendBufferSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetSendBufferSize(self0 uint32, value0 uint64) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.shutdown //go:noescape -func wasmimport_TCPSocketShutdown(self0 uint32, shutdownType0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketShutdown(self0 uint32, shutdownType0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-bind //go:noescape -func wasmimport_TCPSocketStartBind(self0 uint32, network0 uint32, localAddress0 uint32, localAddress1 uint32, localAddress2 uint32, localAddress3 uint32, localAddress4 uint32, localAddress5 uint32, localAddress6 uint32, localAddress7 uint32, localAddress8 uint32, localAddress9 uint32, localAddress10 uint32, localAddress11 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketStartBind(self0 uint32, network0 uint32, localAddress0 uint32, localAddress1 uint32, localAddress2 uint32, localAddress3 uint32, localAddress4 uint32, localAddress5 uint32, localAddress6 uint32, localAddress7 uint32, localAddress8 uint32, localAddress9 uint32, localAddress10 uint32, localAddress11 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-connect //go:noescape -func wasmimport_TCPSocketStartConnect(self0 uint32, network0 uint32, remoteAddress0 uint32, remoteAddress1 uint32, remoteAddress2 uint32, remoteAddress3 uint32, remoteAddress4 uint32, remoteAddress5 uint32, remoteAddress6 uint32, remoteAddress7 uint32, remoteAddress8 uint32, remoteAddress9 uint32, remoteAddress10 uint32, remoteAddress11 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketStartConnect(self0 uint32, network0 uint32, remoteAddress0 uint32, remoteAddress1 uint32, remoteAddress2 uint32, remoteAddress3 uint32, remoteAddress4 uint32, remoteAddress5 uint32, remoteAddress6 uint32, remoteAddress7 uint32, remoteAddress8 uint32, remoteAddress9 uint32, remoteAddress10 uint32, remoteAddress11 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-listen //go:noescape -func wasmimport_TCPSocketStartListen(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketStartListen(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.subscribe //go:noescape -func wasmimport_TCPSocketSubscribe(self0 uint32) (result0 uint32) +func wasmimport_TCPSocketSubscribe(self0 uint32) diff --git a/examples/component/http-server/gen/wasi/sockets/tcp/tcp.wit.go b/examples/component/http-server/gen/wasi/sockets/tcp/tcp.wit.go index 9b3ef629..6e37ed2a 100755 --- a/examples/component/http-server/gen/wasi/sockets/tcp/tcp.wit.go +++ b/examples/component/http-server/gen/wasi/sockets/tcp/tcp.wit.go @@ -95,326 +95,321 @@ func (self TCPSocket) ResourceDrop() { // Accept represents the imported method "accept". // -// accept: func() -> result, error-code> +// accept: func() // //go:nosplit -func (self TCPSocket) Accept() (result cm.Result[TupleTCPSocketInputStreamOutputStreamShape, cm.Tuple3[TCPSocket, InputStream, OutputStream], ErrorCode]) { +func (self TCPSocket) Accept() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketAccept((uint32)(self0), &result) + wasmimport_TCPSocketAccept((uint32)(self0)) return } // AddressFamily represents the imported method "address-family". // -// address-family: func() -> ip-address-family +// address-family: func() // //go:nosplit -func (self TCPSocket) AddressFamily() (result IPAddressFamily) { +func (self TCPSocket) AddressFamily() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_TCPSocketAddressFamily((uint32)(self0)) - result = (network.IPAddressFamily)((uint32)(result0)) + wasmimport_TCPSocketAddressFamily((uint32)(self0)) return } // FinishBind represents the imported method "finish-bind". // -// finish-bind: func() -> result<_, error-code> +// finish-bind: func() // //go:nosplit -func (self TCPSocket) FinishBind() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) FinishBind() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketFinishBind((uint32)(self0), &result) + wasmimport_TCPSocketFinishBind((uint32)(self0)) return } // FinishConnect represents the imported method "finish-connect". // -// finish-connect: func() -> result, error-code> +// finish-connect: func() // //go:nosplit -func (self TCPSocket) FinishConnect() (result cm.Result[TupleInputStreamOutputStreamShape, cm.Tuple[InputStream, OutputStream], ErrorCode]) { +func (self TCPSocket) FinishConnect() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketFinishConnect((uint32)(self0), &result) + wasmimport_TCPSocketFinishConnect((uint32)(self0)) return } // FinishListen represents the imported method "finish-listen". // -// finish-listen: func() -> result<_, error-code> +// finish-listen: func() // //go:nosplit -func (self TCPSocket) FinishListen() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) FinishListen() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketFinishListen((uint32)(self0), &result) + wasmimport_TCPSocketFinishListen((uint32)(self0)) return } // HopLimit represents the imported method "hop-limit". // -// hop-limit: func() -> result +// hop-limit: func() // //go:nosplit -func (self TCPSocket) HopLimit() (result cm.Result[uint8, uint8, ErrorCode]) { +func (self TCPSocket) HopLimit() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketHopLimit((uint32)(self0), &result) + wasmimport_TCPSocketHopLimit((uint32)(self0)) return } // IsListening represents the imported method "is-listening". // -// is-listening: func() -> bool +// is-listening: func() // //go:nosplit -func (self TCPSocket) IsListening() (result bool) { +func (self TCPSocket) IsListening() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_TCPSocketIsListening((uint32)(self0)) - result = (bool)(cm.U32ToBool((uint32)(result0))) + wasmimport_TCPSocketIsListening((uint32)(self0)) return } // KeepAliveCount represents the imported method "keep-alive-count". // -// keep-alive-count: func() -> result +// keep-alive-count: func() // //go:nosplit -func (self TCPSocket) KeepAliveCount() (result cm.Result[uint32, uint32, ErrorCode]) { +func (self TCPSocket) KeepAliveCount() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveCount((uint32)(self0), &result) + wasmimport_TCPSocketKeepAliveCount((uint32)(self0)) return } // KeepAliveEnabled represents the imported method "keep-alive-enabled". // -// keep-alive-enabled: func() -> result +// keep-alive-enabled: func() // //go:nosplit -func (self TCPSocket) KeepAliveEnabled() (result cm.Result[bool, bool, ErrorCode]) { +func (self TCPSocket) KeepAliveEnabled() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveEnabled((uint32)(self0), &result) + wasmimport_TCPSocketKeepAliveEnabled((uint32)(self0)) return } // KeepAliveIdleTime represents the imported method "keep-alive-idle-time". // -// keep-alive-idle-time: func() -> result +// keep-alive-idle-time: func() // //go:nosplit -func (self TCPSocket) KeepAliveIdleTime() (result cm.Result[uint64, Duration, ErrorCode]) { +func (self TCPSocket) KeepAliveIdleTime() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveIdleTime((uint32)(self0), &result) + wasmimport_TCPSocketKeepAliveIdleTime((uint32)(self0)) return } // KeepAliveInterval represents the imported method "keep-alive-interval". // -// keep-alive-interval: func() -> result +// keep-alive-interval: func() // //go:nosplit -func (self TCPSocket) KeepAliveInterval() (result cm.Result[uint64, Duration, ErrorCode]) { +func (self TCPSocket) KeepAliveInterval() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveInterval((uint32)(self0), &result) + wasmimport_TCPSocketKeepAliveInterval((uint32)(self0)) return } // LocalAddress represents the imported method "local-address". // -// local-address: func() -> result +// local-address: func() // //go:nosplit -func (self TCPSocket) LocalAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) { +func (self TCPSocket) LocalAddress() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketLocalAddress((uint32)(self0), &result) + wasmimport_TCPSocketLocalAddress((uint32)(self0)) return } // ReceiveBufferSize represents the imported method "receive-buffer-size". // -// receive-buffer-size: func() -> result +// receive-buffer-size: func() // //go:nosplit -func (self TCPSocket) ReceiveBufferSize() (result cm.Result[uint64, uint64, ErrorCode]) { +func (self TCPSocket) ReceiveBufferSize() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketReceiveBufferSize((uint32)(self0), &result) + wasmimport_TCPSocketReceiveBufferSize((uint32)(self0)) return } // RemoteAddress represents the imported method "remote-address". // -// remote-address: func() -> result +// remote-address: func() // //go:nosplit -func (self TCPSocket) RemoteAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) { +func (self TCPSocket) RemoteAddress() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketRemoteAddress((uint32)(self0), &result) + wasmimport_TCPSocketRemoteAddress((uint32)(self0)) return } // SendBufferSize represents the imported method "send-buffer-size". // -// send-buffer-size: func() -> result +// send-buffer-size: func() // //go:nosplit -func (self TCPSocket) SendBufferSize() (result cm.Result[uint64, uint64, ErrorCode]) { +func (self TCPSocket) SendBufferSize() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketSendBufferSize((uint32)(self0), &result) + wasmimport_TCPSocketSendBufferSize((uint32)(self0)) return } // SetHopLimit represents the imported method "set-hop-limit". // -// set-hop-limit: func(value: u8) -> result<_, error-code> +// set-hop-limit: func(value: u8) // //go:nosplit -func (self TCPSocket) SetHopLimit(value uint8) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetHopLimit(value uint8) { self0 := cm.Reinterpret[uint32](self) value0 := (uint32)(value) - wasmimport_TCPSocketSetHopLimit((uint32)(self0), (uint32)(value0), &result) + wasmimport_TCPSocketSetHopLimit((uint32)(self0), (uint32)(value0)) return } // SetKeepAliveCount represents the imported method "set-keep-alive-count". // -// set-keep-alive-count: func(value: u32) -> result<_, error-code> +// set-keep-alive-count: func(value: u32) // //go:nosplit -func (self TCPSocket) SetKeepAliveCount(value uint32) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetKeepAliveCount(value uint32) { self0 := cm.Reinterpret[uint32](self) value0 := (uint32)(value) - wasmimport_TCPSocketSetKeepAliveCount((uint32)(self0), (uint32)(value0), &result) + wasmimport_TCPSocketSetKeepAliveCount((uint32)(self0), (uint32)(value0)) return } // SetKeepAliveEnabled represents the imported method "set-keep-alive-enabled". // -// set-keep-alive-enabled: func(value: bool) -> result<_, error-code> +// set-keep-alive-enabled: func(value: bool) // //go:nosplit -func (self TCPSocket) SetKeepAliveEnabled(value bool) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetKeepAliveEnabled(value bool) { self0 := cm.Reinterpret[uint32](self) value0 := (uint32)(cm.BoolToU32(value)) - wasmimport_TCPSocketSetKeepAliveEnabled((uint32)(self0), (uint32)(value0), &result) + wasmimport_TCPSocketSetKeepAliveEnabled((uint32)(self0), (uint32)(value0)) return } // SetKeepAliveIdleTime represents the imported method "set-keep-alive-idle-time". // -// set-keep-alive-idle-time: func(value: duration) -> result<_, error-code> +// set-keep-alive-idle-time: func(value: duration) // //go:nosplit -func (self TCPSocket) SetKeepAliveIdleTime(value Duration) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetKeepAliveIdleTime(value Duration) { self0 := cm.Reinterpret[uint32](self) value0 := (uint64)(value) - wasmimport_TCPSocketSetKeepAliveIdleTime((uint32)(self0), (uint64)(value0), &result) + wasmimport_TCPSocketSetKeepAliveIdleTime((uint32)(self0), (uint64)(value0)) return } // SetKeepAliveInterval represents the imported method "set-keep-alive-interval". // -// set-keep-alive-interval: func(value: duration) -> result<_, error-code> +// set-keep-alive-interval: func(value: duration) // //go:nosplit -func (self TCPSocket) SetKeepAliveInterval(value Duration) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetKeepAliveInterval(value Duration) { self0 := cm.Reinterpret[uint32](self) value0 := (uint64)(value) - wasmimport_TCPSocketSetKeepAliveInterval((uint32)(self0), (uint64)(value0), &result) + wasmimport_TCPSocketSetKeepAliveInterval((uint32)(self0), (uint64)(value0)) return } // SetListenBacklogSize represents the imported method "set-listen-backlog-size". // -// set-listen-backlog-size: func(value: u64) -> result<_, error-code> +// set-listen-backlog-size: func(value: u64) // //go:nosplit -func (self TCPSocket) SetListenBacklogSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetListenBacklogSize(value uint64) { self0 := cm.Reinterpret[uint32](self) value0 := (uint64)(value) - wasmimport_TCPSocketSetListenBacklogSize((uint32)(self0), (uint64)(value0), &result) + wasmimport_TCPSocketSetListenBacklogSize((uint32)(self0), (uint64)(value0)) return } // SetReceiveBufferSize represents the imported method "set-receive-buffer-size". // -// set-receive-buffer-size: func(value: u64) -> result<_, error-code> +// set-receive-buffer-size: func(value: u64) // //go:nosplit -func (self TCPSocket) SetReceiveBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetReceiveBufferSize(value uint64) { self0 := cm.Reinterpret[uint32](self) value0 := (uint64)(value) - wasmimport_TCPSocketSetReceiveBufferSize((uint32)(self0), (uint64)(value0), &result) + wasmimport_TCPSocketSetReceiveBufferSize((uint32)(self0), (uint64)(value0)) return } // SetSendBufferSize represents the imported method "set-send-buffer-size". // -// set-send-buffer-size: func(value: u64) -> result<_, error-code> +// set-send-buffer-size: func(value: u64) // //go:nosplit -func (self TCPSocket) SetSendBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetSendBufferSize(value uint64) { self0 := cm.Reinterpret[uint32](self) value0 := (uint64)(value) - wasmimport_TCPSocketSetSendBufferSize((uint32)(self0), (uint64)(value0), &result) + wasmimport_TCPSocketSetSendBufferSize((uint32)(self0), (uint64)(value0)) return } // Shutdown represents the imported method "shutdown". // -// shutdown: func(shutdown-type: shutdown-type) -> result<_, error-code> +// shutdown: func(shutdown-type: shutdown-type) // //go:nosplit -func (self TCPSocket) Shutdown(shutdownType ShutdownType) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) Shutdown(shutdownType ShutdownType) { self0 := cm.Reinterpret[uint32](self) shutdownType0 := (uint32)(shutdownType) - wasmimport_TCPSocketShutdown((uint32)(self0), (uint32)(shutdownType0), &result) + wasmimport_TCPSocketShutdown((uint32)(self0), (uint32)(shutdownType0)) return } // StartBind represents the imported method "start-bind". // -// start-bind: func(network: borrow, local-address: ip-socket-address) -> -// result<_, error-code> +// start-bind: func(network: borrow, local-address: ip-socket-address) // //go:nosplit -func (self TCPSocket) StartBind(network_ Network, localAddress IPSocketAddress) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) StartBind(network_ Network, localAddress IPSocketAddress) { self0 := cm.Reinterpret[uint32](self) network0 := cm.Reinterpret[uint32](network_) localAddress0, localAddress1, localAddress2, localAddress3, localAddress4, localAddress5, localAddress6, localAddress7, localAddress8, localAddress9, localAddress10, localAddress11 := lower_IPSocketAddress(localAddress) - wasmimport_TCPSocketStartBind((uint32)(self0), (uint32)(network0), (uint32)(localAddress0), (uint32)(localAddress1), (uint32)(localAddress2), (uint32)(localAddress3), (uint32)(localAddress4), (uint32)(localAddress5), (uint32)(localAddress6), (uint32)(localAddress7), (uint32)(localAddress8), (uint32)(localAddress9), (uint32)(localAddress10), (uint32)(localAddress11), &result) + wasmimport_TCPSocketStartBind((uint32)(self0), (uint32)(network0), (uint32)(localAddress0), (uint32)(localAddress1), (uint32)(localAddress2), (uint32)(localAddress3), (uint32)(localAddress4), (uint32)(localAddress5), (uint32)(localAddress6), (uint32)(localAddress7), (uint32)(localAddress8), (uint32)(localAddress9), (uint32)(localAddress10), (uint32)(localAddress11)) return } // StartConnect represents the imported method "start-connect". // // start-connect: func(network: borrow, remote-address: ip-socket-address) -// -> result<_, error-code> // //go:nosplit -func (self TCPSocket) StartConnect(network_ Network, remoteAddress IPSocketAddress) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) StartConnect(network_ Network, remoteAddress IPSocketAddress) { self0 := cm.Reinterpret[uint32](self) network0 := cm.Reinterpret[uint32](network_) remoteAddress0, remoteAddress1, remoteAddress2, remoteAddress3, remoteAddress4, remoteAddress5, remoteAddress6, remoteAddress7, remoteAddress8, remoteAddress9, remoteAddress10, remoteAddress11 := lower_IPSocketAddress(remoteAddress) - wasmimport_TCPSocketStartConnect((uint32)(self0), (uint32)(network0), (uint32)(remoteAddress0), (uint32)(remoteAddress1), (uint32)(remoteAddress2), (uint32)(remoteAddress3), (uint32)(remoteAddress4), (uint32)(remoteAddress5), (uint32)(remoteAddress6), (uint32)(remoteAddress7), (uint32)(remoteAddress8), (uint32)(remoteAddress9), (uint32)(remoteAddress10), (uint32)(remoteAddress11), &result) + wasmimport_TCPSocketStartConnect((uint32)(self0), (uint32)(network0), (uint32)(remoteAddress0), (uint32)(remoteAddress1), (uint32)(remoteAddress2), (uint32)(remoteAddress3), (uint32)(remoteAddress4), (uint32)(remoteAddress5), (uint32)(remoteAddress6), (uint32)(remoteAddress7), (uint32)(remoteAddress8), (uint32)(remoteAddress9), (uint32)(remoteAddress10), (uint32)(remoteAddress11)) return } // StartListen represents the imported method "start-listen". // -// start-listen: func() -> result<_, error-code> +// start-listen: func() // //go:nosplit -func (self TCPSocket) StartListen() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) StartListen() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketStartListen((uint32)(self0), &result) + wasmimport_TCPSocketStartListen((uint32)(self0)) return } // Subscribe represents the imported method "subscribe". // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self TCPSocket) Subscribe() (result Pollable) { +func (self TCPSocket) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_TCPSocketSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_TCPSocketSubscribe((uint32)(self0)) return } diff --git a/examples/component/http-server/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go b/examples/component/http-server/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go index fc351ff3..96d5914f 100755 --- a/examples/component/http-server/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go +++ b/examples/component/http-server/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go @@ -6,7 +6,6 @@ package udpcreatesocket import ( "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/sockets/network" "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/sockets/udp" - "go.bytecodealliance.org/cm" ) // Network represents the imported type alias "wasi:sockets/udp-create-socket@0.2.0#network". @@ -31,12 +30,11 @@ type UDPSocket = udp.UDPSocket // CreateUDPSocket represents the imported function "create-udp-socket". // -// create-udp-socket: func(address-family: ip-address-family) -> result +// create-udp-socket: func(address-family: ip-address-family) // //go:nosplit -func CreateUDPSocket(addressFamily IPAddressFamily) (result cm.Result[UDPSocket, UDPSocket, ErrorCode]) { +func CreateUDPSocket(addressFamily IPAddressFamily) { addressFamily0 := (uint32)(addressFamily) - wasmimport_CreateUDPSocket((uint32)(addressFamily0), &result) + wasmimport_CreateUDPSocket((uint32)(addressFamily0)) return } diff --git a/examples/component/http-server/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go b/examples/component/http-server/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go index 94b1ab67..dfe49e18 100755 --- a/examples/component/http-server/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go +++ b/examples/component/http-server/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go @@ -2,12 +2,8 @@ package udpcreatesocket -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". //go:wasmimport wasi:sockets/udp-create-socket@0.2.0 create-udp-socket //go:noescape -func wasmimport_CreateUDPSocket(addressFamily0 uint32, result *cm.Result[UDPSocket, UDPSocket, ErrorCode]) +func wasmimport_CreateUDPSocket(addressFamily0 uint32) diff --git a/examples/component/http-server/gen/wasi/sockets/udp/abi.go b/examples/component/http-server/gen/wasi/sockets/udp/abi.go index e340f347..9f87725c 100755 --- a/examples/component/http-server/gen/wasi/sockets/udp/abi.go +++ b/examples/component/http-server/gen/wasi/sockets/udp/abi.go @@ -5,15 +5,8 @@ package udp import ( "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/sockets/network" "go.bytecodealliance.org/cm" - "unsafe" ) -// IPSocketAddressShape is used for storage in variant or result types. -type IPSocketAddressShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(network.IPSocketAddress{})]byte -} - func lower_IPv4Address(v network.IPv4Address) (f0 uint32, f1 uint32, f2 uint32, f3 uint32) { f0 = (uint32)(v[0]) f1 = (uint32)(v[1]) @@ -75,12 +68,6 @@ func lower_IPSocketAddress(v network.IPSocketAddress) (f0 uint32, f1 uint32, f2 return } -// TupleIncomingDatagramStreamOutgoingDatagramStreamShape is used for storage in variant or result types. -type TupleIncomingDatagramStreamOutgoingDatagramStreamShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Tuple[IncomingDatagramStream, OutgoingDatagramStream]{})]byte -} - func lower_OptionIPSocketAddress(v cm.Option[IPSocketAddress]) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32, f11 uint32, f12 uint32) { some := v.Some() if some != nil { diff --git a/examples/component/http-server/gen/wasi/sockets/udp/udp.wasm.go b/examples/component/http-server/gen/wasi/sockets/udp/udp.wasm.go index 83ce8ca7..0b0fd6ba 100755 --- a/examples/component/http-server/gen/wasi/sockets/udp/udp.wasm.go +++ b/examples/component/http-server/gen/wasi/sockets/udp/udp.wasm.go @@ -2,10 +2,6 @@ package udp -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". //go:wasmimport wasi:sockets/udp@0.2.0 [resource-drop]udp-socket @@ -14,55 +10,55 @@ func wasmimport_UDPSocketResourceDrop(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.address-family //go:noescape -func wasmimport_UDPSocketAddressFamily(self0 uint32) (result0 uint32) +func wasmimport_UDPSocketAddressFamily(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.finish-bind //go:noescape -func wasmimport_UDPSocketFinishBind(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_UDPSocketFinishBind(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.local-address //go:noescape -func wasmimport_UDPSocketLocalAddress(self0 uint32, result *cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) +func wasmimport_UDPSocketLocalAddress(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.receive-buffer-size //go:noescape -func wasmimport_UDPSocketReceiveBufferSize(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) +func wasmimport_UDPSocketReceiveBufferSize(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.remote-address //go:noescape -func wasmimport_UDPSocketRemoteAddress(self0 uint32, result *cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) +func wasmimport_UDPSocketRemoteAddress(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.send-buffer-size //go:noescape -func wasmimport_UDPSocketSendBufferSize(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) +func wasmimport_UDPSocketSendBufferSize(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.set-receive-buffer-size //go:noescape -func wasmimport_UDPSocketSetReceiveBufferSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_UDPSocketSetReceiveBufferSize(self0 uint32, value0 uint64) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.set-send-buffer-size //go:noescape -func wasmimport_UDPSocketSetSendBufferSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_UDPSocketSetSendBufferSize(self0 uint32, value0 uint64) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.set-unicast-hop-limit //go:noescape -func wasmimport_UDPSocketSetUnicastHopLimit(self0 uint32, value0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_UDPSocketSetUnicastHopLimit(self0 uint32, value0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.start-bind //go:noescape -func wasmimport_UDPSocketStartBind(self0 uint32, network0 uint32, localAddress0 uint32, localAddress1 uint32, localAddress2 uint32, localAddress3 uint32, localAddress4 uint32, localAddress5 uint32, localAddress6 uint32, localAddress7 uint32, localAddress8 uint32, localAddress9 uint32, localAddress10 uint32, localAddress11 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_UDPSocketStartBind(self0 uint32, network0 uint32, localAddress0 uint32, localAddress1 uint32, localAddress2 uint32, localAddress3 uint32, localAddress4 uint32, localAddress5 uint32, localAddress6 uint32, localAddress7 uint32, localAddress8 uint32, localAddress9 uint32, localAddress10 uint32, localAddress11 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.stream //go:noescape -func wasmimport_UDPSocketStream(self0 uint32, remoteAddress0 uint32, remoteAddress1 uint32, remoteAddress2 uint32, remoteAddress3 uint32, remoteAddress4 uint32, remoteAddress5 uint32, remoteAddress6 uint32, remoteAddress7 uint32, remoteAddress8 uint32, remoteAddress9 uint32, remoteAddress10 uint32, remoteAddress11 uint32, remoteAddress12 uint32, result *cm.Result[TupleIncomingDatagramStreamOutgoingDatagramStreamShape, cm.Tuple[IncomingDatagramStream, OutgoingDatagramStream], ErrorCode]) +func wasmimport_UDPSocketStream(self0 uint32, remoteAddress0 uint32, remoteAddress1 uint32, remoteAddress2 uint32, remoteAddress3 uint32, remoteAddress4 uint32, remoteAddress5 uint32, remoteAddress6 uint32, remoteAddress7 uint32, remoteAddress8 uint32, remoteAddress9 uint32, remoteAddress10 uint32, remoteAddress11 uint32, remoteAddress12 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.subscribe //go:noescape -func wasmimport_UDPSocketSubscribe(self0 uint32) (result0 uint32) +func wasmimport_UDPSocketSubscribe(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.unicast-hop-limit //go:noescape -func wasmimport_UDPSocketUnicastHopLimit(self0 uint32, result *cm.Result[uint8, uint8, ErrorCode]) +func wasmimport_UDPSocketUnicastHopLimit(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [resource-drop]incoming-datagram-stream //go:noescape @@ -70,11 +66,11 @@ func wasmimport_IncomingDatagramStreamResourceDrop(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]incoming-datagram-stream.receive //go:noescape -func wasmimport_IncomingDatagramStreamReceive(self0 uint32, maxResults0 uint64, result *cm.Result[cm.List[IncomingDatagram], cm.List[IncomingDatagram], ErrorCode]) +func wasmimport_IncomingDatagramStreamReceive(self0 uint32, maxResults0 uint64) //go:wasmimport wasi:sockets/udp@0.2.0 [method]incoming-datagram-stream.subscribe //go:noescape -func wasmimport_IncomingDatagramStreamSubscribe(self0 uint32) (result0 uint32) +func wasmimport_IncomingDatagramStreamSubscribe(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [resource-drop]outgoing-datagram-stream //go:noescape @@ -82,12 +78,12 @@ func wasmimport_OutgoingDatagramStreamResourceDrop(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]outgoing-datagram-stream.check-send //go:noescape -func wasmimport_OutgoingDatagramStreamCheckSend(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) +func wasmimport_OutgoingDatagramStreamCheckSend(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]outgoing-datagram-stream.send //go:noescape -func wasmimport_OutgoingDatagramStreamSend(self0 uint32, datagrams0 *OutgoingDatagram, datagrams1 uint32, result *cm.Result[uint64, uint64, ErrorCode]) +func wasmimport_OutgoingDatagramStreamSend(self0 uint32, datagrams0 *OutgoingDatagram, datagrams1 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]outgoing-datagram-stream.subscribe //go:noescape -func wasmimport_OutgoingDatagramStreamSubscribe(self0 uint32) (result0 uint32) +func wasmimport_OutgoingDatagramStreamSubscribe(self0 uint32) diff --git a/examples/component/http-server/gen/wasi/sockets/udp/udp.wit.go b/examples/component/http-server/gen/wasi/sockets/udp/udp.wit.go index ecb44be0..c20a451f 100755 --- a/examples/component/http-server/gen/wasi/sockets/udp/udp.wit.go +++ b/examples/component/http-server/gen/wasi/sockets/udp/udp.wit.go @@ -76,154 +76,150 @@ func (self UDPSocket) ResourceDrop() { // AddressFamily represents the imported method "address-family". // -// address-family: func() -> ip-address-family +// address-family: func() // //go:nosplit -func (self UDPSocket) AddressFamily() (result IPAddressFamily) { +func (self UDPSocket) AddressFamily() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_UDPSocketAddressFamily((uint32)(self0)) - result = (network.IPAddressFamily)((uint32)(result0)) + wasmimport_UDPSocketAddressFamily((uint32)(self0)) return } // FinishBind represents the imported method "finish-bind". // -// finish-bind: func() -> result<_, error-code> +// finish-bind: func() // //go:nosplit -func (self UDPSocket) FinishBind() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self UDPSocket) FinishBind() { self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketFinishBind((uint32)(self0), &result) + wasmimport_UDPSocketFinishBind((uint32)(self0)) return } // LocalAddress represents the imported method "local-address". // -// local-address: func() -> result +// local-address: func() // //go:nosplit -func (self UDPSocket) LocalAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) { +func (self UDPSocket) LocalAddress() { self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketLocalAddress((uint32)(self0), &result) + wasmimport_UDPSocketLocalAddress((uint32)(self0)) return } // ReceiveBufferSize represents the imported method "receive-buffer-size". // -// receive-buffer-size: func() -> result +// receive-buffer-size: func() // //go:nosplit -func (self UDPSocket) ReceiveBufferSize() (result cm.Result[uint64, uint64, ErrorCode]) { +func (self UDPSocket) ReceiveBufferSize() { self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketReceiveBufferSize((uint32)(self0), &result) + wasmimport_UDPSocketReceiveBufferSize((uint32)(self0)) return } // RemoteAddress represents the imported method "remote-address". // -// remote-address: func() -> result +// remote-address: func() // //go:nosplit -func (self UDPSocket) RemoteAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) { +func (self UDPSocket) RemoteAddress() { self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketRemoteAddress((uint32)(self0), &result) + wasmimport_UDPSocketRemoteAddress((uint32)(self0)) return } // SendBufferSize represents the imported method "send-buffer-size". // -// send-buffer-size: func() -> result +// send-buffer-size: func() // //go:nosplit -func (self UDPSocket) SendBufferSize() (result cm.Result[uint64, uint64, ErrorCode]) { +func (self UDPSocket) SendBufferSize() { self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketSendBufferSize((uint32)(self0), &result) + wasmimport_UDPSocketSendBufferSize((uint32)(self0)) return } // SetReceiveBufferSize represents the imported method "set-receive-buffer-size". // -// set-receive-buffer-size: func(value: u64) -> result<_, error-code> +// set-receive-buffer-size: func(value: u64) // //go:nosplit -func (self UDPSocket) SetReceiveBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self UDPSocket) SetReceiveBufferSize(value uint64) { self0 := cm.Reinterpret[uint32](self) value0 := (uint64)(value) - wasmimport_UDPSocketSetReceiveBufferSize((uint32)(self0), (uint64)(value0), &result) + wasmimport_UDPSocketSetReceiveBufferSize((uint32)(self0), (uint64)(value0)) return } // SetSendBufferSize represents the imported method "set-send-buffer-size". // -// set-send-buffer-size: func(value: u64) -> result<_, error-code> +// set-send-buffer-size: func(value: u64) // //go:nosplit -func (self UDPSocket) SetSendBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self UDPSocket) SetSendBufferSize(value uint64) { self0 := cm.Reinterpret[uint32](self) value0 := (uint64)(value) - wasmimport_UDPSocketSetSendBufferSize((uint32)(self0), (uint64)(value0), &result) + wasmimport_UDPSocketSetSendBufferSize((uint32)(self0), (uint64)(value0)) return } // SetUnicastHopLimit represents the imported method "set-unicast-hop-limit". // -// set-unicast-hop-limit: func(value: u8) -> result<_, error-code> +// set-unicast-hop-limit: func(value: u8) // //go:nosplit -func (self UDPSocket) SetUnicastHopLimit(value uint8) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self UDPSocket) SetUnicastHopLimit(value uint8) { self0 := cm.Reinterpret[uint32](self) value0 := (uint32)(value) - wasmimport_UDPSocketSetUnicastHopLimit((uint32)(self0), (uint32)(value0), &result) + wasmimport_UDPSocketSetUnicastHopLimit((uint32)(self0), (uint32)(value0)) return } // StartBind represents the imported method "start-bind". // -// start-bind: func(network: borrow, local-address: ip-socket-address) -> -// result<_, error-code> +// start-bind: func(network: borrow, local-address: ip-socket-address) // //go:nosplit -func (self UDPSocket) StartBind(network_ Network, localAddress IPSocketAddress) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self UDPSocket) StartBind(network_ Network, localAddress IPSocketAddress) { self0 := cm.Reinterpret[uint32](self) network0 := cm.Reinterpret[uint32](network_) localAddress0, localAddress1, localAddress2, localAddress3, localAddress4, localAddress5, localAddress6, localAddress7, localAddress8, localAddress9, localAddress10, localAddress11 := lower_IPSocketAddress(localAddress) - wasmimport_UDPSocketStartBind((uint32)(self0), (uint32)(network0), (uint32)(localAddress0), (uint32)(localAddress1), (uint32)(localAddress2), (uint32)(localAddress3), (uint32)(localAddress4), (uint32)(localAddress5), (uint32)(localAddress6), (uint32)(localAddress7), (uint32)(localAddress8), (uint32)(localAddress9), (uint32)(localAddress10), (uint32)(localAddress11), &result) + wasmimport_UDPSocketStartBind((uint32)(self0), (uint32)(network0), (uint32)(localAddress0), (uint32)(localAddress1), (uint32)(localAddress2), (uint32)(localAddress3), (uint32)(localAddress4), (uint32)(localAddress5), (uint32)(localAddress6), (uint32)(localAddress7), (uint32)(localAddress8), (uint32)(localAddress9), (uint32)(localAddress10), (uint32)(localAddress11)) return } // Stream represents the imported method "stream". // -// %stream: func(remote-address: option) -> result, error-code> +// %stream: func(remote-address: option) // //go:nosplit -func (self UDPSocket) Stream(remoteAddress cm.Option[IPSocketAddress]) (result cm.Result[TupleIncomingDatagramStreamOutgoingDatagramStreamShape, cm.Tuple[IncomingDatagramStream, OutgoingDatagramStream], ErrorCode]) { +func (self UDPSocket) Stream(remoteAddress cm.Option[IPSocketAddress]) { self0 := cm.Reinterpret[uint32](self) remoteAddress0, remoteAddress1, remoteAddress2, remoteAddress3, remoteAddress4, remoteAddress5, remoteAddress6, remoteAddress7, remoteAddress8, remoteAddress9, remoteAddress10, remoteAddress11, remoteAddress12 := lower_OptionIPSocketAddress(remoteAddress) - wasmimport_UDPSocketStream((uint32)(self0), (uint32)(remoteAddress0), (uint32)(remoteAddress1), (uint32)(remoteAddress2), (uint32)(remoteAddress3), (uint32)(remoteAddress4), (uint32)(remoteAddress5), (uint32)(remoteAddress6), (uint32)(remoteAddress7), (uint32)(remoteAddress8), (uint32)(remoteAddress9), (uint32)(remoteAddress10), (uint32)(remoteAddress11), (uint32)(remoteAddress12), &result) + wasmimport_UDPSocketStream((uint32)(self0), (uint32)(remoteAddress0), (uint32)(remoteAddress1), (uint32)(remoteAddress2), (uint32)(remoteAddress3), (uint32)(remoteAddress4), (uint32)(remoteAddress5), (uint32)(remoteAddress6), (uint32)(remoteAddress7), (uint32)(remoteAddress8), (uint32)(remoteAddress9), (uint32)(remoteAddress10), (uint32)(remoteAddress11), (uint32)(remoteAddress12)) return } // Subscribe represents the imported method "subscribe". // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self UDPSocket) Subscribe() (result Pollable) { +func (self UDPSocket) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_UDPSocketSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_UDPSocketSubscribe((uint32)(self0)) return } // UnicastHopLimit represents the imported method "unicast-hop-limit". // -// unicast-hop-limit: func() -> result +// unicast-hop-limit: func() // //go:nosplit -func (self UDPSocket) UnicastHopLimit() (result cm.Result[uint8, uint8, ErrorCode]) { +func (self UDPSocket) UnicastHopLimit() { self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketUnicastHopLimit((uint32)(self0), &result) + wasmimport_UDPSocketUnicastHopLimit((uint32)(self0)) return } @@ -245,25 +241,24 @@ func (self IncomingDatagramStream) ResourceDrop() { // Receive represents the imported method "receive". // -// receive: func(max-results: u64) -> result, error-code> +// receive: func(max-results: u64) // //go:nosplit -func (self IncomingDatagramStream) Receive(maxResults uint64) (result cm.Result[cm.List[IncomingDatagram], cm.List[IncomingDatagram], ErrorCode]) { +func (self IncomingDatagramStream) Receive(maxResults uint64) { self0 := cm.Reinterpret[uint32](self) maxResults0 := (uint64)(maxResults) - wasmimport_IncomingDatagramStreamReceive((uint32)(self0), (uint64)(maxResults0), &result) + wasmimport_IncomingDatagramStreamReceive((uint32)(self0), (uint64)(maxResults0)) return } // Subscribe represents the imported method "subscribe". // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self IncomingDatagramStream) Subscribe() (result Pollable) { +func (self IncomingDatagramStream) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_IncomingDatagramStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_IncomingDatagramStreamSubscribe((uint32)(self0)) return } @@ -285,35 +280,34 @@ func (self OutgoingDatagramStream) ResourceDrop() { // CheckSend represents the imported method "check-send". // -// check-send: func() -> result +// check-send: func() // //go:nosplit -func (self OutgoingDatagramStream) CheckSend() (result cm.Result[uint64, uint64, ErrorCode]) { +func (self OutgoingDatagramStream) CheckSend() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingDatagramStreamCheckSend((uint32)(self0), &result) + wasmimport_OutgoingDatagramStreamCheckSend((uint32)(self0)) return } // Send represents the imported method "send". // -// send: func(datagrams: list) -> result +// send: func(datagrams: list) // //go:nosplit -func (self OutgoingDatagramStream) Send(datagrams cm.List[OutgoingDatagram]) (result cm.Result[uint64, uint64, ErrorCode]) { +func (self OutgoingDatagramStream) Send(datagrams cm.List[OutgoingDatagram]) { self0 := cm.Reinterpret[uint32](self) datagrams0, datagrams1 := cm.LowerList(datagrams) - wasmimport_OutgoingDatagramStreamSend((uint32)(self0), (*OutgoingDatagram)(datagrams0), (uint32)(datagrams1), &result) + wasmimport_OutgoingDatagramStreamSend((uint32)(self0), (*OutgoingDatagram)(datagrams0), (uint32)(datagrams1)) return } // Subscribe represents the imported method "subscribe". // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self OutgoingDatagramStream) Subscribe() (result Pollable) { +func (self OutgoingDatagramStream) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutgoingDatagramStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_OutgoingDatagramStreamSubscribe((uint32)(self0)) return } diff --git a/examples/component/http-server/gen/wasmcloud/bus/lattice/lattice.wasm.go b/examples/component/http-server/gen/wasmcloud/bus/lattice/lattice.wasm.go index 7c7b9094..6c044549 100755 --- a/examples/component/http-server/gen/wasmcloud/bus/lattice/lattice.wasm.go +++ b/examples/component/http-server/gen/wasmcloud/bus/lattice/lattice.wasm.go @@ -10,7 +10,7 @@ func wasmimport_CallTargetInterfaceResourceDrop(self0 uint32) //go:wasmimport wasmcloud:bus/lattice@1.0.0 [constructor]call-target-interface //go:noescape -func wasmimport_NewCallTargetInterface(namespace0 *uint8, namespace1 uint32, package0 *uint8, package1 uint32, interface0 *uint8, interface1 uint32) (result0 uint32) +func wasmimport_NewCallTargetInterface(namespace0 *uint8, namespace1 uint32, package0 *uint8, package1 uint32, interface0 *uint8, interface1 uint32) //go:wasmimport wasmcloud:bus/lattice@1.0.0 set-link-name //go:noescape diff --git a/examples/component/http-server/gen/wasmcloud/bus/lattice/lattice.wit.go b/examples/component/http-server/gen/wasmcloud/bus/lattice/lattice.wit.go index ba34d30c..af5d44b6 100755 --- a/examples/component/http-server/gen/wasmcloud/bus/lattice/lattice.wit.go +++ b/examples/component/http-server/gen/wasmcloud/bus/lattice/lattice.wit.go @@ -28,12 +28,11 @@ func (self CallTargetInterface) ResourceDrop() { // constructor(namespace: string, %package: string, %interface: string) // //go:nosplit -func NewCallTargetInterface(namespace string, package_ string, interface_ string) (result CallTargetInterface) { +func NewCallTargetInterface(namespace string, package_ string, interface_ string) { namespace0, namespace1 := cm.LowerString(namespace) package0, package1 := cm.LowerString(package_) interface0, interface1 := cm.LowerString(interface_) - result0 := wasmimport_NewCallTargetInterface((*uint8)(namespace0), (uint32)(namespace1), (*uint8)(package0), (uint32)(package1), (*uint8)(interface0), (uint32)(interface1)) - result = cm.Reinterpret[CallTargetInterface]((uint32)(result0)) + wasmimport_NewCallTargetInterface((*uint8)(namespace0), (uint32)(namespace1), (*uint8)(package0), (uint32)(package1), (*uint8)(interface0), (uint32)(interface1)) return } diff --git a/examples/component/http-server/gen/wasmcloud/secrets/reveal/reveal.wasm.go b/examples/component/http-server/gen/wasmcloud/secrets/reveal/reveal.wasm.go index 65404eb3..a6d83174 100755 --- a/examples/component/http-server/gen/wasmcloud/secrets/reveal/reveal.wasm.go +++ b/examples/component/http-server/gen/wasmcloud/secrets/reveal/reveal.wasm.go @@ -6,4 +6,4 @@ package reveal //go:wasmimport wasmcloud:secrets/reveal@0.1.0-draft reveal //go:noescape -func wasmimport_Reveal(s0 uint32, result *SecretValue) +func wasmimport_Reveal(s0 uint32) diff --git a/examples/component/http-server/gen/wasmcloud/secrets/reveal/reveal.wit.go b/examples/component/http-server/gen/wasmcloud/secrets/reveal/reveal.wit.go index a588f52d..6503d39c 100755 --- a/examples/component/http-server/gen/wasmcloud/secrets/reveal/reveal.wit.go +++ b/examples/component/http-server/gen/wasmcloud/secrets/reveal/reveal.wit.go @@ -20,11 +20,11 @@ type SecretValue = store.SecretValue // Reveal represents the imported function "reveal". // -// reveal: func(s: borrow) -> secret-value +// reveal: func(s: borrow) // //go:nosplit -func Reveal(s Secret) (result SecretValue) { +func Reveal(s Secret) { s0 := cm.Reinterpret[uint32](s) - wasmimport_Reveal((uint32)(s0), &result) + wasmimport_Reveal((uint32)(s0)) return } diff --git a/examples/component/http-server/gen/wasmcloud/secrets/store/store.wasm.go b/examples/component/http-server/gen/wasmcloud/secrets/store/store.wasm.go index cc94c517..4ef43490 100755 --- a/examples/component/http-server/gen/wasmcloud/secrets/store/store.wasm.go +++ b/examples/component/http-server/gen/wasmcloud/secrets/store/store.wasm.go @@ -2,10 +2,6 @@ package store -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasmcloud:secrets@0.1.0-draft". //go:wasmimport wasmcloud:secrets/store@0.1.0-draft [resource-drop]secret @@ -14,4 +10,4 @@ func wasmimport_SecretResourceDrop(self0 uint32) //go:wasmimport wasmcloud:secrets/store@0.1.0-draft get //go:noescape -func wasmimport_Get(key0 *uint8, key1 uint32, result *cm.Result[SecretsErrorShape, Secret, SecretsError]) +func wasmimport_Get(key0 *uint8, key1 uint32) diff --git a/examples/component/http-server/gen/wasmcloud/secrets/store/store.wit.go b/examples/component/http-server/gen/wasmcloud/secrets/store/store.wit.go index d3465e4f..405555fa 100755 --- a/examples/component/http-server/gen/wasmcloud/secrets/store/store.wit.go +++ b/examples/component/http-server/gen/wasmcloud/secrets/store/store.wit.go @@ -114,11 +114,11 @@ func (self Secret) ResourceDrop() { // Get represents the imported function "get". // -// get: func(key: string) -> result +// get: func(key: string) // //go:nosplit -func Get(key string) (result cm.Result[SecretsErrorShape, Secret, SecretsError]) { +func Get(key string) { key0, key1 := cm.LowerString(key) - wasmimport_Get((*uint8)(key0), (uint32)(key1), &result) + wasmimport_Get((*uint8)(key0), (uint32)(key1)) return } diff --git a/examples/component/sqldb-postgres-query/bindings.wadge_test.go b/examples/component/sqldb-postgres-query/bindings.wadge_test.go index 4fc935b7..680476e6 100644 --- a/examples/component/sqldb-postgres-query/bindings.wadge_test.go +++ b/examples/component/sqldb-postgres-query/bindings.wadge_test.go @@ -5,8 +5,10 @@ package main_test import ( + go_bytecodealliance_org__cm "go.bytecodealliance.org/cm" wadge "go.wasmcloud.dev/wadge" "runtime" + sqldb___postgres___query__gen__wasmcloud__postgres__query "sqldb-postgres-query/gen/wasmcloud/postgres/query" sqldb___postgres___query__gen__wasmcloud__postgres__types "sqldb-postgres-query/gen/wasmcloud/postgres/types" "unsafe" ) @@ -48,7 +50,7 @@ func wasmimport_Log(level0 uint32, context0 *uint8, context1 uint32, message0 *u } //go:linkname wasmimport_Query sqldb-postgres-query/gen/wasmcloud/postgres/query.wasmimport_Query -func wasmimport_Query(query0 *uint8, query1 uint32, params0 *sqldb___postgres___query__gen__wasmcloud__postgres__types.PgValue, params1 uint32) { +func wasmimport_Query(query0 *uint8, query1 uint32, params0 *sqldb___postgres___query__gen__wasmcloud__postgres__types.PgValue, params1 uint32, result *go_bytecodealliance_org__cm.Result[sqldb___postgres___query__gen__wasmcloud__postgres__query.QueryErrorShape, go_bytecodealliance_org__cm.List[sqldb___postgres___query__gen__wasmcloud__postgres__types.ResultRow], sqldb___postgres___query__gen__wasmcloud__postgres__types.QueryError]) { var __p runtime.Pinner defer __p.Unpin() if __err := wadge.WithCurrentInstance(func(__instance *wadge.Instance) error { @@ -68,6 +70,10 @@ func wasmimport_Query(query0 *uint8, query1 uint32, params0 *sqldb___postgres___ ptr := unsafe.Pointer(¶ms1) __p.Pin(ptr) return ptr + }(), func() unsafe.Pointer { + ptr := unsafe.Pointer(result) + __p.Pin(ptr) + return ptr }()) }); __err != nil { wadge.CurrentErrorHandler()(__err) @@ -76,7 +82,7 @@ func wasmimport_Query(query0 *uint8, query1 uint32, params0 *sqldb___postgres___ } //go:linkname wasmimport_QueryBatch sqldb-postgres-query/gen/wasmcloud/postgres/query.wasmimport_QueryBatch -func wasmimport_QueryBatch(query0 *uint8, query1 uint32) { +func wasmimport_QueryBatch(query0 *uint8, query1 uint32, result *go_bytecodealliance_org__cm.Result[sqldb___postgres___query__gen__wasmcloud__postgres__types.QueryError, struct{}, sqldb___postgres___query__gen__wasmcloud__postgres__types.QueryError]) { var __p runtime.Pinner defer __p.Unpin() if __err := wadge.WithCurrentInstance(func(__instance *wadge.Instance) error { @@ -88,6 +94,10 @@ func wasmimport_QueryBatch(query0 *uint8, query1 uint32) { ptr := unsafe.Pointer(&query1) __p.Pin(ptr) return ptr + }(), func() unsafe.Pointer { + ptr := unsafe.Pointer(result) + __p.Pin(ptr) + return ptr }()) }); __err != nil { wadge.CurrentErrorHandler()(__err) diff --git a/examples/component/wasitel-http/README.md b/examples/component/wasitel-http/README.md new file mode 100644 index 00000000..51db14f4 --- /dev/null +++ b/examples/component/wasitel-http/README.md @@ -0,0 +1,15 @@ +# Go WASITEL HTTP + +## 📦 Dependencies + +Before starting, ensure that you have the following installed in addition to the Go (1.23+) toolchain: + +- [`tinygo`](https://tinygo.org/getting-started/install/) for compiling Go (always use the latest version) +- [`wasm-tools`](https://github.com/bytecodealliance/wasm-tools#installation) for Go bindings +- [wasmCloud Shell (`wash`)](https://wasmcloud.com/docs/installation) for building and running the components and wasmCloud environment + +## ⚠️ Issues/FAQ + +### Build errors + +New releases of `wasm-tools` may introduce compatibility issues that can result in build errors. If you encounter issues, try using v1.225.0, which is currently the most consistent for Go builds. You can install `wasm-tools` [v1.225.0 from upstream releases](https://github.com/bytecodealliance/wasm-tools/releases/tag/v1.225.0), or use `cargo` ([Rust toolchain](https://doc.rust-lang.org/cargo/getting-started/installation.html)) -- (i.e. `cargo install --locked wasm-tools@1.225.0`) \ No newline at end of file diff --git a/examples/component/wasitel-http/gen/wasi/cli/environment/environment.wasm.go b/examples/component/wasitel-http/gen/wasi/cli/environment/environment.wasm.go index 89bb596b..b4c02ba4 100755 --- a/examples/component/wasitel-http/gen/wasi/cli/environment/environment.wasm.go +++ b/examples/component/wasitel-http/gen/wasi/cli/environment/environment.wasm.go @@ -2,20 +2,16 @@ package environment -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". //go:wasmimport wasi:cli/environment@0.2.0 get-environment //go:noescape -func wasmimport_GetEnvironment(result *cm.List[[2]string]) +func wasmimport_GetEnvironment() //go:wasmimport wasi:cli/environment@0.2.0 get-arguments //go:noescape -func wasmimport_GetArguments(result *cm.List[string]) +func wasmimport_GetArguments() //go:wasmimport wasi:cli/environment@0.2.0 initial-cwd //go:noescape -func wasmimport_InitialCWD(result *cm.Option[string]) +func wasmimport_InitialCWD() diff --git a/examples/component/wasitel-http/gen/wasi/cli/environment/environment.wit.go b/examples/component/wasitel-http/gen/wasi/cli/environment/environment.wit.go index 068bed33..7d1f8133 100755 --- a/examples/component/wasitel-http/gen/wasi/cli/environment/environment.wit.go +++ b/examples/component/wasitel-http/gen/wasi/cli/environment/environment.wit.go @@ -3,36 +3,32 @@ // Package environment represents the imported interface "wasi:cli/environment@0.2.0". package environment -import ( - "go.bytecodealliance.org/cm" -) - // GetEnvironment represents the imported function "get-environment". // -// get-environment: func() -> list> +// get-environment: func() // //go:nosplit -func GetEnvironment() (result cm.List[[2]string]) { - wasmimport_GetEnvironment(&result) +func GetEnvironment() { + wasmimport_GetEnvironment() return } // GetArguments represents the imported function "get-arguments". // -// get-arguments: func() -> list +// get-arguments: func() // //go:nosplit -func GetArguments() (result cm.List[string]) { - wasmimport_GetArguments(&result) +func GetArguments() { + wasmimport_GetArguments() return } // InitialCWD represents the imported function "initial-cwd". // -// initial-cwd: func() -> option +// initial-cwd: func() // //go:nosplit -func InitialCWD() (result cm.Option[string]) { - wasmimport_InitialCWD(&result) +func InitialCWD() { + wasmimport_InitialCWD() return } diff --git a/examples/component/wasitel-http/gen/wasi/cli/stderr/stderr.wasm.go b/examples/component/wasitel-http/gen/wasi/cli/stderr/stderr.wasm.go index 462cf172..9c5bcdb9 100755 --- a/examples/component/wasitel-http/gen/wasi/cli/stderr/stderr.wasm.go +++ b/examples/component/wasitel-http/gen/wasi/cli/stderr/stderr.wasm.go @@ -6,4 +6,4 @@ package stderr //go:wasmimport wasi:cli/stderr@0.2.0 get-stderr //go:noescape -func wasmimport_GetStderr() (result0 uint32) +func wasmimport_GetStderr() diff --git a/examples/component/wasitel-http/gen/wasi/cli/stderr/stderr.wit.go b/examples/component/wasitel-http/gen/wasi/cli/stderr/stderr.wit.go index 56d7a621..2431a839 100755 --- a/examples/component/wasitel-http/gen/wasi/cli/stderr/stderr.wit.go +++ b/examples/component/wasitel-http/gen/wasi/cli/stderr/stderr.wit.go @@ -4,7 +4,6 @@ package stderr import ( - "go.bytecodealliance.org/cm" "wasitel-http/gen/wasi/io/streams" ) @@ -15,11 +14,10 @@ type OutputStream = streams.OutputStream // GetStderr represents the imported function "get-stderr". // -// get-stderr: func() -> output-stream +// get-stderr: func() // //go:nosplit -func GetStderr() (result OutputStream) { - result0 := wasmimport_GetStderr() - result = cm.Reinterpret[OutputStream]((uint32)(result0)) +func GetStderr() { + wasmimport_GetStderr() return } diff --git a/examples/component/wasitel-http/gen/wasi/cli/stdin/stdin.wasm.go b/examples/component/wasitel-http/gen/wasi/cli/stdin/stdin.wasm.go index 374eb253..090f2e31 100755 --- a/examples/component/wasitel-http/gen/wasi/cli/stdin/stdin.wasm.go +++ b/examples/component/wasitel-http/gen/wasi/cli/stdin/stdin.wasm.go @@ -6,4 +6,4 @@ package stdin //go:wasmimport wasi:cli/stdin@0.2.0 get-stdin //go:noescape -func wasmimport_GetStdin() (result0 uint32) +func wasmimport_GetStdin() diff --git a/examples/component/wasitel-http/gen/wasi/cli/stdin/stdin.wit.go b/examples/component/wasitel-http/gen/wasi/cli/stdin/stdin.wit.go index cb2fd514..85734bee 100755 --- a/examples/component/wasitel-http/gen/wasi/cli/stdin/stdin.wit.go +++ b/examples/component/wasitel-http/gen/wasi/cli/stdin/stdin.wit.go @@ -4,7 +4,6 @@ package stdin import ( - "go.bytecodealliance.org/cm" "wasitel-http/gen/wasi/io/streams" ) @@ -15,11 +14,10 @@ type InputStream = streams.InputStream // GetStdin represents the imported function "get-stdin". // -// get-stdin: func() -> input-stream +// get-stdin: func() // //go:nosplit -func GetStdin() (result InputStream) { - result0 := wasmimport_GetStdin() - result = cm.Reinterpret[InputStream]((uint32)(result0)) +func GetStdin() { + wasmimport_GetStdin() return } diff --git a/examples/component/wasitel-http/gen/wasi/cli/stdout/stdout.wasm.go b/examples/component/wasitel-http/gen/wasi/cli/stdout/stdout.wasm.go index 68e4a3da..1a1a2650 100755 --- a/examples/component/wasitel-http/gen/wasi/cli/stdout/stdout.wasm.go +++ b/examples/component/wasitel-http/gen/wasi/cli/stdout/stdout.wasm.go @@ -6,4 +6,4 @@ package stdout //go:wasmimport wasi:cli/stdout@0.2.0 get-stdout //go:noescape -func wasmimport_GetStdout() (result0 uint32) +func wasmimport_GetStdout() diff --git a/examples/component/wasitel-http/gen/wasi/cli/stdout/stdout.wit.go b/examples/component/wasitel-http/gen/wasi/cli/stdout/stdout.wit.go index 137c4fea..6e555b32 100755 --- a/examples/component/wasitel-http/gen/wasi/cli/stdout/stdout.wit.go +++ b/examples/component/wasitel-http/gen/wasi/cli/stdout/stdout.wit.go @@ -4,7 +4,6 @@ package stdout import ( - "go.bytecodealliance.org/cm" "wasitel-http/gen/wasi/io/streams" ) @@ -15,11 +14,10 @@ type OutputStream = streams.OutputStream // GetStdout represents the imported function "get-stdout". // -// get-stdout: func() -> output-stream +// get-stdout: func() // //go:nosplit -func GetStdout() (result OutputStream) { - result0 := wasmimport_GetStdout() - result = cm.Reinterpret[OutputStream]((uint32)(result0)) +func GetStdout() { + wasmimport_GetStdout() return } diff --git a/examples/component/wasitel-http/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go b/examples/component/wasitel-http/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go index e99189d5..90389791 100755 --- a/examples/component/wasitel-http/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go +++ b/examples/component/wasitel-http/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go @@ -4,7 +4,6 @@ package terminalstderr import ( - "go.bytecodealliance.org/cm" terminaloutput "wasitel-http/gen/wasi/cli/terminal-output" ) @@ -15,10 +14,10 @@ type TerminalOutput = terminaloutput.TerminalOutput // GetTerminalStderr represents the imported function "get-terminal-stderr". // -// get-terminal-stderr: func() -> option +// get-terminal-stderr: func() // //go:nosplit -func GetTerminalStderr() (result cm.Option[TerminalOutput]) { - wasmimport_GetTerminalStderr(&result) +func GetTerminalStderr() { + wasmimport_GetTerminalStderr() return } diff --git a/examples/component/wasitel-http/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go b/examples/component/wasitel-http/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go index be9af72f..03cbe909 100755 --- a/examples/component/wasitel-http/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go +++ b/examples/component/wasitel-http/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go @@ -2,12 +2,8 @@ package terminalstderr -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". //go:wasmimport wasi:cli/terminal-stderr@0.2.0 get-terminal-stderr //go:noescape -func wasmimport_GetTerminalStderr(result *cm.Option[TerminalOutput]) +func wasmimport_GetTerminalStderr() diff --git a/examples/component/wasitel-http/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go b/examples/component/wasitel-http/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go index 291e181c..4a046a62 100755 --- a/examples/component/wasitel-http/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go +++ b/examples/component/wasitel-http/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go @@ -4,7 +4,6 @@ package terminalstdin import ( - "go.bytecodealliance.org/cm" terminalinput "wasitel-http/gen/wasi/cli/terminal-input" ) @@ -15,10 +14,10 @@ type TerminalInput = terminalinput.TerminalInput // GetTerminalStdin represents the imported function "get-terminal-stdin". // -// get-terminal-stdin: func() -> option +// get-terminal-stdin: func() // //go:nosplit -func GetTerminalStdin() (result cm.Option[TerminalInput]) { - wasmimport_GetTerminalStdin(&result) +func GetTerminalStdin() { + wasmimport_GetTerminalStdin() return } diff --git a/examples/component/wasitel-http/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go b/examples/component/wasitel-http/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go index e3b3ac61..1a59d9fd 100755 --- a/examples/component/wasitel-http/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go +++ b/examples/component/wasitel-http/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go @@ -2,12 +2,8 @@ package terminalstdin -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". //go:wasmimport wasi:cli/terminal-stdin@0.2.0 get-terminal-stdin //go:noescape -func wasmimport_GetTerminalStdin(result *cm.Option[TerminalInput]) +func wasmimport_GetTerminalStdin() diff --git a/examples/component/wasitel-http/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go b/examples/component/wasitel-http/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go index e8bdd0fb..5e3bf951 100755 --- a/examples/component/wasitel-http/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go +++ b/examples/component/wasitel-http/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go @@ -4,7 +4,6 @@ package terminalstdout import ( - "go.bytecodealliance.org/cm" terminaloutput "wasitel-http/gen/wasi/cli/terminal-output" ) @@ -15,10 +14,10 @@ type TerminalOutput = terminaloutput.TerminalOutput // GetTerminalStdout represents the imported function "get-terminal-stdout". // -// get-terminal-stdout: func() -> option +// get-terminal-stdout: func() // //go:nosplit -func GetTerminalStdout() (result cm.Option[TerminalOutput]) { - wasmimport_GetTerminalStdout(&result) +func GetTerminalStdout() { + wasmimport_GetTerminalStdout() return } diff --git a/examples/component/wasitel-http/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go b/examples/component/wasitel-http/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go index fa750ad9..c45db1d2 100755 --- a/examples/component/wasitel-http/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go +++ b/examples/component/wasitel-http/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go @@ -2,12 +2,8 @@ package terminalstdout -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". //go:wasmimport wasi:cli/terminal-stdout@0.2.0 get-terminal-stdout //go:noescape -func wasmimport_GetTerminalStdout(result *cm.Option[TerminalOutput]) +func wasmimport_GetTerminalStdout() diff --git a/examples/component/wasitel-http/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go b/examples/component/wasitel-http/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go index c5b4d245..512b045c 100755 --- a/examples/component/wasitel-http/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go +++ b/examples/component/wasitel-http/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go @@ -4,7 +4,6 @@ package monotonicclock import ( - "go.bytecodealliance.org/cm" "wasitel-http/gen/wasi/io/poll" ) @@ -25,46 +24,42 @@ type Duration uint64 // Now represents the imported function "now". // -// now: func() -> instant +// now: func() // //go:nosplit -func Now() (result Instant) { - result0 := wasmimport_Now() - result = (Instant)((uint64)(result0)) +func Now() { + wasmimport_Now() return } // Resolution represents the imported function "resolution". // -// resolution: func() -> duration +// resolution: func() // //go:nosplit -func Resolution() (result Duration) { - result0 := wasmimport_Resolution() - result = (Duration)((uint64)(result0)) +func Resolution() { + wasmimport_Resolution() return } // SubscribeInstant represents the imported function "subscribe-instant". // -// subscribe-instant: func(when: instant) -> pollable +// subscribe-instant: func(when: instant) // //go:nosplit -func SubscribeInstant(when Instant) (result Pollable) { +func SubscribeInstant(when Instant) { when0 := (uint64)(when) - result0 := wasmimport_SubscribeInstant((uint64)(when0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_SubscribeInstant((uint64)(when0)) return } // SubscribeDuration represents the imported function "subscribe-duration". // -// subscribe-duration: func(when: duration) -> pollable +// subscribe-duration: func(when: duration) // //go:nosplit -func SubscribeDuration(when Duration) (result Pollable) { +func SubscribeDuration(when Duration) { when0 := (uint64)(when) - result0 := wasmimport_SubscribeDuration((uint64)(when0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_SubscribeDuration((uint64)(when0)) return } diff --git a/examples/component/wasitel-http/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go b/examples/component/wasitel-http/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go index 36a1720a..4494c61a 100755 --- a/examples/component/wasitel-http/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go +++ b/examples/component/wasitel-http/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go @@ -6,16 +6,16 @@ package monotonicclock //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 now //go:noescape -func wasmimport_Now() (result0 uint64) +func wasmimport_Now() //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 resolution //go:noescape -func wasmimport_Resolution() (result0 uint64) +func wasmimport_Resolution() //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 subscribe-instant //go:noescape -func wasmimport_SubscribeInstant(when0 uint64) (result0 uint32) +func wasmimport_SubscribeInstant(when0 uint64) //go:wasmimport wasi:clocks/monotonic-clock@0.2.0 subscribe-duration //go:noescape -func wasmimport_SubscribeDuration(when0 uint64) (result0 uint32) +func wasmimport_SubscribeDuration(when0 uint64) diff --git a/examples/component/wasitel-http/gen/wasi/clocks/wall-clock/wall-clock.wit.go b/examples/component/wasitel-http/gen/wasi/clocks/wall-clock/wall-clock.wit.go index e3f35395..308f0910 100755 --- a/examples/component/wasitel-http/gen/wasi/clocks/wall-clock/wall-clock.wit.go +++ b/examples/component/wasitel-http/gen/wasi/clocks/wall-clock/wall-clock.wit.go @@ -21,20 +21,20 @@ type DateTime struct { // Now represents the imported function "now". // -// now: func() -> datetime +// now: func() // //go:nosplit -func Now() (result DateTime) { - wasmimport_Now(&result) +func Now() { + wasmimport_Now() return } // Resolution represents the imported function "resolution". // -// resolution: func() -> datetime +// resolution: func() // //go:nosplit -func Resolution() (result DateTime) { - wasmimport_Resolution(&result) +func Resolution() { + wasmimport_Resolution() return } diff --git a/examples/component/wasitel-http/gen/wasi/clocks/wall-clock/wallclock.wasm.go b/examples/component/wasitel-http/gen/wasi/clocks/wall-clock/wallclock.wasm.go index 321ff3f1..4efbaf84 100755 --- a/examples/component/wasitel-http/gen/wasi/clocks/wall-clock/wallclock.wasm.go +++ b/examples/component/wasitel-http/gen/wasi/clocks/wall-clock/wallclock.wasm.go @@ -6,8 +6,8 @@ package wallclock //go:wasmimport wasi:clocks/wall-clock@0.2.0 now //go:noescape -func wasmimport_Now(result *DateTime) +func wasmimport_Now() //go:wasmimport wasi:clocks/wall-clock@0.2.0 resolution //go:noescape -func wasmimport_Resolution(result *DateTime) +func wasmimport_Resolution() diff --git a/examples/component/wasitel-http/gen/wasi/config/runtime/runtime.wasm.go b/examples/component/wasitel-http/gen/wasi/config/runtime/runtime.wasm.go index 8ce17d5e..4abfb286 100755 --- a/examples/component/wasitel-http/gen/wasi/config/runtime/runtime.wasm.go +++ b/examples/component/wasitel-http/gen/wasi/config/runtime/runtime.wasm.go @@ -2,16 +2,12 @@ package runtime -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:config@0.2.0-draft". //go:wasmimport wasi:config/runtime@0.2.0-draft get //go:noescape -func wasmimport_Get(key0 *uint8, key1 uint32, result *cm.Result[OptionStringShape, cm.Option[string], ConfigError]) +func wasmimport_Get(key0 *uint8, key1 uint32) //go:wasmimport wasi:config/runtime@0.2.0-draft get-all //go:noescape -func wasmimport_GetAll(result *cm.Result[ConfigErrorShape, cm.List[[2]string], ConfigError]) +func wasmimport_GetAll() diff --git a/examples/component/wasitel-http/gen/wasi/config/runtime/runtime.wit.go b/examples/component/wasitel-http/gen/wasi/config/runtime/runtime.wit.go index 99a739d1..204a5c0c 100755 --- a/examples/component/wasitel-http/gen/wasi/config/runtime/runtime.wit.go +++ b/examples/component/wasitel-http/gen/wasi/config/runtime/runtime.wit.go @@ -47,21 +47,21 @@ func (v ConfigError) String() string { // Get represents the imported function "get". // -// get: func(key: string) -> result, config-error> +// get: func(key: string) // //go:nosplit -func Get(key string) (result cm.Result[OptionStringShape, cm.Option[string], ConfigError]) { +func Get(key string) { key0, key1 := cm.LowerString(key) - wasmimport_Get((*uint8)(key0), (uint32)(key1), &result) + wasmimport_Get((*uint8)(key0), (uint32)(key1)) return } // GetAll represents the imported function "get-all". // -// get-all: func() -> result>, config-error> +// get-all: func() // //go:nosplit -func GetAll() (result cm.Result[ConfigErrorShape, cm.List[[2]string], ConfigError]) { - wasmimport_GetAll(&result) +func GetAll() { + wasmimport_GetAll() return } diff --git a/examples/component/wasitel-http/gen/wasi/filesystem/preopens/preopens.wasm.go b/examples/component/wasitel-http/gen/wasi/filesystem/preopens/preopens.wasm.go index 1bcd416a..50885ee0 100755 --- a/examples/component/wasitel-http/gen/wasi/filesystem/preopens/preopens.wasm.go +++ b/examples/component/wasitel-http/gen/wasi/filesystem/preopens/preopens.wasm.go @@ -2,12 +2,8 @@ package preopens -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:filesystem@0.2.0". //go:wasmimport wasi:filesystem/preopens@0.2.0 get-directories //go:noescape -func wasmimport_GetDirectories(result *cm.List[cm.Tuple[Descriptor, string]]) +func wasmimport_GetDirectories() diff --git a/examples/component/wasitel-http/gen/wasi/filesystem/preopens/preopens.wit.go b/examples/component/wasitel-http/gen/wasi/filesystem/preopens/preopens.wit.go index abe2a4aa..13f328a3 100755 --- a/examples/component/wasitel-http/gen/wasi/filesystem/preopens/preopens.wit.go +++ b/examples/component/wasitel-http/gen/wasi/filesystem/preopens/preopens.wit.go @@ -4,7 +4,6 @@ package preopens import ( - "go.bytecodealliance.org/cm" "wasitel-http/gen/wasi/filesystem/types" ) @@ -15,10 +14,10 @@ type Descriptor = types.Descriptor // GetDirectories represents the imported function "get-directories". // -// get-directories: func() -> list> +// get-directories: func() // //go:nosplit -func GetDirectories() (result cm.List[cm.Tuple[Descriptor, string]]) { - wasmimport_GetDirectories(&result) +func GetDirectories() { + wasmimport_GetDirectories() return } diff --git a/examples/component/wasitel-http/gen/wasi/filesystem/types/abi.go b/examples/component/wasitel-http/gen/wasi/filesystem/types/abi.go index dbea951a..abe9e2f4 100755 --- a/examples/component/wasitel-http/gen/wasi/filesystem/types/abi.go +++ b/examples/component/wasitel-http/gen/wasi/filesystem/types/abi.go @@ -4,22 +4,9 @@ package types import ( "go.bytecodealliance.org/cm" - "unsafe" wallclock "wasitel-http/gen/wasi/clocks/wall-clock" ) -// MetadataHashValueShape is used for storage in variant or result types. -type MetadataHashValueShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(MetadataHashValue{})]byte -} - -// TupleListU8BoolShape is used for storage in variant or result types. -type TupleListU8BoolShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Tuple[cm.List[uint8], bool]{})]byte -} - func lower_DateTime(v wallclock.DateTime) (f0 uint64, f1 uint32) { f0 = (uint64)(v.Seconds) f1 = (uint32)(v.Nanoseconds) @@ -36,15 +23,3 @@ func lower_NewTimestamp(v NewTimestamp) (f0 uint32, f1 uint64, f2 uint32) { } return } - -// DescriptorStatShape is used for storage in variant or result types. -type DescriptorStatShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(DescriptorStat{})]byte -} - -// OptionDirectoryEntryShape is used for storage in variant or result types. -type OptionDirectoryEntryShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Option[DirectoryEntry]{})]byte -} diff --git a/examples/component/wasitel-http/gen/wasi/filesystem/types/types.wasm.go b/examples/component/wasitel-http/gen/wasi/filesystem/types/types.wasm.go index b97dad84..7a2b9993 100755 --- a/examples/component/wasitel-http/gen/wasi/filesystem/types/types.wasm.go +++ b/examples/component/wasitel-http/gen/wasi/filesystem/types/types.wasm.go @@ -2,10 +2,6 @@ package types -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:filesystem@0.2.0". //go:wasmimport wasi:filesystem/types@0.2.0 [resource-drop]descriptor @@ -14,111 +10,111 @@ func wasmimport_DescriptorResourceDrop(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.advise //go:noescape -func wasmimport_DescriptorAdvise(self0 uint32, offset0 uint64, length0 uint64, advice0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorAdvise(self0 uint32, offset0 uint64, length0 uint64, advice0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.append-via-stream //go:noescape -func wasmimport_DescriptorAppendViaStream(self0 uint32, result *cm.Result[OutputStream, OutputStream, ErrorCode]) +func wasmimport_DescriptorAppendViaStream(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.create-directory-at //go:noescape -func wasmimport_DescriptorCreateDirectoryAt(self0 uint32, path0 *uint8, path1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorCreateDirectoryAt(self0 uint32, path0 *uint8, path1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.get-flags //go:noescape -func wasmimport_DescriptorGetFlags(self0 uint32, result *cm.Result[DescriptorFlags, DescriptorFlags, ErrorCode]) +func wasmimport_DescriptorGetFlags(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.get-type //go:noescape -func wasmimport_DescriptorGetType(self0 uint32, result *cm.Result[DescriptorType, DescriptorType, ErrorCode]) +func wasmimport_DescriptorGetType(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.is-same-object //go:noescape -func wasmimport_DescriptorIsSameObject(self0 uint32, other0 uint32) (result0 uint32) +func wasmimport_DescriptorIsSameObject(self0 uint32, other0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.link-at //go:noescape -func wasmimport_DescriptorLinkAt(self0 uint32, oldPathFlags0 uint32, oldPath0 *uint8, oldPath1 uint32, newDescriptor0 uint32, newPath0 *uint8, newPath1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorLinkAt(self0 uint32, oldPathFlags0 uint32, oldPath0 *uint8, oldPath1 uint32, newDescriptor0 uint32, newPath0 *uint8, newPath1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.metadata-hash //go:noescape -func wasmimport_DescriptorMetadataHash(self0 uint32, result *cm.Result[MetadataHashValueShape, MetadataHashValue, ErrorCode]) +func wasmimport_DescriptorMetadataHash(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.metadata-hash-at //go:noescape -func wasmimport_DescriptorMetadataHashAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, result *cm.Result[MetadataHashValueShape, MetadataHashValue, ErrorCode]) +func wasmimport_DescriptorMetadataHashAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.open-at //go:noescape -func wasmimport_DescriptorOpenAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, openFlags0 uint32, flags0 uint32, result *cm.Result[Descriptor, Descriptor, ErrorCode]) +func wasmimport_DescriptorOpenAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, openFlags0 uint32, flags0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.read //go:noescape -func wasmimport_DescriptorRead(self0 uint32, length0 uint64, offset0 uint64, result *cm.Result[TupleListU8BoolShape, cm.Tuple[cm.List[uint8], bool], ErrorCode]) +func wasmimport_DescriptorRead(self0 uint32, length0 uint64, offset0 uint64) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.read-directory //go:noescape -func wasmimport_DescriptorReadDirectory(self0 uint32, result *cm.Result[DirectoryEntryStream, DirectoryEntryStream, ErrorCode]) +func wasmimport_DescriptorReadDirectory(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.read-via-stream //go:noescape -func wasmimport_DescriptorReadViaStream(self0 uint32, offset0 uint64, result *cm.Result[InputStream, InputStream, ErrorCode]) +func wasmimport_DescriptorReadViaStream(self0 uint32, offset0 uint64) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.readlink-at //go:noescape -func wasmimport_DescriptorReadLinkAt(self0 uint32, path0 *uint8, path1 uint32, result *cm.Result[string, string, ErrorCode]) +func wasmimport_DescriptorReadLinkAt(self0 uint32, path0 *uint8, path1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.remove-directory-at //go:noescape -func wasmimport_DescriptorRemoveDirectoryAt(self0 uint32, path0 *uint8, path1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorRemoveDirectoryAt(self0 uint32, path0 *uint8, path1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.rename-at //go:noescape -func wasmimport_DescriptorRenameAt(self0 uint32, oldPath0 *uint8, oldPath1 uint32, newDescriptor0 uint32, newPath0 *uint8, newPath1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorRenameAt(self0 uint32, oldPath0 *uint8, oldPath1 uint32, newDescriptor0 uint32, newPath0 *uint8, newPath1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.set-size //go:noescape -func wasmimport_DescriptorSetSize(self0 uint32, size0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorSetSize(self0 uint32, size0 uint64) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.set-times //go:noescape -func wasmimport_DescriptorSetTimes(self0 uint32, dataAccessTimestamp0 uint32, dataAccessTimestamp1 uint64, dataAccessTimestamp2 uint32, dataModificationTimestamp0 uint32, dataModificationTimestamp1 uint64, dataModificationTimestamp2 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorSetTimes(self0 uint32, dataAccessTimestamp0 uint32, dataAccessTimestamp1 uint64, dataAccessTimestamp2 uint32, dataModificationTimestamp0 uint32, dataModificationTimestamp1 uint64, dataModificationTimestamp2 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.set-times-at //go:noescape -func wasmimport_DescriptorSetTimesAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, dataAccessTimestamp0 uint32, dataAccessTimestamp1 uint64, dataAccessTimestamp2 uint32, dataModificationTimestamp0 uint32, dataModificationTimestamp1 uint64, dataModificationTimestamp2 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorSetTimesAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, dataAccessTimestamp0 uint32, dataAccessTimestamp1 uint64, dataAccessTimestamp2 uint32, dataModificationTimestamp0 uint32, dataModificationTimestamp1 uint64, dataModificationTimestamp2 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.stat //go:noescape -func wasmimport_DescriptorStat(self0 uint32, result *cm.Result[DescriptorStatShape, DescriptorStat, ErrorCode]) +func wasmimport_DescriptorStat(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.stat-at //go:noescape -func wasmimport_DescriptorStatAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, result *cm.Result[DescriptorStatShape, DescriptorStat, ErrorCode]) +func wasmimport_DescriptorStatAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.symlink-at //go:noescape -func wasmimport_DescriptorSymlinkAt(self0 uint32, oldPath0 *uint8, oldPath1 uint32, newPath0 *uint8, newPath1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorSymlinkAt(self0 uint32, oldPath0 *uint8, oldPath1 uint32, newPath0 *uint8, newPath1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.sync //go:noescape -func wasmimport_DescriptorSync(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorSync(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.sync-data //go:noescape -func wasmimport_DescriptorSyncData(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorSyncData(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.unlink-file-at //go:noescape -func wasmimport_DescriptorUnlinkFileAt(self0 uint32, path0 *uint8, path1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_DescriptorUnlinkFileAt(self0 uint32, path0 *uint8, path1 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.write //go:noescape -func wasmimport_DescriptorWrite(self0 uint32, buffer0 *uint8, buffer1 uint32, offset0 uint64, result *cm.Result[uint64, FileSize, ErrorCode]) +func wasmimport_DescriptorWrite(self0 uint32, buffer0 *uint8, buffer1 uint32, offset0 uint64) //go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.write-via-stream //go:noescape -func wasmimport_DescriptorWriteViaStream(self0 uint32, offset0 uint64, result *cm.Result[OutputStream, OutputStream, ErrorCode]) +func wasmimport_DescriptorWriteViaStream(self0 uint32, offset0 uint64) //go:wasmimport wasi:filesystem/types@0.2.0 [resource-drop]directory-entry-stream //go:noescape @@ -126,8 +122,8 @@ func wasmimport_DirectoryEntryStreamResourceDrop(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 [method]directory-entry-stream.read-directory-entry //go:noescape -func wasmimport_DirectoryEntryStreamReadDirectoryEntry(self0 uint32, result *cm.Result[OptionDirectoryEntryShape, cm.Option[DirectoryEntry], ErrorCode]) +func wasmimport_DirectoryEntryStreamReadDirectoryEntry(self0 uint32) //go:wasmimport wasi:filesystem/types@0.2.0 filesystem-error-code //go:noescape -func wasmimport_FilesystemErrorCode(err0 uint32, result *cm.Option[ErrorCode]) +func wasmimport_FilesystemErrorCode(err0 uint32) diff --git a/examples/component/wasitel-http/gen/wasi/filesystem/types/types.wit.go b/examples/component/wasitel-http/gen/wasi/filesystem/types/types.wit.go index 03ff475c..df632617 100755 --- a/examples/component/wasitel-http/gen/wasi/filesystem/types/types.wit.go +++ b/examples/component/wasitel-http/gen/wasi/filesystem/types/types.wit.go @@ -406,345 +406,341 @@ func (self Descriptor) ResourceDrop() { // Advise represents the imported method "advise". // -// advise: func(offset: filesize, length: filesize, advice: advice) -> result<_, error-code> +// advise: func(offset: filesize, length: filesize, advice: advice) // //go:nosplit -func (self Descriptor) Advise(offset FileSize, length FileSize, advice Advice) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) Advise(offset FileSize, length FileSize, advice Advice) { self0 := cm.Reinterpret[uint32](self) offset0 := (uint64)(offset) length0 := (uint64)(length) advice0 := (uint32)(advice) - wasmimport_DescriptorAdvise((uint32)(self0), (uint64)(offset0), (uint64)(length0), (uint32)(advice0), &result) + wasmimport_DescriptorAdvise((uint32)(self0), (uint64)(offset0), (uint64)(length0), (uint32)(advice0)) return } // AppendViaStream represents the imported method "append-via-stream". // -// append-via-stream: func() -> result +// append-via-stream: func() // //go:nosplit -func (self Descriptor) AppendViaStream() (result cm.Result[OutputStream, OutputStream, ErrorCode]) { +func (self Descriptor) AppendViaStream() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorAppendViaStream((uint32)(self0), &result) + wasmimport_DescriptorAppendViaStream((uint32)(self0)) return } // CreateDirectoryAt represents the imported method "create-directory-at". // -// create-directory-at: func(path: string) -> result<_, error-code> +// create-directory-at: func(path: string) // //go:nosplit -func (self Descriptor) CreateDirectoryAt(path string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) CreateDirectoryAt(path string) { self0 := cm.Reinterpret[uint32](self) path0, path1 := cm.LowerString(path) - wasmimport_DescriptorCreateDirectoryAt((uint32)(self0), (*uint8)(path0), (uint32)(path1), &result) + wasmimport_DescriptorCreateDirectoryAt((uint32)(self0), (*uint8)(path0), (uint32)(path1)) return } // GetFlags represents the imported method "get-flags". // -// get-flags: func() -> result +// get-flags: func() // //go:nosplit -func (self Descriptor) GetFlags() (result cm.Result[DescriptorFlags, DescriptorFlags, ErrorCode]) { +func (self Descriptor) GetFlags() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorGetFlags((uint32)(self0), &result) + wasmimport_DescriptorGetFlags((uint32)(self0)) return } // GetType represents the imported method "get-type". // -// get-type: func() -> result +// get-type: func() // //go:nosplit -func (self Descriptor) GetType() (result cm.Result[DescriptorType, DescriptorType, ErrorCode]) { +func (self Descriptor) GetType() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorGetType((uint32)(self0), &result) + wasmimport_DescriptorGetType((uint32)(self0)) return } // IsSameObject represents the imported method "is-same-object". // -// is-same-object: func(other: borrow) -> bool +// is-same-object: func(other: borrow) // //go:nosplit -func (self Descriptor) IsSameObject(other Descriptor) (result bool) { +func (self Descriptor) IsSameObject(other Descriptor) { self0 := cm.Reinterpret[uint32](self) other0 := cm.Reinterpret[uint32](other) - result0 := wasmimport_DescriptorIsSameObject((uint32)(self0), (uint32)(other0)) - result = (bool)(cm.U32ToBool((uint32)(result0))) + wasmimport_DescriptorIsSameObject((uint32)(self0), (uint32)(other0)) return } // LinkAt represents the imported method "link-at". // // link-at: func(old-path-flags: path-flags, old-path: string, new-descriptor: borrow, -// new-path: string) -> result<_, error-code> +// new-path: string) // //go:nosplit -func (self Descriptor) LinkAt(oldPathFlags PathFlags, oldPath string, newDescriptor Descriptor, newPath string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) LinkAt(oldPathFlags PathFlags, oldPath string, newDescriptor Descriptor, newPath string) { self0 := cm.Reinterpret[uint32](self) oldPathFlags0 := (uint32)(oldPathFlags) oldPath0, oldPath1 := cm.LowerString(oldPath) newDescriptor0 := cm.Reinterpret[uint32](newDescriptor) newPath0, newPath1 := cm.LowerString(newPath) - wasmimport_DescriptorLinkAt((uint32)(self0), (uint32)(oldPathFlags0), (*uint8)(oldPath0), (uint32)(oldPath1), (uint32)(newDescriptor0), (*uint8)(newPath0), (uint32)(newPath1), &result) + wasmimport_DescriptorLinkAt((uint32)(self0), (uint32)(oldPathFlags0), (*uint8)(oldPath0), (uint32)(oldPath1), (uint32)(newDescriptor0), (*uint8)(newPath0), (uint32)(newPath1)) return } // MetadataHash represents the imported method "metadata-hash". // -// metadata-hash: func() -> result +// metadata-hash: func() // //go:nosplit -func (self Descriptor) MetadataHash() (result cm.Result[MetadataHashValueShape, MetadataHashValue, ErrorCode]) { +func (self Descriptor) MetadataHash() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorMetadataHash((uint32)(self0), &result) + wasmimport_DescriptorMetadataHash((uint32)(self0)) return } // MetadataHashAt represents the imported method "metadata-hash-at". // -// metadata-hash-at: func(path-flags: path-flags, path: string) -> result +// metadata-hash-at: func(path-flags: path-flags, path: string) // //go:nosplit -func (self Descriptor) MetadataHashAt(pathFlags PathFlags, path string) (result cm.Result[MetadataHashValueShape, MetadataHashValue, ErrorCode]) { +func (self Descriptor) MetadataHashAt(pathFlags PathFlags, path string) { self0 := cm.Reinterpret[uint32](self) pathFlags0 := (uint32)(pathFlags) path0, path1 := cm.LowerString(path) - wasmimport_DescriptorMetadataHashAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), &result) + wasmimport_DescriptorMetadataHashAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1)) return } // OpenAt represents the imported method "open-at". // // open-at: func(path-flags: path-flags, path: string, open-flags: open-flags, %flags: -// descriptor-flags) -> result +// descriptor-flags) // //go:nosplit -func (self Descriptor) OpenAt(pathFlags PathFlags, path string, openFlags OpenFlags, flags DescriptorFlags) (result cm.Result[Descriptor, Descriptor, ErrorCode]) { +func (self Descriptor) OpenAt(pathFlags PathFlags, path string, openFlags OpenFlags, flags DescriptorFlags) { self0 := cm.Reinterpret[uint32](self) pathFlags0 := (uint32)(pathFlags) path0, path1 := cm.LowerString(path) openFlags0 := (uint32)(openFlags) flags0 := (uint32)(flags) - wasmimport_DescriptorOpenAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), (uint32)(openFlags0), (uint32)(flags0), &result) + wasmimport_DescriptorOpenAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), (uint32)(openFlags0), (uint32)(flags0)) return } // Read represents the imported method "read". // -// read: func(length: filesize, offset: filesize) -> result, bool>, -// error-code> +// read: func(length: filesize, offset: filesize) // //go:nosplit -func (self Descriptor) Read(length FileSize, offset FileSize) (result cm.Result[TupleListU8BoolShape, cm.Tuple[cm.List[uint8], bool], ErrorCode]) { +func (self Descriptor) Read(length FileSize, offset FileSize) { self0 := cm.Reinterpret[uint32](self) length0 := (uint64)(length) offset0 := (uint64)(offset) - wasmimport_DescriptorRead((uint32)(self0), (uint64)(length0), (uint64)(offset0), &result) + wasmimport_DescriptorRead((uint32)(self0), (uint64)(length0), (uint64)(offset0)) return } // ReadDirectory represents the imported method "read-directory". // -// read-directory: func() -> result +// read-directory: func() // //go:nosplit -func (self Descriptor) ReadDirectory() (result cm.Result[DirectoryEntryStream, DirectoryEntryStream, ErrorCode]) { +func (self Descriptor) ReadDirectory() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorReadDirectory((uint32)(self0), &result) + wasmimport_DescriptorReadDirectory((uint32)(self0)) return } // ReadViaStream represents the imported method "read-via-stream". // -// read-via-stream: func(offset: filesize) -> result +// read-via-stream: func(offset: filesize) // //go:nosplit -func (self Descriptor) ReadViaStream(offset FileSize) (result cm.Result[InputStream, InputStream, ErrorCode]) { +func (self Descriptor) ReadViaStream(offset FileSize) { self0 := cm.Reinterpret[uint32](self) offset0 := (uint64)(offset) - wasmimport_DescriptorReadViaStream((uint32)(self0), (uint64)(offset0), &result) + wasmimport_DescriptorReadViaStream((uint32)(self0), (uint64)(offset0)) return } // ReadLinkAt represents the imported method "readlink-at". // -// readlink-at: func(path: string) -> result +// readlink-at: func(path: string) // //go:nosplit -func (self Descriptor) ReadLinkAt(path string) (result cm.Result[string, string, ErrorCode]) { +func (self Descriptor) ReadLinkAt(path string) { self0 := cm.Reinterpret[uint32](self) path0, path1 := cm.LowerString(path) - wasmimport_DescriptorReadLinkAt((uint32)(self0), (*uint8)(path0), (uint32)(path1), &result) + wasmimport_DescriptorReadLinkAt((uint32)(self0), (*uint8)(path0), (uint32)(path1)) return } // RemoveDirectoryAt represents the imported method "remove-directory-at". // -// remove-directory-at: func(path: string) -> result<_, error-code> +// remove-directory-at: func(path: string) // //go:nosplit -func (self Descriptor) RemoveDirectoryAt(path string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) RemoveDirectoryAt(path string) { self0 := cm.Reinterpret[uint32](self) path0, path1 := cm.LowerString(path) - wasmimport_DescriptorRemoveDirectoryAt((uint32)(self0), (*uint8)(path0), (uint32)(path1), &result) + wasmimport_DescriptorRemoveDirectoryAt((uint32)(self0), (*uint8)(path0), (uint32)(path1)) return } // RenameAt represents the imported method "rename-at". // // rename-at: func(old-path: string, new-descriptor: borrow, new-path: -// string) -> result<_, error-code> +// string) // //go:nosplit -func (self Descriptor) RenameAt(oldPath string, newDescriptor Descriptor, newPath string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) RenameAt(oldPath string, newDescriptor Descriptor, newPath string) { self0 := cm.Reinterpret[uint32](self) oldPath0, oldPath1 := cm.LowerString(oldPath) newDescriptor0 := cm.Reinterpret[uint32](newDescriptor) newPath0, newPath1 := cm.LowerString(newPath) - wasmimport_DescriptorRenameAt((uint32)(self0), (*uint8)(oldPath0), (uint32)(oldPath1), (uint32)(newDescriptor0), (*uint8)(newPath0), (uint32)(newPath1), &result) + wasmimport_DescriptorRenameAt((uint32)(self0), (*uint8)(oldPath0), (uint32)(oldPath1), (uint32)(newDescriptor0), (*uint8)(newPath0), (uint32)(newPath1)) return } // SetSize represents the imported method "set-size". // -// set-size: func(size: filesize) -> result<_, error-code> +// set-size: func(size: filesize) // //go:nosplit -func (self Descriptor) SetSize(size FileSize) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) SetSize(size FileSize) { self0 := cm.Reinterpret[uint32](self) size0 := (uint64)(size) - wasmimport_DescriptorSetSize((uint32)(self0), (uint64)(size0), &result) + wasmimport_DescriptorSetSize((uint32)(self0), (uint64)(size0)) return } // SetTimes represents the imported method "set-times". // // set-times: func(data-access-timestamp: new-timestamp, data-modification-timestamp: -// new-timestamp) -> result<_, error-code> +// new-timestamp) // //go:nosplit -func (self Descriptor) SetTimes(dataAccessTimestamp NewTimestamp, dataModificationTimestamp NewTimestamp) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) SetTimes(dataAccessTimestamp NewTimestamp, dataModificationTimestamp NewTimestamp) { self0 := cm.Reinterpret[uint32](self) dataAccessTimestamp0, dataAccessTimestamp1, dataAccessTimestamp2 := lower_NewTimestamp(dataAccessTimestamp) dataModificationTimestamp0, dataModificationTimestamp1, dataModificationTimestamp2 := lower_NewTimestamp(dataModificationTimestamp) - wasmimport_DescriptorSetTimes((uint32)(self0), (uint32)(dataAccessTimestamp0), (uint64)(dataAccessTimestamp1), (uint32)(dataAccessTimestamp2), (uint32)(dataModificationTimestamp0), (uint64)(dataModificationTimestamp1), (uint32)(dataModificationTimestamp2), &result) + wasmimport_DescriptorSetTimes((uint32)(self0), (uint32)(dataAccessTimestamp0), (uint64)(dataAccessTimestamp1), (uint32)(dataAccessTimestamp2), (uint32)(dataModificationTimestamp0), (uint64)(dataModificationTimestamp1), (uint32)(dataModificationTimestamp2)) return } // SetTimesAt represents the imported method "set-times-at". // // set-times-at: func(path-flags: path-flags, path: string, data-access-timestamp: -// new-timestamp, data-modification-timestamp: new-timestamp) -> result<_, error-code> +// new-timestamp, data-modification-timestamp: new-timestamp) // //go:nosplit -func (self Descriptor) SetTimesAt(pathFlags PathFlags, path string, dataAccessTimestamp NewTimestamp, dataModificationTimestamp NewTimestamp) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) SetTimesAt(pathFlags PathFlags, path string, dataAccessTimestamp NewTimestamp, dataModificationTimestamp NewTimestamp) { self0 := cm.Reinterpret[uint32](self) pathFlags0 := (uint32)(pathFlags) path0, path1 := cm.LowerString(path) dataAccessTimestamp0, dataAccessTimestamp1, dataAccessTimestamp2 := lower_NewTimestamp(dataAccessTimestamp) dataModificationTimestamp0, dataModificationTimestamp1, dataModificationTimestamp2 := lower_NewTimestamp(dataModificationTimestamp) - wasmimport_DescriptorSetTimesAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), (uint32)(dataAccessTimestamp0), (uint64)(dataAccessTimestamp1), (uint32)(dataAccessTimestamp2), (uint32)(dataModificationTimestamp0), (uint64)(dataModificationTimestamp1), (uint32)(dataModificationTimestamp2), &result) + wasmimport_DescriptorSetTimesAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), (uint32)(dataAccessTimestamp0), (uint64)(dataAccessTimestamp1), (uint32)(dataAccessTimestamp2), (uint32)(dataModificationTimestamp0), (uint64)(dataModificationTimestamp1), (uint32)(dataModificationTimestamp2)) return } // Stat represents the imported method "stat". // -// stat: func() -> result +// stat: func() // //go:nosplit -func (self Descriptor) Stat() (result cm.Result[DescriptorStatShape, DescriptorStat, ErrorCode]) { +func (self Descriptor) Stat() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorStat((uint32)(self0), &result) + wasmimport_DescriptorStat((uint32)(self0)) return } // StatAt represents the imported method "stat-at". // -// stat-at: func(path-flags: path-flags, path: string) -> result +// stat-at: func(path-flags: path-flags, path: string) // //go:nosplit -func (self Descriptor) StatAt(pathFlags PathFlags, path string) (result cm.Result[DescriptorStatShape, DescriptorStat, ErrorCode]) { +func (self Descriptor) StatAt(pathFlags PathFlags, path string) { self0 := cm.Reinterpret[uint32](self) pathFlags0 := (uint32)(pathFlags) path0, path1 := cm.LowerString(path) - wasmimport_DescriptorStatAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), &result) + wasmimport_DescriptorStatAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1)) return } // SymlinkAt represents the imported method "symlink-at". // -// symlink-at: func(old-path: string, new-path: string) -> result<_, error-code> +// symlink-at: func(old-path: string, new-path: string) // //go:nosplit -func (self Descriptor) SymlinkAt(oldPath string, newPath string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) SymlinkAt(oldPath string, newPath string) { self0 := cm.Reinterpret[uint32](self) oldPath0, oldPath1 := cm.LowerString(oldPath) newPath0, newPath1 := cm.LowerString(newPath) - wasmimport_DescriptorSymlinkAt((uint32)(self0), (*uint8)(oldPath0), (uint32)(oldPath1), (*uint8)(newPath0), (uint32)(newPath1), &result) + wasmimport_DescriptorSymlinkAt((uint32)(self0), (*uint8)(oldPath0), (uint32)(oldPath1), (*uint8)(newPath0), (uint32)(newPath1)) return } // Sync represents the imported method "sync". // -// sync: func() -> result<_, error-code> +// sync: func() // //go:nosplit -func (self Descriptor) Sync() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) Sync() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorSync((uint32)(self0), &result) + wasmimport_DescriptorSync((uint32)(self0)) return } // SyncData represents the imported method "sync-data". // -// sync-data: func() -> result<_, error-code> +// sync-data: func() // //go:nosplit -func (self Descriptor) SyncData() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) SyncData() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorSyncData((uint32)(self0), &result) + wasmimport_DescriptorSyncData((uint32)(self0)) return } // UnlinkFileAt represents the imported method "unlink-file-at". // -// unlink-file-at: func(path: string) -> result<_, error-code> +// unlink-file-at: func(path: string) // //go:nosplit -func (self Descriptor) UnlinkFileAt(path string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self Descriptor) UnlinkFileAt(path string) { self0 := cm.Reinterpret[uint32](self) path0, path1 := cm.LowerString(path) - wasmimport_DescriptorUnlinkFileAt((uint32)(self0), (*uint8)(path0), (uint32)(path1), &result) + wasmimport_DescriptorUnlinkFileAt((uint32)(self0), (*uint8)(path0), (uint32)(path1)) return } // Write represents the imported method "write". // -// write: func(buffer: list, offset: filesize) -> result +// write: func(buffer: list, offset: filesize) // //go:nosplit -func (self Descriptor) Write(buffer cm.List[uint8], offset FileSize) (result cm.Result[uint64, FileSize, ErrorCode]) { +func (self Descriptor) Write(buffer cm.List[uint8], offset FileSize) { self0 := cm.Reinterpret[uint32](self) buffer0, buffer1 := cm.LowerList(buffer) offset0 := (uint64)(offset) - wasmimport_DescriptorWrite((uint32)(self0), (*uint8)(buffer0), (uint32)(buffer1), (uint64)(offset0), &result) + wasmimport_DescriptorWrite((uint32)(self0), (*uint8)(buffer0), (uint32)(buffer1), (uint64)(offset0)) return } // WriteViaStream represents the imported method "write-via-stream". // -// write-via-stream: func(offset: filesize) -> result +// write-via-stream: func(offset: filesize) // //go:nosplit -func (self Descriptor) WriteViaStream(offset FileSize) (result cm.Result[OutputStream, OutputStream, ErrorCode]) { +func (self Descriptor) WriteViaStream(offset FileSize) { self0 := cm.Reinterpret[uint32](self) offset0 := (uint64)(offset) - wasmimport_DescriptorWriteViaStream((uint32)(self0), (uint64)(offset0), &result) + wasmimport_DescriptorWriteViaStream((uint32)(self0), (uint64)(offset0)) return } @@ -766,22 +762,22 @@ func (self DirectoryEntryStream) ResourceDrop() { // ReadDirectoryEntry represents the imported method "read-directory-entry". // -// read-directory-entry: func() -> result, error-code> +// read-directory-entry: func() // //go:nosplit -func (self DirectoryEntryStream) ReadDirectoryEntry() (result cm.Result[OptionDirectoryEntryShape, cm.Option[DirectoryEntry], ErrorCode]) { +func (self DirectoryEntryStream) ReadDirectoryEntry() { self0 := cm.Reinterpret[uint32](self) - wasmimport_DirectoryEntryStreamReadDirectoryEntry((uint32)(self0), &result) + wasmimport_DirectoryEntryStreamReadDirectoryEntry((uint32)(self0)) return } // FilesystemErrorCode represents the imported function "filesystem-error-code". // -// filesystem-error-code: func(err: borrow) -> option +// filesystem-error-code: func(err: borrow) // //go:nosplit -func FilesystemErrorCode(err Error) (result cm.Option[ErrorCode]) { +func FilesystemErrorCode(err Error) { err0 := cm.Reinterpret[uint32](err) - wasmimport_FilesystemErrorCode((uint32)(err0), &result) + wasmimport_FilesystemErrorCode((uint32)(err0)) return } diff --git a/examples/component/wasitel-http/gen/wasi/http/outgoing-handler/abi.go b/examples/component/wasitel-http/gen/wasi/http/outgoing-handler/abi.go index a525fe70..5c6a7b48 100755 --- a/examples/component/wasitel-http/gen/wasi/http/outgoing-handler/abi.go +++ b/examples/component/wasitel-http/gen/wasi/http/outgoing-handler/abi.go @@ -4,16 +4,8 @@ package outgoinghandler import ( "go.bytecodealliance.org/cm" - "unsafe" - "wasitel-http/gen/wasi/http/types" ) -// ErrorCodeShape is used for storage in variant or result types. -type ErrorCodeShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(types.ErrorCode{})]byte -} - func lower_OptionRequestOptions(v cm.Option[RequestOptions]) (f0 uint32, f1 uint32) { some := v.Some() if some != nil { diff --git a/examples/component/wasitel-http/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go b/examples/component/wasitel-http/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go index c86c83a2..84719593 100755 --- a/examples/component/wasitel-http/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go +++ b/examples/component/wasitel-http/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go @@ -44,13 +44,12 @@ type ErrorCode = types.ErrorCode // or not allowed to be made. Otherwise, protocol errors are reported // through the `future-incoming-response`. // -// handle: func(request: outgoing-request, options: option) -> result +// handle: func(request: outgoing-request, options: option) // //go:nosplit -func Handle(request OutgoingRequest, options cm.Option[RequestOptions]) (result cm.Result[ErrorCodeShape, FutureIncomingResponse, ErrorCode]) { +func Handle(request OutgoingRequest, options cm.Option[RequestOptions]) { request0 := cm.Reinterpret[uint32](request) options0, options1 := lower_OptionRequestOptions(options) - wasmimport_Handle((uint32)(request0), (uint32)(options0), (uint32)(options1), &result) + wasmimport_Handle((uint32)(request0), (uint32)(options0), (uint32)(options1)) return } diff --git a/examples/component/wasitel-http/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go b/examples/component/wasitel-http/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go index 6b3f3828..1f362c2a 100755 --- a/examples/component/wasitel-http/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go +++ b/examples/component/wasitel-http/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go @@ -2,12 +2,8 @@ package outgoinghandler -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:http@0.2.0". //go:wasmimport wasi:http/outgoing-handler@0.2.0 handle //go:noescape -func wasmimport_Handle(request0 uint32, options0 uint32, options1 uint32, result *cm.Result[ErrorCodeShape, FutureIncomingResponse, ErrorCode]) +func wasmimport_Handle(request0 uint32, options0 uint32, options1 uint32) diff --git a/examples/component/wasitel-http/gen/wasi/http/types/types.wasm.go b/examples/component/wasitel-http/gen/wasi/http/types/types.wasm.go index b025b2af..584e55ae 100755 --- a/examples/component/wasitel-http/gen/wasi/http/types/types.wasm.go +++ b/examples/component/wasitel-http/gen/wasi/http/types/types.wasm.go @@ -14,39 +14,39 @@ func wasmimport_FieldsResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [constructor]fields //go:noescape -func wasmimport_NewFields() (result0 uint32) +func wasmimport_NewFields() //go:wasmimport wasi:http/types@0.2.0 [static]fields.from-list //go:noescape -func wasmimport_FieldsFromList(entries0 *cm.Tuple[FieldKey, FieldValue], entries1 uint32, result *cm.Result[Fields, Fields, HeaderError]) +func wasmimport_FieldsFromList(entries0 *cm.Tuple[FieldKey, FieldValue], entries1 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]fields.append //go:noescape -func wasmimport_FieldsAppend(self0 uint32, name0 *uint8, name1 uint32, value0 *uint8, value1 uint32, result *cm.Result[HeaderError, struct{}, HeaderError]) +func wasmimport_FieldsAppend(self0 uint32, name0 *uint8, name1 uint32, value0 *uint8, value1 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]fields.clone //go:noescape -func wasmimport_FieldsClone(self0 uint32) (result0 uint32) +func wasmimport_FieldsClone(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]fields.delete //go:noescape -func wasmimport_FieldsDelete(self0 uint32, name0 *uint8, name1 uint32, result *cm.Result[HeaderError, struct{}, HeaderError]) +func wasmimport_FieldsDelete(self0 uint32, name0 *uint8, name1 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]fields.entries //go:noescape -func wasmimport_FieldsEntries(self0 uint32, result *cm.List[cm.Tuple[FieldKey, FieldValue]]) +func wasmimport_FieldsEntries(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]fields.get //go:noescape -func wasmimport_FieldsGet(self0 uint32, name0 *uint8, name1 uint32, result *cm.List[FieldValue]) +func wasmimport_FieldsGet(self0 uint32, name0 *uint8, name1 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]fields.has //go:noescape -func wasmimport_FieldsHas(self0 uint32, name0 *uint8, name1 uint32) (result0 uint32) +func wasmimport_FieldsHas(self0 uint32, name0 *uint8, name1 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]fields.set //go:noescape -func wasmimport_FieldsSet(self0 uint32, name0 *uint8, name1 uint32, value0 *FieldValue, value1 uint32, result *cm.Result[HeaderError, struct{}, HeaderError]) +func wasmimport_FieldsSet(self0 uint32, name0 *uint8, name1 uint32, value0 *FieldValue, value1 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]incoming-request //go:noescape @@ -54,27 +54,27 @@ func wasmimport_IncomingRequestResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.authority //go:noescape -func wasmimport_IncomingRequestAuthority(self0 uint32, result *cm.Option[string]) +func wasmimport_IncomingRequestAuthority(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.consume //go:noescape -func wasmimport_IncomingRequestConsume(self0 uint32, result *cm.Result[IncomingBody, IncomingBody, struct{}]) +func wasmimport_IncomingRequestConsume(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.headers //go:noescape -func wasmimport_IncomingRequestHeaders(self0 uint32) (result0 uint32) +func wasmimport_IncomingRequestHeaders(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.method //go:noescape -func wasmimport_IncomingRequestMethod(self0 uint32, result *Method) +func wasmimport_IncomingRequestMethod(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.path-with-query //go:noescape -func wasmimport_IncomingRequestPathWithQuery(self0 uint32, result *cm.Option[string]) +func wasmimport_IncomingRequestPathWithQuery(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.scheme //go:noescape -func wasmimport_IncomingRequestScheme(self0 uint32, result *cm.Option[Scheme]) +func wasmimport_IncomingRequestScheme(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]outgoing-request //go:noescape @@ -82,47 +82,47 @@ func wasmimport_OutgoingRequestResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [constructor]outgoing-request //go:noescape -func wasmimport_NewOutgoingRequest(headers0 uint32) (result0 uint32) +func wasmimport_NewOutgoingRequest(headers0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.authority //go:noescape -func wasmimport_OutgoingRequestAuthority(self0 uint32, result *cm.Option[string]) +func wasmimport_OutgoingRequestAuthority(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.body //go:noescape -func wasmimport_OutgoingRequestBody(self0 uint32, result *cm.Result[OutgoingBody, OutgoingBody, struct{}]) +func wasmimport_OutgoingRequestBody(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.headers //go:noescape -func wasmimport_OutgoingRequestHeaders(self0 uint32) (result0 uint32) +func wasmimport_OutgoingRequestHeaders(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.method //go:noescape -func wasmimport_OutgoingRequestMethod(self0 uint32, result *Method) +func wasmimport_OutgoingRequestMethod(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.path-with-query //go:noescape -func wasmimport_OutgoingRequestPathWithQuery(self0 uint32, result *cm.Option[string]) +func wasmimport_OutgoingRequestPathWithQuery(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.scheme //go:noescape -func wasmimport_OutgoingRequestScheme(self0 uint32, result *cm.Option[Scheme]) +func wasmimport_OutgoingRequestScheme(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-authority //go:noescape -func wasmimport_OutgoingRequestSetAuthority(self0 uint32, authority0 uint32, authority1 *uint8, authority2 uint32) (result0 uint32) +func wasmimport_OutgoingRequestSetAuthority(self0 uint32, authority0 uint32, authority1 *uint8, authority2 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-method //go:noescape -func wasmimport_OutgoingRequestSetMethod(self0 uint32, method0 uint32, method1 *uint8, method2 uint32) (result0 uint32) +func wasmimport_OutgoingRequestSetMethod(self0 uint32, method0 uint32, method1 *uint8, method2 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-path-with-query //go:noescape -func wasmimport_OutgoingRequestSetPathWithQuery(self0 uint32, pathWithQuery0 uint32, pathWithQuery1 *uint8, pathWithQuery2 uint32) (result0 uint32) +func wasmimport_OutgoingRequestSetPathWithQuery(self0 uint32, pathWithQuery0 uint32, pathWithQuery1 *uint8, pathWithQuery2 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-scheme //go:noescape -func wasmimport_OutgoingRequestSetScheme(self0 uint32, scheme0 uint32, scheme1 uint32, scheme2 *uint8, scheme3 uint32) (result0 uint32) +func wasmimport_OutgoingRequestSetScheme(self0 uint32, scheme0 uint32, scheme1 uint32, scheme2 *uint8, scheme3 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]request-options //go:noescape @@ -130,31 +130,31 @@ func wasmimport_RequestOptionsResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [constructor]request-options //go:noescape -func wasmimport_NewRequestOptions() (result0 uint32) +func wasmimport_NewRequestOptions() //go:wasmimport wasi:http/types@0.2.0 [method]request-options.between-bytes-timeout //go:noescape -func wasmimport_RequestOptionsBetweenBytesTimeout(self0 uint32, result *cm.Option[Duration]) +func wasmimport_RequestOptionsBetweenBytesTimeout(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]request-options.connect-timeout //go:noescape -func wasmimport_RequestOptionsConnectTimeout(self0 uint32, result *cm.Option[Duration]) +func wasmimport_RequestOptionsConnectTimeout(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]request-options.first-byte-timeout //go:noescape -func wasmimport_RequestOptionsFirstByteTimeout(self0 uint32, result *cm.Option[Duration]) +func wasmimport_RequestOptionsFirstByteTimeout(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]request-options.set-between-bytes-timeout //go:noescape -func wasmimport_RequestOptionsSetBetweenBytesTimeout(self0 uint32, duration0 uint32, duration1 uint64) (result0 uint32) +func wasmimport_RequestOptionsSetBetweenBytesTimeout(self0 uint32, duration0 uint32, duration1 uint64) //go:wasmimport wasi:http/types@0.2.0 [method]request-options.set-connect-timeout //go:noescape -func wasmimport_RequestOptionsSetConnectTimeout(self0 uint32, duration0 uint32, duration1 uint64) (result0 uint32) +func wasmimport_RequestOptionsSetConnectTimeout(self0 uint32, duration0 uint32, duration1 uint64) //go:wasmimport wasi:http/types@0.2.0 [method]request-options.set-first-byte-timeout //go:noescape -func wasmimport_RequestOptionsSetFirstByteTimeout(self0 uint32, duration0 uint32, duration1 uint64) (result0 uint32) +func wasmimport_RequestOptionsSetFirstByteTimeout(self0 uint32, duration0 uint32, duration1 uint64) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]response-outparam //go:noescape @@ -170,15 +170,15 @@ func wasmimport_IncomingResponseResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-response.consume //go:noescape -func wasmimport_IncomingResponseConsume(self0 uint32, result *cm.Result[IncomingBody, IncomingBody, struct{}]) +func wasmimport_IncomingResponseConsume(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-response.headers //go:noescape -func wasmimport_IncomingResponseHeaders(self0 uint32) (result0 uint32) +func wasmimport_IncomingResponseHeaders(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-response.status //go:noescape -func wasmimport_IncomingResponseStatus(self0 uint32) (result0 uint32) +func wasmimport_IncomingResponseStatus(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]incoming-body //go:noescape @@ -186,11 +186,11 @@ func wasmimport_IncomingBodyResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [static]incoming-body.finish //go:noescape -func wasmimport_IncomingBodyFinish(this0 uint32) (result0 uint32) +func wasmimport_IncomingBodyFinish(this0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]incoming-body.stream //go:noescape -func wasmimport_IncomingBodyStream(self0 uint32, result *cm.Result[InputStream, InputStream, struct{}]) +func wasmimport_IncomingBodyStream(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]future-trailers //go:noescape @@ -198,11 +198,11 @@ func wasmimport_FutureTrailersResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]future-trailers.get //go:noescape -func wasmimport_FutureTrailersGet(self0 uint32, result *cm.Option[cm.Result[cm.Result[ErrorCodeShape, cm.Option[Trailers], ErrorCode], cm.Result[ErrorCodeShape, cm.Option[Trailers], ErrorCode], struct{}]]) +func wasmimport_FutureTrailersGet(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]future-trailers.subscribe //go:noescape -func wasmimport_FutureTrailersSubscribe(self0 uint32) (result0 uint32) +func wasmimport_FutureTrailersSubscribe(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]outgoing-response //go:noescape @@ -210,23 +210,23 @@ func wasmimport_OutgoingResponseResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [constructor]outgoing-response //go:noescape -func wasmimport_NewOutgoingResponse(headers0 uint32) (result0 uint32) +func wasmimport_NewOutgoingResponse(headers0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.body //go:noescape -func wasmimport_OutgoingResponseBody(self0 uint32, result *cm.Result[OutgoingBody, OutgoingBody, struct{}]) +func wasmimport_OutgoingResponseBody(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.headers //go:noescape -func wasmimport_OutgoingResponseHeaders(self0 uint32) (result0 uint32) +func wasmimport_OutgoingResponseHeaders(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.set-status-code //go:noescape -func wasmimport_OutgoingResponseSetStatusCode(self0 uint32, statusCode0 uint32) (result0 uint32) +func wasmimport_OutgoingResponseSetStatusCode(self0 uint32, statusCode0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.status-code //go:noescape -func wasmimport_OutgoingResponseStatusCode(self0 uint32) (result0 uint32) +func wasmimport_OutgoingResponseStatusCode(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]outgoing-body //go:noescape @@ -234,11 +234,11 @@ func wasmimport_OutgoingBodyResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [static]outgoing-body.finish //go:noescape -func wasmimport_OutgoingBodyFinish(this0 uint32, trailers0 uint32, trailers1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_OutgoingBodyFinish(this0 uint32, trailers0 uint32, trailers1 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]outgoing-body.write //go:noescape -func wasmimport_OutgoingBodyWrite(self0 uint32, result *cm.Result[OutputStream, OutputStream, struct{}]) +func wasmimport_OutgoingBodyWrite(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [resource-drop]future-incoming-response //go:noescape @@ -246,12 +246,12 @@ func wasmimport_FutureIncomingResponseResourceDrop(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]future-incoming-response.get //go:noescape -func wasmimport_FutureIncomingResponseGet(self0 uint32, result *cm.Option[cm.Result[cm.Result[ErrorCodeShape, IncomingResponse, ErrorCode], cm.Result[ErrorCodeShape, IncomingResponse, ErrorCode], struct{}]]) +func wasmimport_FutureIncomingResponseGet(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 [method]future-incoming-response.subscribe //go:noescape -func wasmimport_FutureIncomingResponseSubscribe(self0 uint32) (result0 uint32) +func wasmimport_FutureIncomingResponseSubscribe(self0 uint32) //go:wasmimport wasi:http/types@0.2.0 http-error-code //go:noescape -func wasmimport_HTTPErrorCode(err0 uint32, result *cm.Option[ErrorCode]) +func wasmimport_HTTPErrorCode(err0 uint32) diff --git a/examples/component/wasitel-http/gen/wasi/http/types/types.wit.go b/examples/component/wasitel-http/gen/wasi/http/types/types.wit.go index a5755ff5..d89c4f61 100755 --- a/examples/component/wasitel-http/gen/wasi/http/types/types.wit.go +++ b/examples/component/wasitel-http/gen/wasi/http/types/types.wit.go @@ -886,9 +886,8 @@ func (self Fields) ResourceDrop() { // constructor() // //go:nosplit -func NewFields() (result Fields) { - result0 := wasmimport_NewFields() - result = cm.Reinterpret[Fields]((uint32)(result0)) +func NewFields() { + wasmimport_NewFields() return } @@ -910,13 +909,12 @@ func NewFields() (result Fields) { // An error result will be returned if any header or value was // syntactically invalid, or if a header was forbidden. // -// from-list: static func(entries: list>) -> result +// from-list: static func(entries: list>) // //go:nosplit -func FieldsFromList(entries cm.List[cm.Tuple[FieldKey, FieldValue]]) (result cm.Result[Fields, Fields, HeaderError]) { +func FieldsFromList(entries cm.List[cm.Tuple[FieldKey, FieldValue]]) { entries0, entries1 := cm.LowerList(entries) - wasmimport_FieldsFromList((*cm.Tuple[FieldKey, FieldValue])(entries0), (uint32)(entries1), &result) + wasmimport_FieldsFromList((*cm.Tuple[FieldKey, FieldValue])(entries0), (uint32)(entries1)) return } @@ -927,14 +925,14 @@ func FieldsFromList(entries cm.List[cm.Tuple[FieldKey, FieldValue]]) (result cm. // // Fails with `header-error.immutable` if the `fields` are immutable. // -// append: func(name: field-key, value: field-value) -> result<_, header-error> +// append: func(name: field-key, value: field-value) // //go:nosplit -func (self Fields) Append(name FieldKey, value FieldValue) (result cm.Result[HeaderError, struct{}, HeaderError]) { +func (self Fields) Append(name FieldKey, value FieldValue) { self0 := cm.Reinterpret[uint32](self) name0, name1 := cm.LowerString(name) value0, value1 := cm.LowerList(value) - wasmimport_FieldsAppend((uint32)(self0), (*uint8)(name0), (uint32)(name1), (*uint8)(value0), (uint32)(value1), &result) + wasmimport_FieldsAppend((uint32)(self0), (*uint8)(name0), (uint32)(name1), (*uint8)(value0), (uint32)(value1)) return } @@ -944,13 +942,12 @@ func (self Fields) Append(name FieldKey, value FieldValue) (result cm.Result[Hea // `fields` constructor on the return value of `entries`. The resulting // `fields` is mutable. // -// clone: func() -> fields +// clone: func() // //go:nosplit -func (self Fields) Clone() (result Fields) { +func (self Fields) Clone() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_FieldsClone((uint32)(self0)) - result = cm.Reinterpret[Fields]((uint32)(result0)) + wasmimport_FieldsClone((uint32)(self0)) return } @@ -961,13 +958,13 @@ func (self Fields) Clone() (result Fields) { // // Fails with `header-error.immutable` if the `fields` are immutable. // -// delete: func(name: field-key) -> result<_, header-error> +// delete: func(name: field-key) // //go:nosplit -func (self Fields) Delete(name FieldKey) (result cm.Result[HeaderError, struct{}, HeaderError]) { +func (self Fields) Delete(name FieldKey) { self0 := cm.Reinterpret[uint32](self) name0, name1 := cm.LowerString(name) - wasmimport_FieldsDelete((uint32)(self0), (*uint8)(name0), (uint32)(name1), &result) + wasmimport_FieldsDelete((uint32)(self0), (*uint8)(name0), (uint32)(name1)) return } @@ -980,12 +977,12 @@ func (self Fields) Delete(name FieldKey) (result cm.Result[HeaderError, struct{} // which have multiple values are represented by multiple entries in this // list with the same key. // -// entries: func() -> list> +// entries: func() // //go:nosplit -func (self Fields) Entries() (result cm.List[cm.Tuple[FieldKey, FieldValue]]) { +func (self Fields) Entries() { self0 := cm.Reinterpret[uint32](self) - wasmimport_FieldsEntries((uint32)(self0), &result) + wasmimport_FieldsEntries((uint32)(self0)) return } @@ -996,13 +993,13 @@ func (self Fields) Entries() (result cm.List[cm.Tuple[FieldKey, FieldValue]]) { // present but empty, this is represented by a list with one or more // empty field-values present. // -// get: func(name: field-key) -> list +// get: func(name: field-key) // //go:nosplit -func (self Fields) Get(name FieldKey) (result cm.List[FieldValue]) { +func (self Fields) Get(name FieldKey) { self0 := cm.Reinterpret[uint32](self) name0, name1 := cm.LowerString(name) - wasmimport_FieldsGet((uint32)(self0), (*uint8)(name0), (uint32)(name1), &result) + wasmimport_FieldsGet((uint32)(self0), (*uint8)(name0), (uint32)(name1)) return } @@ -1011,14 +1008,13 @@ func (self Fields) Get(name FieldKey) (result cm.List[FieldValue]) { // Returns `true` when the key is present in this `fields`. If the key is // syntactically invalid, `false` is returned. // -// has: func(name: field-key) -> bool +// has: func(name: field-key) // //go:nosplit -func (self Fields) Has(name FieldKey) (result bool) { +func (self Fields) Has(name FieldKey) { self0 := cm.Reinterpret[uint32](self) name0, name1 := cm.LowerString(name) - result0 := wasmimport_FieldsHas((uint32)(self0), (*uint8)(name0), (uint32)(name1)) - result = (bool)(cm.U32ToBool((uint32)(result0))) + wasmimport_FieldsHas((uint32)(self0), (*uint8)(name0), (uint32)(name1)) return } @@ -1029,14 +1025,14 @@ func (self Fields) Has(name FieldKey) (result bool) { // // Fails with `header-error.immutable` if the `fields` are immutable. // -// set: func(name: field-key, value: list) -> result<_, header-error> +// set: func(name: field-key, value: list) // //go:nosplit -func (self Fields) Set(name FieldKey, value cm.List[FieldValue]) (result cm.Result[HeaderError, struct{}, HeaderError]) { +func (self Fields) Set(name FieldKey, value cm.List[FieldValue]) { self0 := cm.Reinterpret[uint32](self) name0, name1 := cm.LowerString(name) value0, value1 := cm.LowerList(value) - wasmimport_FieldsSet((uint32)(self0), (*uint8)(name0), (uint32)(name1), (*FieldValue)(value0), (uint32)(value1), &result) + wasmimport_FieldsSet((uint32)(self0), (*uint8)(name0), (uint32)(name1), (*FieldValue)(value0), (uint32)(value1)) return } @@ -1072,12 +1068,12 @@ func (self IncomingRequest) ResourceDrop() { // // Returns the authority from the request, if it was present. // -// authority: func() -> option +// authority: func() // //go:nosplit -func (self IncomingRequest) Authority() (result cm.Option[string]) { +func (self IncomingRequest) Authority() { self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestAuthority((uint32)(self0), &result) + wasmimport_IncomingRequestAuthority((uint32)(self0)) return } @@ -1086,12 +1082,12 @@ func (self IncomingRequest) Authority() (result cm.Option[string]) { // Gives the `incoming-body` associated with this request. Will only // return success at most once, and subsequent calls will return error. // -// consume: func() -> result +// consume: func() // //go:nosplit -func (self IncomingRequest) Consume() (result cm.Result[IncomingBody, IncomingBody, struct{}]) { +func (self IncomingRequest) Consume() { self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestConsume((uint32)(self0), &result) + wasmimport_IncomingRequestConsume((uint32)(self0)) return } @@ -1106,13 +1102,12 @@ func (self IncomingRequest) Consume() (result cm.Result[IncomingBody, IncomingBo // the parent `incoming-request` is dropped. Dropping this // `incoming-request` before all children are dropped will trap. // -// headers: func() -> headers +// headers: func() // //go:nosplit -func (self IncomingRequest) Headers() (result Headers) { +func (self IncomingRequest) Headers() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_IncomingRequestHeaders((uint32)(self0)) - result = cm.Reinterpret[Headers]((uint32)(result0)) + wasmimport_IncomingRequestHeaders((uint32)(self0)) return } @@ -1120,12 +1115,12 @@ func (self IncomingRequest) Headers() (result Headers) { // // Returns the method of the incoming request. // -// method: func() -> method +// method: func() // //go:nosplit -func (self IncomingRequest) Method() (result Method) { +func (self IncomingRequest) Method() { self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestMethod((uint32)(self0), &result) + wasmimport_IncomingRequestMethod((uint32)(self0)) return } @@ -1133,12 +1128,12 @@ func (self IncomingRequest) Method() (result Method) { // // Returns the path with query parameters from the request, as a string. // -// path-with-query: func() -> option +// path-with-query: func() // //go:nosplit -func (self IncomingRequest) PathWithQuery() (result cm.Option[string]) { +func (self IncomingRequest) PathWithQuery() { self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestPathWithQuery((uint32)(self0), &result) + wasmimport_IncomingRequestPathWithQuery((uint32)(self0)) return } @@ -1146,12 +1141,12 @@ func (self IncomingRequest) PathWithQuery() (result cm.Option[string]) { // // Returns the protocol scheme from the request. // -// scheme: func() -> option +// scheme: func() // //go:nosplit -func (self IncomingRequest) Scheme() (result cm.Option[Scheme]) { +func (self IncomingRequest) Scheme() { self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestScheme((uint32)(self0), &result) + wasmimport_IncomingRequestScheme((uint32)(self0)) return } @@ -1189,10 +1184,9 @@ func (self OutgoingRequest) ResourceDrop() { // constructor(headers: headers) // //go:nosplit -func NewOutgoingRequest(headers Headers) (result OutgoingRequest) { +func NewOutgoingRequest(headers Headers) { headers0 := cm.Reinterpret[uint32](headers) - result0 := wasmimport_NewOutgoingRequest((uint32)(headers0)) - result = cm.Reinterpret[OutgoingRequest]((uint32)(result0)) + wasmimport_NewOutgoingRequest((uint32)(headers0)) return } @@ -1202,12 +1196,12 @@ func NewOutgoingRequest(headers Headers) (result OutgoingRequest) { // with Related Schemes which do not require an Authority. The HTTP and // HTTPS schemes always require an authority. // -// authority: func() -> option +// authority: func() // //go:nosplit -func (self OutgoingRequest) Authority() (result cm.Option[string]) { +func (self OutgoingRequest) Authority() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestAuthority((uint32)(self0), &result) + wasmimport_OutgoingRequestAuthority((uint32)(self0)) return } @@ -1220,12 +1214,12 @@ func (self OutgoingRequest) Authority() (result cm.Option[string]) { // this `outgoing-request` can be retrieved at most once. Subsequent // calls will return error. // -// body: func() -> result +// body: func() // //go:nosplit -func (self OutgoingRequest) Body() (result cm.Result[OutgoingBody, OutgoingBody, struct{}]) { +func (self OutgoingRequest) Body() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestBody((uint32)(self0), &result) + wasmimport_OutgoingRequestBody((uint32)(self0)) return } @@ -1240,13 +1234,12 @@ func (self OutgoingRequest) Body() (result cm.Result[OutgoingBody, OutgoingBody, // `outgoing-request` is dropped, or its ownership is transfered to // another component by e.g. `outgoing-handler.handle`. // -// headers: func() -> headers +// headers: func() // //go:nosplit -func (self OutgoingRequest) Headers() (result Headers) { +func (self OutgoingRequest) Headers() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutgoingRequestHeaders((uint32)(self0)) - result = cm.Reinterpret[Headers]((uint32)(result0)) + wasmimport_OutgoingRequestHeaders((uint32)(self0)) return } @@ -1254,12 +1247,12 @@ func (self OutgoingRequest) Headers() (result Headers) { // // Get the Method for the Request. // -// method: func() -> method +// method: func() // //go:nosplit -func (self OutgoingRequest) Method() (result Method) { +func (self OutgoingRequest) Method() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestMethod((uint32)(self0), &result) + wasmimport_OutgoingRequestMethod((uint32)(self0)) return } @@ -1268,12 +1261,12 @@ func (self OutgoingRequest) Method() (result Method) { // Get the combination of the HTTP Path and Query for the Request. // When `none`, this represents an empty Path and empty Query. // -// path-with-query: func() -> option +// path-with-query: func() // //go:nosplit -func (self OutgoingRequest) PathWithQuery() (result cm.Option[string]) { +func (self OutgoingRequest) PathWithQuery() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestPathWithQuery((uint32)(self0), &result) + wasmimport_OutgoingRequestPathWithQuery((uint32)(self0)) return } @@ -1282,12 +1275,12 @@ func (self OutgoingRequest) PathWithQuery() (result cm.Option[string]) { // Get the HTTP Related Scheme for the Request. When `none`, the // implementation may choose an appropriate default scheme. // -// scheme: func() -> option +// scheme: func() // //go:nosplit -func (self OutgoingRequest) Scheme() (result cm.Option[Scheme]) { +func (self OutgoingRequest) Scheme() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestScheme((uint32)(self0), &result) + wasmimport_OutgoingRequestScheme((uint32)(self0)) return } @@ -1298,14 +1291,13 @@ func (self OutgoingRequest) Scheme() (result cm.Option[Scheme]) { // HTTPS schemes always require an authority. Fails if the string given is // not a syntactically valid uri authority. // -// set-authority: func(authority: option) -> result +// set-authority: func(authority: option) // //go:nosplit -func (self OutgoingRequest) SetAuthority(authority cm.Option[string]) (result cm.BoolResult) { +func (self OutgoingRequest) SetAuthority(authority cm.Option[string]) { self0 := cm.Reinterpret[uint32](self) authority0, authority1, authority2 := lower_OptionString(authority) - result0 := wasmimport_OutgoingRequestSetAuthority((uint32)(self0), (uint32)(authority0), (*uint8)(authority1), (uint32)(authority2)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_OutgoingRequestSetAuthority((uint32)(self0), (uint32)(authority0), (*uint8)(authority1), (uint32)(authority2)) return } @@ -1314,14 +1306,13 @@ func (self OutgoingRequest) SetAuthority(authority cm.Option[string]) (result cm // Set the Method for the Request. Fails if the string present in a // `method.other` argument is not a syntactically valid method. // -// set-method: func(method: method) -> result +// set-method: func(method: method) // //go:nosplit -func (self OutgoingRequest) SetMethod(method Method) (result cm.BoolResult) { +func (self OutgoingRequest) SetMethod(method Method) { self0 := cm.Reinterpret[uint32](self) method0, method1, method2 := lower_Method(method) - result0 := wasmimport_OutgoingRequestSetMethod((uint32)(self0), (uint32)(method0), (*uint8)(method1), (uint32)(method2)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_OutgoingRequestSetMethod((uint32)(self0), (uint32)(method0), (*uint8)(method1), (uint32)(method2)) return } @@ -1331,14 +1322,13 @@ func (self OutgoingRequest) SetMethod(method Method) (result cm.BoolResult) { // When `none`, this represents an empty Path and empty Query. Fails is the // string given is not a syntactically valid path and query uri component. // -// set-path-with-query: func(path-with-query: option) -> result +// set-path-with-query: func(path-with-query: option) // //go:nosplit -func (self OutgoingRequest) SetPathWithQuery(pathWithQuery cm.Option[string]) (result cm.BoolResult) { +func (self OutgoingRequest) SetPathWithQuery(pathWithQuery cm.Option[string]) { self0 := cm.Reinterpret[uint32](self) pathWithQuery0, pathWithQuery1, pathWithQuery2 := lower_OptionString(pathWithQuery) - result0 := wasmimport_OutgoingRequestSetPathWithQuery((uint32)(self0), (uint32)(pathWithQuery0), (*uint8)(pathWithQuery1), (uint32)(pathWithQuery2)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_OutgoingRequestSetPathWithQuery((uint32)(self0), (uint32)(pathWithQuery0), (*uint8)(pathWithQuery1), (uint32)(pathWithQuery2)) return } @@ -1348,14 +1338,13 @@ func (self OutgoingRequest) SetPathWithQuery(pathWithQuery cm.Option[string]) (r // implementation may choose an appropriate default scheme. Fails if the // string given is not a syntactically valid uri scheme. // -// set-scheme: func(scheme: option) -> result +// set-scheme: func(scheme: option) // //go:nosplit -func (self OutgoingRequest) SetScheme(scheme cm.Option[Scheme]) (result cm.BoolResult) { +func (self OutgoingRequest) SetScheme(scheme cm.Option[Scheme]) { self0 := cm.Reinterpret[uint32](self) scheme0, scheme1, scheme2, scheme3 := lower_OptionScheme(scheme) - result0 := wasmimport_OutgoingRequestSetScheme((uint32)(self0), (uint32)(scheme0), (uint32)(scheme1), (*uint8)(scheme2), (uint32)(scheme3)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_OutgoingRequestSetScheme((uint32)(self0), (uint32)(scheme0), (uint32)(scheme1), (*uint8)(scheme2), (uint32)(scheme3)) return } @@ -1389,9 +1378,8 @@ func (self RequestOptions) ResourceDrop() { // constructor() // //go:nosplit -func NewRequestOptions() (result RequestOptions) { - result0 := wasmimport_NewRequestOptions() - result = cm.Reinterpret[RequestOptions]((uint32)(result0)) +func NewRequestOptions() { + wasmimport_NewRequestOptions() return } @@ -1400,12 +1388,12 @@ func NewRequestOptions() (result RequestOptions) { // The timeout for receiving subsequent chunks of bytes in the Response // body stream. // -// between-bytes-timeout: func() -> option +// between-bytes-timeout: func() // //go:nosplit -func (self RequestOptions) BetweenBytesTimeout() (result cm.Option[Duration]) { +func (self RequestOptions) BetweenBytesTimeout() { self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsBetweenBytesTimeout((uint32)(self0), &result) + wasmimport_RequestOptionsBetweenBytesTimeout((uint32)(self0)) return } @@ -1413,12 +1401,12 @@ func (self RequestOptions) BetweenBytesTimeout() (result cm.Option[Duration]) { // // The timeout for the initial connect to the HTTP Server. // -// connect-timeout: func() -> option +// connect-timeout: func() // //go:nosplit -func (self RequestOptions) ConnectTimeout() (result cm.Option[Duration]) { +func (self RequestOptions) ConnectTimeout() { self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsConnectTimeout((uint32)(self0), &result) + wasmimport_RequestOptionsConnectTimeout((uint32)(self0)) return } @@ -1426,12 +1414,12 @@ func (self RequestOptions) ConnectTimeout() (result cm.Option[Duration]) { // // The timeout for receiving the first byte of the Response body. // -// first-byte-timeout: func() -> option +// first-byte-timeout: func() // //go:nosplit -func (self RequestOptions) FirstByteTimeout() (result cm.Option[Duration]) { +func (self RequestOptions) FirstByteTimeout() { self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsFirstByteTimeout((uint32)(self0), &result) + wasmimport_RequestOptionsFirstByteTimeout((uint32)(self0)) return } @@ -1441,14 +1429,13 @@ func (self RequestOptions) FirstByteTimeout() (result cm.Option[Duration]) { // body stream. An error return value indicates that this timeout is not // supported. // -// set-between-bytes-timeout: func(duration: option) -> result +// set-between-bytes-timeout: func(duration: option) // //go:nosplit -func (self RequestOptions) SetBetweenBytesTimeout(duration cm.Option[Duration]) (result cm.BoolResult) { +func (self RequestOptions) SetBetweenBytesTimeout(duration cm.Option[Duration]) { self0 := cm.Reinterpret[uint32](self) duration0, duration1 := lower_OptionDuration(duration) - result0 := wasmimport_RequestOptionsSetBetweenBytesTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_RequestOptionsSetBetweenBytesTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) return } @@ -1457,14 +1444,13 @@ func (self RequestOptions) SetBetweenBytesTimeout(duration cm.Option[Duration]) // Set the timeout for the initial connect to the HTTP Server. An error // return value indicates that this timeout is not supported. // -// set-connect-timeout: func(duration: option) -> result +// set-connect-timeout: func(duration: option) // //go:nosplit -func (self RequestOptions) SetConnectTimeout(duration cm.Option[Duration]) (result cm.BoolResult) { +func (self RequestOptions) SetConnectTimeout(duration cm.Option[Duration]) { self0 := cm.Reinterpret[uint32](self) duration0, duration1 := lower_OptionDuration(duration) - result0 := wasmimport_RequestOptionsSetConnectTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_RequestOptionsSetConnectTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) return } @@ -1473,14 +1459,13 @@ func (self RequestOptions) SetConnectTimeout(duration cm.Option[Duration]) (resu // Set the timeout for receiving the first byte of the Response body. An // error return value indicates that this timeout is not supported. // -// set-first-byte-timeout: func(duration: option) -> result +// set-first-byte-timeout: func(duration: option) // //go:nosplit -func (self RequestOptions) SetFirstByteTimeout(duration cm.Option[Duration]) (result cm.BoolResult) { +func (self RequestOptions) SetFirstByteTimeout(duration cm.Option[Duration]) { self0 := cm.Reinterpret[uint32](self) duration0, duration1 := lower_OptionDuration(duration) - result0 := wasmimport_RequestOptionsSetFirstByteTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_RequestOptionsSetFirstByteTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) return } @@ -1559,12 +1544,12 @@ func (self IncomingResponse) ResourceDrop() { // Returns the incoming body. May be called at most once. Returns error // if called additional times. // -// consume: func() -> result +// consume: func() // //go:nosplit -func (self IncomingResponse) Consume() (result cm.Result[IncomingBody, IncomingBody, struct{}]) { +func (self IncomingResponse) Consume() { self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingResponseConsume((uint32)(self0), &result) + wasmimport_IncomingResponseConsume((uint32)(self0)) return } @@ -1578,13 +1563,12 @@ func (self IncomingResponse) Consume() (result cm.Result[IncomingBody, IncomingB // This headers resource is a child: it must be dropped before the parent // `incoming-response` is dropped. // -// headers: func() -> headers +// headers: func() // //go:nosplit -func (self IncomingResponse) Headers() (result Headers) { +func (self IncomingResponse) Headers() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_IncomingResponseHeaders((uint32)(self0)) - result = cm.Reinterpret[Headers]((uint32)(result0)) + wasmimport_IncomingResponseHeaders((uint32)(self0)) return } @@ -1592,13 +1576,12 @@ func (self IncomingResponse) Headers() (result Headers) { // // Returns the status code from the incoming response. // -// status: func() -> status-code +// status: func() // //go:nosplit -func (self IncomingResponse) Status() (result StatusCode) { +func (self IncomingResponse) Status() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_IncomingResponseStatus((uint32)(self0)) - result = (StatusCode)((uint32)(result0)) + wasmimport_IncomingResponseStatus((uint32)(self0)) return } @@ -1632,13 +1615,12 @@ func (self IncomingBody) ResourceDrop() { // Takes ownership of `incoming-body`, and returns a `future-trailers`. // This function will trap if the `input-stream` child is still alive. // -// finish: static func(this: incoming-body) -> future-trailers +// finish: static func(this: incoming-body) // //go:nosplit -func IncomingBodyFinish(this IncomingBody) (result FutureTrailers) { +func IncomingBodyFinish(this IncomingBody) { this0 := cm.Reinterpret[uint32](this) - result0 := wasmimport_IncomingBodyFinish((uint32)(this0)) - result = cm.Reinterpret[FutureTrailers]((uint32)(result0)) + wasmimport_IncomingBodyFinish((uint32)(this0)) return } @@ -1660,12 +1642,12 @@ func IncomingBodyFinish(this IncomingBody) (result FutureTrailers) { // and for that backpressure to not inhibit delivery of the trailers if // the user does not read the entire body. // -// %stream: func() -> result +// %stream: func() // //go:nosplit -func (self IncomingBody) Stream() (result cm.Result[InputStream, InputStream, struct{}]) { +func (self IncomingBody) Stream() { self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingBodyStream((uint32)(self0), &result) + wasmimport_IncomingBodyStream((uint32)(self0)) return } @@ -1713,12 +1695,12 @@ func (self FutureTrailers) ResourceDrop() { // `delete` methods will return an error, and the resource must be // dropped before the parent `future-trailers` is dropped. // -// get: func() -> option, error-code>>> +// get: func() // //go:nosplit -func (self FutureTrailers) Get() (result cm.Option[cm.Result[cm.Result[ErrorCodeShape, cm.Option[Trailers], ErrorCode], cm.Result[ErrorCodeShape, cm.Option[Trailers], ErrorCode], struct{}]]) { +func (self FutureTrailers) Get() { self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureTrailersGet((uint32)(self0), &result) + wasmimport_FutureTrailersGet((uint32)(self0)) return } @@ -1728,13 +1710,12 @@ func (self FutureTrailers) Get() (result cm.Option[cm.Result[cm.Result[ErrorCode // been received, or an error has occured. When this pollable is ready, // the `get` method will return `some`. // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self FutureTrailers) Subscribe() (result Pollable) { +func (self FutureTrailers) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_FutureTrailersSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_FutureTrailersSubscribe((uint32)(self0)) return } @@ -1767,10 +1748,9 @@ func (self OutgoingResponse) ResourceDrop() { // constructor(headers: headers) // //go:nosplit -func NewOutgoingResponse(headers Headers) (result OutgoingResponse) { +func NewOutgoingResponse(headers Headers) { headers0 := cm.Reinterpret[uint32](headers) - result0 := wasmimport_NewOutgoingResponse((uint32)(headers0)) - result = cm.Reinterpret[OutgoingResponse]((uint32)(result0)) + wasmimport_NewOutgoingResponse((uint32)(headers0)) return } @@ -1782,12 +1762,12 @@ func NewOutgoingResponse(headers Headers) (result OutgoingResponse) { // this `outgoing-response` can be retrieved at most once. Subsequent // calls will return error. // -// body: func() -> result +// body: func() // //go:nosplit -func (self OutgoingResponse) Body() (result cm.Result[OutgoingBody, OutgoingBody, struct{}]) { +func (self OutgoingResponse) Body() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingResponseBody((uint32)(self0), &result) + wasmimport_OutgoingResponseBody((uint32)(self0)) return } @@ -1802,13 +1782,12 @@ func (self OutgoingResponse) Body() (result cm.Result[OutgoingBody, OutgoingBody // `outgoing-request` is dropped, or its ownership is transfered to // another component by e.g. `outgoing-handler.handle`. // -// headers: func() -> headers +// headers: func() // //go:nosplit -func (self OutgoingResponse) Headers() (result Headers) { +func (self OutgoingResponse) Headers() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutgoingResponseHeaders((uint32)(self0)) - result = cm.Reinterpret[Headers]((uint32)(result0)) + wasmimport_OutgoingResponseHeaders((uint32)(self0)) return } @@ -1817,14 +1796,13 @@ func (self OutgoingResponse) Headers() (result Headers) { // Set the HTTP Status Code for the Response. Fails if the status-code // given is not a valid http status code. // -// set-status-code: func(status-code: status-code) -> result +// set-status-code: func(status-code: status-code) // //go:nosplit -func (self OutgoingResponse) SetStatusCode(statusCode StatusCode) (result cm.BoolResult) { +func (self OutgoingResponse) SetStatusCode(statusCode StatusCode) { self0 := cm.Reinterpret[uint32](self) statusCode0 := (uint32)(statusCode) - result0 := wasmimport_OutgoingResponseSetStatusCode((uint32)(self0), (uint32)(statusCode0)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) + wasmimport_OutgoingResponseSetStatusCode((uint32)(self0), (uint32)(statusCode0)) return } @@ -1832,13 +1810,12 @@ func (self OutgoingResponse) SetStatusCode(statusCode StatusCode) (result cm.Boo // // Get the HTTP Status Code for the Response. // -// status-code: func() -> status-code +// status-code: func() // //go:nosplit -func (self OutgoingResponse) StatusCode() (result StatusCode) { +func (self OutgoingResponse) StatusCode() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutgoingResponseStatusCode((uint32)(self0)) - result = (StatusCode)((uint32)(result0)) + wasmimport_OutgoingResponseStatusCode((uint32)(self0)) return } @@ -1887,14 +1864,13 @@ func (self OutgoingBody) ResourceDrop() { // to the body (via `write`) does not match the value given in the // Content-Length. // -// finish: static func(this: outgoing-body, trailers: option) -> result<_, -// error-code> +// finish: static func(this: outgoing-body, trailers: option) // //go:nosplit -func OutgoingBodyFinish(this OutgoingBody, trailers cm.Option[Trailers]) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func OutgoingBodyFinish(this OutgoingBody, trailers cm.Option[Trailers]) { this0 := cm.Reinterpret[uint32](this) trailers0, trailers1 := lower_OptionTrailers(trailers) - wasmimport_OutgoingBodyFinish((uint32)(this0), (uint32)(trailers0), (uint32)(trailers1), &result) + wasmimport_OutgoingBodyFinish((uint32)(this0), (uint32)(trailers0), (uint32)(trailers1)) return } @@ -1910,12 +1886,12 @@ func OutgoingBodyFinish(this OutgoingBody, trailers cm.Option[Trailers]) (result // this `outgoing-body` may be retrieved at most once. Subsequent calls // will return error. // -// write: func() -> result +// write: func() // //go:nosplit -func (self OutgoingBody) Write() (result cm.Result[OutputStream, OutputStream, struct{}]) { +func (self OutgoingBody) Write() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingBodyWrite((uint32)(self0), &result) + wasmimport_OutgoingBodyWrite((uint32)(self0)) return } @@ -1958,12 +1934,12 @@ func (self FutureIncomingResponse) ResourceDrop() { // but those will be reported by the `incoming-body` and its // `output-stream` child. // -// get: func() -> option>> +// get: func() // //go:nosplit -func (self FutureIncomingResponse) Get() (result cm.Option[cm.Result[cm.Result[ErrorCodeShape, IncomingResponse, ErrorCode], cm.Result[ErrorCodeShape, IncomingResponse, ErrorCode], struct{}]]) { +func (self FutureIncomingResponse) Get() { self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureIncomingResponseGet((uint32)(self0), &result) + wasmimport_FutureIncomingResponseGet((uint32)(self0)) return } @@ -1973,13 +1949,12 @@ func (self FutureIncomingResponse) Get() (result cm.Option[cm.Result[cm.Result[E // been received, or an error has occured. When this pollable is ready, // the `get` method will return `some`. // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self FutureIncomingResponse) Subscribe() (result Pollable) { +func (self FutureIncomingResponse) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_FutureIncomingResponseSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_FutureIncomingResponseSubscribe((uint32)(self0)) return } @@ -1997,11 +1972,11 @@ func (self FutureIncomingResponse) Subscribe() (result Pollable) { // Note that this function is fallible because not all io-errors are // http-related errors. // -// http-error-code: func(err: borrow) -> option +// http-error-code: func(err: borrow) // //go:nosplit -func HTTPErrorCode(err IOError) (result cm.Option[ErrorCode]) { +func HTTPErrorCode(err IOError) { err0 := cm.Reinterpret[uint32](err) - wasmimport_HTTPErrorCode((uint32)(err0), &result) + wasmimport_HTTPErrorCode((uint32)(err0)) return } diff --git a/examples/component/wasitel-http/gen/wasi/io/error/error.wit.go b/examples/component/wasitel-http/gen/wasi/io/error/error.wit.go index 828e977e..a7ebc7e4 100755 --- a/examples/component/wasitel-http/gen/wasi/io/error/error.wit.go +++ b/examples/component/wasitel-http/gen/wasi/io/error/error.wit.go @@ -25,11 +25,11 @@ func (self Error) ResourceDrop() { // ToDebugString represents the imported method "to-debug-string". // -// to-debug-string: func() -> string +// to-debug-string: func() // //go:nosplit -func (self Error) ToDebugString() (result string) { +func (self Error) ToDebugString() { self0 := cm.Reinterpret[uint32](self) - wasmimport_ErrorToDebugString((uint32)(self0), &result) + wasmimport_ErrorToDebugString((uint32)(self0)) return } diff --git a/examples/component/wasitel-http/gen/wasi/io/error/ioerror.wasm.go b/examples/component/wasitel-http/gen/wasi/io/error/ioerror.wasm.go index e254b5d8..96c77c65 100755 --- a/examples/component/wasitel-http/gen/wasi/io/error/ioerror.wasm.go +++ b/examples/component/wasitel-http/gen/wasi/io/error/ioerror.wasm.go @@ -10,4 +10,4 @@ func wasmimport_ErrorResourceDrop(self0 uint32) //go:wasmimport wasi:io/error@0.2.0 [method]error.to-debug-string //go:noescape -func wasmimport_ErrorToDebugString(self0 uint32, result *string) +func wasmimport_ErrorToDebugString(self0 uint32) diff --git a/examples/component/wasitel-http/gen/wasi/io/poll/poll.wasm.go b/examples/component/wasitel-http/gen/wasi/io/poll/poll.wasm.go index f7c55c3d..d89a9926 100755 --- a/examples/component/wasitel-http/gen/wasi/io/poll/poll.wasm.go +++ b/examples/component/wasitel-http/gen/wasi/io/poll/poll.wasm.go @@ -2,10 +2,6 @@ package poll -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". //go:wasmimport wasi:io/poll@0.2.0 [resource-drop]pollable @@ -18,8 +14,8 @@ func wasmimport_PollableBlock(self0 uint32) //go:wasmimport wasi:io/poll@0.2.0 [method]pollable.ready //go:noescape -func wasmimport_PollableReady(self0 uint32) (result0 uint32) +func wasmimport_PollableReady(self0 uint32) //go:wasmimport wasi:io/poll@0.2.0 poll //go:noescape -func wasmimport_Poll(in0 *Pollable, in1 uint32, result *cm.List[uint32]) +func wasmimport_Poll(in0 *Pollable, in1 uint32) diff --git a/examples/component/wasitel-http/gen/wasi/io/poll/poll.wit.go b/examples/component/wasitel-http/gen/wasi/io/poll/poll.wit.go index ad9e9564..4a952ecf 100755 --- a/examples/component/wasitel-http/gen/wasi/io/poll/poll.wit.go +++ b/examples/component/wasitel-http/gen/wasi/io/poll/poll.wit.go @@ -36,23 +36,22 @@ func (self Pollable) Block() { // Ready represents the imported method "ready". // -// ready: func() -> bool +// ready: func() // //go:nosplit -func (self Pollable) Ready() (result bool) { +func (self Pollable) Ready() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_PollableReady((uint32)(self0)) - result = (bool)(cm.U32ToBool((uint32)(result0))) + wasmimport_PollableReady((uint32)(self0)) return } // Poll represents the imported function "poll". // -// poll: func(in: list>) -> list +// poll: func(in: list>) // //go:nosplit -func Poll(in cm.List[Pollable]) (result cm.List[uint32]) { +func Poll(in cm.List[Pollable]) { in0, in1 := cm.LowerList(in) - wasmimport_Poll((*Pollable)(in0), (uint32)(in1), &result) + wasmimport_Poll((*Pollable)(in0), (uint32)(in1)) return } diff --git a/examples/component/wasitel-http/gen/wasi/io/streams/streams.wasm.go b/examples/component/wasitel-http/gen/wasi/io/streams/streams.wasm.go index eec56645..98543c56 100755 --- a/examples/component/wasitel-http/gen/wasi/io/streams/streams.wasm.go +++ b/examples/component/wasitel-http/gen/wasi/io/streams/streams.wasm.go @@ -2,10 +2,6 @@ package streams -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". //go:wasmimport wasi:io/streams@0.2.0 [resource-drop]input-stream @@ -14,23 +10,23 @@ func wasmimport_InputStreamResourceDrop(self0 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.blocking-read //go:noescape -func wasmimport_InputStreamBlockingRead(self0 uint32, len0 uint64, result *cm.Result[cm.List[uint8], cm.List[uint8], StreamError]) +func wasmimport_InputStreamBlockingRead(self0 uint32, len0 uint64) //go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.blocking-skip //go:noescape -func wasmimport_InputStreamBlockingSkip(self0 uint32, len0 uint64, result *cm.Result[uint64, uint64, StreamError]) +func wasmimport_InputStreamBlockingSkip(self0 uint32, len0 uint64) //go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.read //go:noescape -func wasmimport_InputStreamRead(self0 uint32, len0 uint64, result *cm.Result[cm.List[uint8], cm.List[uint8], StreamError]) +func wasmimport_InputStreamRead(self0 uint32, len0 uint64) //go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.skip //go:noescape -func wasmimport_InputStreamSkip(self0 uint32, len0 uint64, result *cm.Result[uint64, uint64, StreamError]) +func wasmimport_InputStreamSkip(self0 uint32, len0 uint64) //go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.subscribe //go:noescape -func wasmimport_InputStreamSubscribe(self0 uint32) (result0 uint32) +func wasmimport_InputStreamSubscribe(self0 uint32) //go:wasmimport wasi:io/streams@0.2.0 [resource-drop]output-stream //go:noescape @@ -38,40 +34,40 @@ func wasmimport_OutputStreamResourceDrop(self0 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-flush //go:noescape -func wasmimport_OutputStreamBlockingFlush(self0 uint32, result *cm.Result[StreamError, struct{}, StreamError]) +func wasmimport_OutputStreamBlockingFlush(self0 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-splice //go:noescape -func wasmimport_OutputStreamBlockingSplice(self0 uint32, src0 uint32, len0 uint64, result *cm.Result[uint64, uint64, StreamError]) +func wasmimport_OutputStreamBlockingSplice(self0 uint32, src0 uint32, len0 uint64) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-write-and-flush //go:noescape -func wasmimport_OutputStreamBlockingWriteAndFlush(self0 uint32, contents0 *uint8, contents1 uint32, result *cm.Result[StreamError, struct{}, StreamError]) +func wasmimport_OutputStreamBlockingWriteAndFlush(self0 uint32, contents0 *uint8, contents1 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-write-zeroes-and-flush //go:noescape -func wasmimport_OutputStreamBlockingWriteZeroesAndFlush(self0 uint32, len0 uint64, result *cm.Result[StreamError, struct{}, StreamError]) +func wasmimport_OutputStreamBlockingWriteZeroesAndFlush(self0 uint32, len0 uint64) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.check-write //go:noescape -func wasmimport_OutputStreamCheckWrite(self0 uint32, result *cm.Result[uint64, uint64, StreamError]) +func wasmimport_OutputStreamCheckWrite(self0 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.flush //go:noescape -func wasmimport_OutputStreamFlush(self0 uint32, result *cm.Result[StreamError, struct{}, StreamError]) +func wasmimport_OutputStreamFlush(self0 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.splice //go:noescape -func wasmimport_OutputStreamSplice(self0 uint32, src0 uint32, len0 uint64, result *cm.Result[uint64, uint64, StreamError]) +func wasmimport_OutputStreamSplice(self0 uint32, src0 uint32, len0 uint64) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.subscribe //go:noescape -func wasmimport_OutputStreamSubscribe(self0 uint32) (result0 uint32) +func wasmimport_OutputStreamSubscribe(self0 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.write //go:noescape -func wasmimport_OutputStreamWrite(self0 uint32, contents0 *uint8, contents1 uint32, result *cm.Result[StreamError, struct{}, StreamError]) +func wasmimport_OutputStreamWrite(self0 uint32, contents0 *uint8, contents1 uint32) //go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.write-zeroes //go:noescape -func wasmimport_OutputStreamWriteZeroes(self0 uint32, len0 uint64, result *cm.Result[StreamError, struct{}, StreamError]) +func wasmimport_OutputStreamWriteZeroes(self0 uint32, len0 uint64) diff --git a/examples/component/wasitel-http/gen/wasi/io/streams/streams.wit.go b/examples/component/wasitel-http/gen/wasi/io/streams/streams.wit.go index ee05c4e4..fa268501 100755 --- a/examples/component/wasitel-http/gen/wasi/io/streams/streams.wit.go +++ b/examples/component/wasitel-http/gen/wasi/io/streams/streams.wit.go @@ -76,61 +76,60 @@ func (self InputStream) ResourceDrop() { // BlockingRead represents the imported method "blocking-read". // -// blocking-read: func(len: u64) -> result, stream-error> +// blocking-read: func(len: u64) // //go:nosplit -func (self InputStream) BlockingRead(len_ uint64) (result cm.Result[cm.List[uint8], cm.List[uint8], StreamError]) { +func (self InputStream) BlockingRead(len_ uint64) { self0 := cm.Reinterpret[uint32](self) len0 := (uint64)(len_) - wasmimport_InputStreamBlockingRead((uint32)(self0), (uint64)(len0), &result) + wasmimport_InputStreamBlockingRead((uint32)(self0), (uint64)(len0)) return } // BlockingSkip represents the imported method "blocking-skip". // -// blocking-skip: func(len: u64) -> result +// blocking-skip: func(len: u64) // //go:nosplit -func (self InputStream) BlockingSkip(len_ uint64) (result cm.Result[uint64, uint64, StreamError]) { +func (self InputStream) BlockingSkip(len_ uint64) { self0 := cm.Reinterpret[uint32](self) len0 := (uint64)(len_) - wasmimport_InputStreamBlockingSkip((uint32)(self0), (uint64)(len0), &result) + wasmimport_InputStreamBlockingSkip((uint32)(self0), (uint64)(len0)) return } // Read represents the imported method "read". // -// read: func(len: u64) -> result, stream-error> +// read: func(len: u64) // //go:nosplit -func (self InputStream) Read(len_ uint64) (result cm.Result[cm.List[uint8], cm.List[uint8], StreamError]) { +func (self InputStream) Read(len_ uint64) { self0 := cm.Reinterpret[uint32](self) len0 := (uint64)(len_) - wasmimport_InputStreamRead((uint32)(self0), (uint64)(len0), &result) + wasmimport_InputStreamRead((uint32)(self0), (uint64)(len0)) return } // Skip represents the imported method "skip". // -// skip: func(len: u64) -> result +// skip: func(len: u64) // //go:nosplit -func (self InputStream) Skip(len_ uint64) (result cm.Result[uint64, uint64, StreamError]) { +func (self InputStream) Skip(len_ uint64) { self0 := cm.Reinterpret[uint32](self) len0 := (uint64)(len_) - wasmimport_InputStreamSkip((uint32)(self0), (uint64)(len0), &result) + wasmimport_InputStreamSkip((uint32)(self0), (uint64)(len0)) return } // Subscribe represents the imported method "subscribe". // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self InputStream) Subscribe() (result Pollable) { +func (self InputStream) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_InputStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_InputStreamSubscribe((uint32)(self0)) return } @@ -152,119 +151,118 @@ func (self OutputStream) ResourceDrop() { // BlockingFlush represents the imported method "blocking-flush". // -// blocking-flush: func() -> result<_, stream-error> +// blocking-flush: func() // //go:nosplit -func (self OutputStream) BlockingFlush() (result cm.Result[StreamError, struct{}, StreamError]) { +func (self OutputStream) BlockingFlush() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamBlockingFlush((uint32)(self0), &result) + wasmimport_OutputStreamBlockingFlush((uint32)(self0)) return } // BlockingSplice represents the imported method "blocking-splice". // -// blocking-splice: func(src: borrow, len: u64) -> result +// blocking-splice: func(src: borrow, len: u64) // //go:nosplit -func (self OutputStream) BlockingSplice(src InputStream, len_ uint64) (result cm.Result[uint64, uint64, StreamError]) { +func (self OutputStream) BlockingSplice(src InputStream, len_ uint64) { self0 := cm.Reinterpret[uint32](self) src0 := cm.Reinterpret[uint32](src) len0 := (uint64)(len_) - wasmimport_OutputStreamBlockingSplice((uint32)(self0), (uint32)(src0), (uint64)(len0), &result) + wasmimport_OutputStreamBlockingSplice((uint32)(self0), (uint32)(src0), (uint64)(len0)) return } // BlockingWriteAndFlush represents the imported method "blocking-write-and-flush". // -// blocking-write-and-flush: func(contents: list) -> result<_, stream-error> +// blocking-write-and-flush: func(contents: list) // //go:nosplit -func (self OutputStream) BlockingWriteAndFlush(contents cm.List[uint8]) (result cm.Result[StreamError, struct{}, StreamError]) { +func (self OutputStream) BlockingWriteAndFlush(contents cm.List[uint8]) { self0 := cm.Reinterpret[uint32](self) contents0, contents1 := cm.LowerList(contents) - wasmimport_OutputStreamBlockingWriteAndFlush((uint32)(self0), (*uint8)(contents0), (uint32)(contents1), &result) + wasmimport_OutputStreamBlockingWriteAndFlush((uint32)(self0), (*uint8)(contents0), (uint32)(contents1)) return } // BlockingWriteZeroesAndFlush represents the imported method "blocking-write-zeroes-and-flush". // -// blocking-write-zeroes-and-flush: func(len: u64) -> result<_, stream-error> +// blocking-write-zeroes-and-flush: func(len: u64) // //go:nosplit -func (self OutputStream) BlockingWriteZeroesAndFlush(len_ uint64) (result cm.Result[StreamError, struct{}, StreamError]) { +func (self OutputStream) BlockingWriteZeroesAndFlush(len_ uint64) { self0 := cm.Reinterpret[uint32](self) len0 := (uint64)(len_) - wasmimport_OutputStreamBlockingWriteZeroesAndFlush((uint32)(self0), (uint64)(len0), &result) + wasmimport_OutputStreamBlockingWriteZeroesAndFlush((uint32)(self0), (uint64)(len0)) return } // CheckWrite represents the imported method "check-write". // -// check-write: func() -> result +// check-write: func() // //go:nosplit -func (self OutputStream) CheckWrite() (result cm.Result[uint64, uint64, StreamError]) { +func (self OutputStream) CheckWrite() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamCheckWrite((uint32)(self0), &result) + wasmimport_OutputStreamCheckWrite((uint32)(self0)) return } // Flush represents the imported method "flush". // -// flush: func() -> result<_, stream-error> +// flush: func() // //go:nosplit -func (self OutputStream) Flush() (result cm.Result[StreamError, struct{}, StreamError]) { +func (self OutputStream) Flush() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamFlush((uint32)(self0), &result) + wasmimport_OutputStreamFlush((uint32)(self0)) return } // Splice represents the imported method "splice". // -// splice: func(src: borrow, len: u64) -> result +// splice: func(src: borrow, len: u64) // //go:nosplit -func (self OutputStream) Splice(src InputStream, len_ uint64) (result cm.Result[uint64, uint64, StreamError]) { +func (self OutputStream) Splice(src InputStream, len_ uint64) { self0 := cm.Reinterpret[uint32](self) src0 := cm.Reinterpret[uint32](src) len0 := (uint64)(len_) - wasmimport_OutputStreamSplice((uint32)(self0), (uint32)(src0), (uint64)(len0), &result) + wasmimport_OutputStreamSplice((uint32)(self0), (uint32)(src0), (uint64)(len0)) return } // Subscribe represents the imported method "subscribe". // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self OutputStream) Subscribe() (result Pollable) { +func (self OutputStream) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutputStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_OutputStreamSubscribe((uint32)(self0)) return } // Write represents the imported method "write". // -// write: func(contents: list) -> result<_, stream-error> +// write: func(contents: list) // //go:nosplit -func (self OutputStream) Write(contents cm.List[uint8]) (result cm.Result[StreamError, struct{}, StreamError]) { +func (self OutputStream) Write(contents cm.List[uint8]) { self0 := cm.Reinterpret[uint32](self) contents0, contents1 := cm.LowerList(contents) - wasmimport_OutputStreamWrite((uint32)(self0), (*uint8)(contents0), (uint32)(contents1), &result) + wasmimport_OutputStreamWrite((uint32)(self0), (*uint8)(contents0), (uint32)(contents1)) return } // WriteZeroes represents the imported method "write-zeroes". // -// write-zeroes: func(len: u64) -> result<_, stream-error> +// write-zeroes: func(len: u64) // //go:nosplit -func (self OutputStream) WriteZeroes(len_ uint64) (result cm.Result[StreamError, struct{}, StreamError]) { +func (self OutputStream) WriteZeroes(len_ uint64) { self0 := cm.Reinterpret[uint32](self) len0 := (uint64)(len_) - wasmimport_OutputStreamWriteZeroes((uint32)(self0), (uint64)(len0), &result) + wasmimport_OutputStreamWriteZeroes((uint32)(self0), (uint64)(len0)) return } diff --git a/examples/component/wasitel-http/gen/wasi/random/insecure-seed/insecure-seed.wit.go b/examples/component/wasitel-http/gen/wasi/random/insecure-seed/insecure-seed.wit.go index e701d1b4..6b9afd75 100755 --- a/examples/component/wasitel-http/gen/wasi/random/insecure-seed/insecure-seed.wit.go +++ b/examples/component/wasitel-http/gen/wasi/random/insecure-seed/insecure-seed.wit.go @@ -5,10 +5,10 @@ package insecureseed // InsecureSeed represents the imported function "insecure-seed". // -// insecure-seed: func() -> tuple +// insecure-seed: func() // //go:nosplit -func InsecureSeed() (result [2]uint64) { - wasmimport_InsecureSeed(&result) +func InsecureSeed() { + wasmimport_InsecureSeed() return } diff --git a/examples/component/wasitel-http/gen/wasi/random/insecure-seed/insecureseed.wasm.go b/examples/component/wasitel-http/gen/wasi/random/insecure-seed/insecureseed.wasm.go index e94356df..6dc19c0b 100755 --- a/examples/component/wasitel-http/gen/wasi/random/insecure-seed/insecureseed.wasm.go +++ b/examples/component/wasitel-http/gen/wasi/random/insecure-seed/insecureseed.wasm.go @@ -6,4 +6,4 @@ package insecureseed //go:wasmimport wasi:random/insecure-seed@0.2.0 insecure-seed //go:noescape -func wasmimport_InsecureSeed(result *[2]uint64) +func wasmimport_InsecureSeed() diff --git a/examples/component/wasitel-http/gen/wasi/random/insecure/insecure.wasm.go b/examples/component/wasitel-http/gen/wasi/random/insecure/insecure.wasm.go index 498bfe4a..41ffb551 100755 --- a/examples/component/wasitel-http/gen/wasi/random/insecure/insecure.wasm.go +++ b/examples/component/wasitel-http/gen/wasi/random/insecure/insecure.wasm.go @@ -2,16 +2,12 @@ package insecure -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". //go:wasmimport wasi:random/insecure@0.2.0 get-insecure-random-bytes //go:noescape -func wasmimport_GetInsecureRandomBytes(len0 uint64, result *cm.List[uint8]) +func wasmimport_GetInsecureRandomBytes(len0 uint64) //go:wasmimport wasi:random/insecure@0.2.0 get-insecure-random-u64 //go:noescape -func wasmimport_GetInsecureRandomU64() (result0 uint64) +func wasmimport_GetInsecureRandomU64() diff --git a/examples/component/wasitel-http/gen/wasi/random/insecure/insecure.wit.go b/examples/component/wasitel-http/gen/wasi/random/insecure/insecure.wit.go index f32282c6..add35465 100755 --- a/examples/component/wasitel-http/gen/wasi/random/insecure/insecure.wit.go +++ b/examples/component/wasitel-http/gen/wasi/random/insecure/insecure.wit.go @@ -3,28 +3,23 @@ // Package insecure represents the imported interface "wasi:random/insecure@0.2.0". package insecure -import ( - "go.bytecodealliance.org/cm" -) - // GetInsecureRandomBytes represents the imported function "get-insecure-random-bytes". // -// get-insecure-random-bytes: func(len: u64) -> list +// get-insecure-random-bytes: func(len: u64) // //go:nosplit -func GetInsecureRandomBytes(len_ uint64) (result cm.List[uint8]) { +func GetInsecureRandomBytes(len_ uint64) { len0 := (uint64)(len_) - wasmimport_GetInsecureRandomBytes((uint64)(len0), &result) + wasmimport_GetInsecureRandomBytes((uint64)(len0)) return } // GetInsecureRandomU64 represents the imported function "get-insecure-random-u64". // -// get-insecure-random-u64: func() -> u64 +// get-insecure-random-u64: func() // //go:nosplit -func GetInsecureRandomU64() (result uint64) { - result0 := wasmimport_GetInsecureRandomU64() - result = (uint64)((uint64)(result0)) +func GetInsecureRandomU64() { + wasmimport_GetInsecureRandomU64() return } diff --git a/examples/component/wasitel-http/gen/wasi/random/random/random.wasm.go b/examples/component/wasitel-http/gen/wasi/random/random/random.wasm.go index 9096457b..512ee826 100755 --- a/examples/component/wasitel-http/gen/wasi/random/random/random.wasm.go +++ b/examples/component/wasitel-http/gen/wasi/random/random/random.wasm.go @@ -2,16 +2,12 @@ package random -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". //go:wasmimport wasi:random/random@0.2.0 get-random-bytes //go:noescape -func wasmimport_GetRandomBytes(len0 uint64, result *cm.List[uint8]) +func wasmimport_GetRandomBytes(len0 uint64) //go:wasmimport wasi:random/random@0.2.0 get-random-u64 //go:noescape -func wasmimport_GetRandomU64() (result0 uint64) +func wasmimport_GetRandomU64() diff --git a/examples/component/wasitel-http/gen/wasi/random/random/random.wit.go b/examples/component/wasitel-http/gen/wasi/random/random/random.wit.go index 98bb7779..f11f988d 100755 --- a/examples/component/wasitel-http/gen/wasi/random/random/random.wit.go +++ b/examples/component/wasitel-http/gen/wasi/random/random/random.wit.go @@ -3,28 +3,23 @@ // Package random represents the imported interface "wasi:random/random@0.2.0". package random -import ( - "go.bytecodealliance.org/cm" -) - // GetRandomBytes represents the imported function "get-random-bytes". // -// get-random-bytes: func(len: u64) -> list +// get-random-bytes: func(len: u64) // //go:nosplit -func GetRandomBytes(len_ uint64) (result cm.List[uint8]) { +func GetRandomBytes(len_ uint64) { len0 := (uint64)(len_) - wasmimport_GetRandomBytes((uint64)(len0), &result) + wasmimport_GetRandomBytes((uint64)(len0)) return } // GetRandomU64 represents the imported function "get-random-u64". // -// get-random-u64: func() -> u64 +// get-random-u64: func() // //go:nosplit -func GetRandomU64() (result uint64) { - result0 := wasmimport_GetRandomU64() - result = (uint64)((uint64)(result0)) +func GetRandomU64() { + wasmimport_GetRandomU64() return } diff --git a/examples/component/wasitel-http/gen/wasi/sockets/instance-network/instance-network.wit.go b/examples/component/wasitel-http/gen/wasi/sockets/instance-network/instance-network.wit.go index 2ca5f7de..d793a617 100755 --- a/examples/component/wasitel-http/gen/wasi/sockets/instance-network/instance-network.wit.go +++ b/examples/component/wasitel-http/gen/wasi/sockets/instance-network/instance-network.wit.go @@ -4,7 +4,6 @@ package instancenetwork import ( - "go.bytecodealliance.org/cm" "wasitel-http/gen/wasi/sockets/network" ) @@ -15,11 +14,10 @@ type Network = network.Network // InstanceNetwork represents the imported function "instance-network". // -// instance-network: func() -> network +// instance-network: func() // //go:nosplit -func InstanceNetwork() (result Network) { - result0 := wasmimport_InstanceNetwork() - result = cm.Reinterpret[Network]((uint32)(result0)) +func InstanceNetwork() { + wasmimport_InstanceNetwork() return } diff --git a/examples/component/wasitel-http/gen/wasi/sockets/instance-network/instancenetwork.wasm.go b/examples/component/wasitel-http/gen/wasi/sockets/instance-network/instancenetwork.wasm.go index eb113e21..01fc4839 100755 --- a/examples/component/wasitel-http/gen/wasi/sockets/instance-network/instancenetwork.wasm.go +++ b/examples/component/wasitel-http/gen/wasi/sockets/instance-network/instancenetwork.wasm.go @@ -6,4 +6,4 @@ package instancenetwork //go:wasmimport wasi:sockets/instance-network@0.2.0 instance-network //go:noescape -func wasmimport_InstanceNetwork() (result0 uint32) +func wasmimport_InstanceNetwork() diff --git a/examples/component/wasitel-http/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go b/examples/component/wasitel-http/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go index 1c83fb29..e26211ff 100755 --- a/examples/component/wasitel-http/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go +++ b/examples/component/wasitel-http/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go @@ -47,36 +47,34 @@ func (self ResolveAddressStream) ResourceDrop() { // ResolveNextAddress represents the imported method "resolve-next-address". // -// resolve-next-address: func() -> result, error-code> +// resolve-next-address: func() // //go:nosplit -func (self ResolveAddressStream) ResolveNextAddress() (result cm.Result[OptionIPAddressShape, cm.Option[IPAddress], ErrorCode]) { +func (self ResolveAddressStream) ResolveNextAddress() { self0 := cm.Reinterpret[uint32](self) - wasmimport_ResolveAddressStreamResolveNextAddress((uint32)(self0), &result) + wasmimport_ResolveAddressStreamResolveNextAddress((uint32)(self0)) return } // Subscribe represents the imported method "subscribe". // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self ResolveAddressStream) Subscribe() (result Pollable) { +func (self ResolveAddressStream) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_ResolveAddressStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_ResolveAddressStreamSubscribe((uint32)(self0)) return } // ResolveAddresses represents the imported function "resolve-addresses". // -// resolve-addresses: func(network: borrow, name: string) -> result +// resolve-addresses: func(network: borrow, name: string) // //go:nosplit -func ResolveAddresses(network_ Network, name string) (result cm.Result[ResolveAddressStream, ResolveAddressStream, ErrorCode]) { +func ResolveAddresses(network_ Network, name string) { network0 := cm.Reinterpret[uint32](network_) name0, name1 := cm.LowerString(name) - wasmimport_ResolveAddresses((uint32)(network0), (*uint8)(name0), (uint32)(name1), &result) + wasmimport_ResolveAddresses((uint32)(network0), (*uint8)(name0), (uint32)(name1)) return } diff --git a/examples/component/wasitel-http/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go b/examples/component/wasitel-http/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go index da5fb000..df4d85bc 100755 --- a/examples/component/wasitel-http/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go +++ b/examples/component/wasitel-http/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go @@ -2,10 +2,6 @@ package ipnamelookup -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". //go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 [resource-drop]resolve-address-stream @@ -14,12 +10,12 @@ func wasmimport_ResolveAddressStreamResourceDrop(self0 uint32) //go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 [method]resolve-address-stream.resolve-next-address //go:noescape -func wasmimport_ResolveAddressStreamResolveNextAddress(self0 uint32, result *cm.Result[OptionIPAddressShape, cm.Option[IPAddress], ErrorCode]) +func wasmimport_ResolveAddressStreamResolveNextAddress(self0 uint32) //go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 [method]resolve-address-stream.subscribe //go:noescape -func wasmimport_ResolveAddressStreamSubscribe(self0 uint32) (result0 uint32) +func wasmimport_ResolveAddressStreamSubscribe(self0 uint32) //go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 resolve-addresses //go:noescape -func wasmimport_ResolveAddresses(network0 uint32, name0 *uint8, name1 uint32, result *cm.Result[ResolveAddressStream, ResolveAddressStream, ErrorCode]) +func wasmimport_ResolveAddresses(network0 uint32, name0 *uint8, name1 uint32) diff --git a/examples/component/wasitel-http/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go b/examples/component/wasitel-http/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go index e5339b1f..ecff3ab4 100755 --- a/examples/component/wasitel-http/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go +++ b/examples/component/wasitel-http/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go @@ -4,7 +4,6 @@ package tcpcreatesocket import ( - "go.bytecodealliance.org/cm" "wasitel-http/gen/wasi/sockets/network" "wasitel-http/gen/wasi/sockets/tcp" ) @@ -31,12 +30,11 @@ type TCPSocket = tcp.TCPSocket // CreateTCPSocket represents the imported function "create-tcp-socket". // -// create-tcp-socket: func(address-family: ip-address-family) -> result +// create-tcp-socket: func(address-family: ip-address-family) // //go:nosplit -func CreateTCPSocket(addressFamily IPAddressFamily) (result cm.Result[TCPSocket, TCPSocket, ErrorCode]) { +func CreateTCPSocket(addressFamily IPAddressFamily) { addressFamily0 := (uint32)(addressFamily) - wasmimport_CreateTCPSocket((uint32)(addressFamily0), &result) + wasmimport_CreateTCPSocket((uint32)(addressFamily0)) return } diff --git a/examples/component/wasitel-http/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go b/examples/component/wasitel-http/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go index b7b43155..48d9b113 100755 --- a/examples/component/wasitel-http/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go +++ b/examples/component/wasitel-http/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go @@ -2,12 +2,8 @@ package tcpcreatesocket -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". //go:wasmimport wasi:sockets/tcp-create-socket@0.2.0 create-tcp-socket //go:noescape -func wasmimport_CreateTCPSocket(addressFamily0 uint32, result *cm.Result[TCPSocket, TCPSocket, ErrorCode]) +func wasmimport_CreateTCPSocket(addressFamily0 uint32) diff --git a/examples/component/wasitel-http/gen/wasi/sockets/tcp/abi.go b/examples/component/wasitel-http/gen/wasi/sockets/tcp/abi.go index f355f722..3dcad5ba 100755 --- a/examples/component/wasitel-http/gen/wasi/sockets/tcp/abi.go +++ b/examples/component/wasitel-http/gen/wasi/sockets/tcp/abi.go @@ -4,28 +4,9 @@ package tcp import ( "go.bytecodealliance.org/cm" - "unsafe" "wasitel-http/gen/wasi/sockets/network" ) -// TupleTCPSocketInputStreamOutputStreamShape is used for storage in variant or result types. -type TupleTCPSocketInputStreamOutputStreamShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Tuple3[TCPSocket, InputStream, OutputStream]{})]byte -} - -// TupleInputStreamOutputStreamShape is used for storage in variant or result types. -type TupleInputStreamOutputStreamShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Tuple[InputStream, OutputStream]{})]byte -} - -// IPSocketAddressShape is used for storage in variant or result types. -type IPSocketAddressShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(network.IPSocketAddress{})]byte -} - func lower_IPv4Address(v network.IPv4Address) (f0 uint32, f1 uint32, f2 uint32, f3 uint32) { f0 = (uint32)(v[0]) f1 = (uint32)(v[1]) diff --git a/examples/component/wasitel-http/gen/wasi/sockets/tcp/tcp.wasm.go b/examples/component/wasitel-http/gen/wasi/sockets/tcp/tcp.wasm.go index 56247525..3d3553be 100755 --- a/examples/component/wasitel-http/gen/wasi/sockets/tcp/tcp.wasm.go +++ b/examples/component/wasitel-http/gen/wasi/sockets/tcp/tcp.wasm.go @@ -2,10 +2,6 @@ package tcp -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". //go:wasmimport wasi:sockets/tcp@0.2.0 [resource-drop]tcp-socket @@ -14,112 +10,112 @@ func wasmimport_TCPSocketResourceDrop(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.accept //go:noescape -func wasmimport_TCPSocketAccept(self0 uint32, result *cm.Result[TupleTCPSocketInputStreamOutputStreamShape, cm.Tuple3[TCPSocket, InputStream, OutputStream], ErrorCode]) +func wasmimport_TCPSocketAccept(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.address-family //go:noescape -func wasmimport_TCPSocketAddressFamily(self0 uint32) (result0 uint32) +func wasmimport_TCPSocketAddressFamily(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-bind //go:noescape -func wasmimport_TCPSocketFinishBind(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketFinishBind(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-connect //go:noescape -func wasmimport_TCPSocketFinishConnect(self0 uint32, result *cm.Result[TupleInputStreamOutputStreamShape, cm.Tuple[InputStream, OutputStream], ErrorCode]) +func wasmimport_TCPSocketFinishConnect(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-listen //go:noescape -func wasmimport_TCPSocketFinishListen(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketFinishListen(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.hop-limit //go:noescape -func wasmimport_TCPSocketHopLimit(self0 uint32, result *cm.Result[uint8, uint8, ErrorCode]) +func wasmimport_TCPSocketHopLimit(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.is-listening //go:noescape -func wasmimport_TCPSocketIsListening(self0 uint32) (result0 uint32) +func wasmimport_TCPSocketIsListening(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-count //go:noescape -func wasmimport_TCPSocketKeepAliveCount(self0 uint32, result *cm.Result[uint32, uint32, ErrorCode]) +func wasmimport_TCPSocketKeepAliveCount(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-enabled //go:noescape -func wasmimport_TCPSocketKeepAliveEnabled(self0 uint32, result *cm.Result[bool, bool, ErrorCode]) +func wasmimport_TCPSocketKeepAliveEnabled(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-idle-time //go:noescape -func wasmimport_TCPSocketKeepAliveIdleTime(self0 uint32, result *cm.Result[uint64, Duration, ErrorCode]) +func wasmimport_TCPSocketKeepAliveIdleTime(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-interval //go:noescape -func wasmimport_TCPSocketKeepAliveInterval(self0 uint32, result *cm.Result[uint64, Duration, ErrorCode]) +func wasmimport_TCPSocketKeepAliveInterval(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.local-address //go:noescape -func wasmimport_TCPSocketLocalAddress(self0 uint32, result *cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) +func wasmimport_TCPSocketLocalAddress(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.receive-buffer-size //go:noescape -func wasmimport_TCPSocketReceiveBufferSize(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) +func wasmimport_TCPSocketReceiveBufferSize(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.remote-address //go:noescape -func wasmimport_TCPSocketRemoteAddress(self0 uint32, result *cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) +func wasmimport_TCPSocketRemoteAddress(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.send-buffer-size //go:noescape -func wasmimport_TCPSocketSendBufferSize(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) +func wasmimport_TCPSocketSendBufferSize(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-hop-limit //go:noescape -func wasmimport_TCPSocketSetHopLimit(self0 uint32, value0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetHopLimit(self0 uint32, value0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-count //go:noescape -func wasmimport_TCPSocketSetKeepAliveCount(self0 uint32, value0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetKeepAliveCount(self0 uint32, value0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-enabled //go:noescape -func wasmimport_TCPSocketSetKeepAliveEnabled(self0 uint32, value0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetKeepAliveEnabled(self0 uint32, value0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-idle-time //go:noescape -func wasmimport_TCPSocketSetKeepAliveIdleTime(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetKeepAliveIdleTime(self0 uint32, value0 uint64) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-interval //go:noescape -func wasmimport_TCPSocketSetKeepAliveInterval(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetKeepAliveInterval(self0 uint32, value0 uint64) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-listen-backlog-size //go:noescape -func wasmimport_TCPSocketSetListenBacklogSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetListenBacklogSize(self0 uint32, value0 uint64) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-receive-buffer-size //go:noescape -func wasmimport_TCPSocketSetReceiveBufferSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetReceiveBufferSize(self0 uint32, value0 uint64) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-send-buffer-size //go:noescape -func wasmimport_TCPSocketSetSendBufferSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketSetSendBufferSize(self0 uint32, value0 uint64) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.shutdown //go:noescape -func wasmimport_TCPSocketShutdown(self0 uint32, shutdownType0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketShutdown(self0 uint32, shutdownType0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-bind //go:noescape -func wasmimport_TCPSocketStartBind(self0 uint32, network0 uint32, localAddress0 uint32, localAddress1 uint32, localAddress2 uint32, localAddress3 uint32, localAddress4 uint32, localAddress5 uint32, localAddress6 uint32, localAddress7 uint32, localAddress8 uint32, localAddress9 uint32, localAddress10 uint32, localAddress11 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketStartBind(self0 uint32, network0 uint32, localAddress0 uint32, localAddress1 uint32, localAddress2 uint32, localAddress3 uint32, localAddress4 uint32, localAddress5 uint32, localAddress6 uint32, localAddress7 uint32, localAddress8 uint32, localAddress9 uint32, localAddress10 uint32, localAddress11 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-connect //go:noescape -func wasmimport_TCPSocketStartConnect(self0 uint32, network0 uint32, remoteAddress0 uint32, remoteAddress1 uint32, remoteAddress2 uint32, remoteAddress3 uint32, remoteAddress4 uint32, remoteAddress5 uint32, remoteAddress6 uint32, remoteAddress7 uint32, remoteAddress8 uint32, remoteAddress9 uint32, remoteAddress10 uint32, remoteAddress11 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketStartConnect(self0 uint32, network0 uint32, remoteAddress0 uint32, remoteAddress1 uint32, remoteAddress2 uint32, remoteAddress3 uint32, remoteAddress4 uint32, remoteAddress5 uint32, remoteAddress6 uint32, remoteAddress7 uint32, remoteAddress8 uint32, remoteAddress9 uint32, remoteAddress10 uint32, remoteAddress11 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-listen //go:noescape -func wasmimport_TCPSocketStartListen(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_TCPSocketStartListen(self0 uint32) //go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.subscribe //go:noescape -func wasmimport_TCPSocketSubscribe(self0 uint32) (result0 uint32) +func wasmimport_TCPSocketSubscribe(self0 uint32) diff --git a/examples/component/wasitel-http/gen/wasi/sockets/tcp/tcp.wit.go b/examples/component/wasitel-http/gen/wasi/sockets/tcp/tcp.wit.go index ad930cda..13f905fe 100755 --- a/examples/component/wasitel-http/gen/wasi/sockets/tcp/tcp.wit.go +++ b/examples/component/wasitel-http/gen/wasi/sockets/tcp/tcp.wit.go @@ -95,326 +95,321 @@ func (self TCPSocket) ResourceDrop() { // Accept represents the imported method "accept". // -// accept: func() -> result, error-code> +// accept: func() // //go:nosplit -func (self TCPSocket) Accept() (result cm.Result[TupleTCPSocketInputStreamOutputStreamShape, cm.Tuple3[TCPSocket, InputStream, OutputStream], ErrorCode]) { +func (self TCPSocket) Accept() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketAccept((uint32)(self0), &result) + wasmimport_TCPSocketAccept((uint32)(self0)) return } // AddressFamily represents the imported method "address-family". // -// address-family: func() -> ip-address-family +// address-family: func() // //go:nosplit -func (self TCPSocket) AddressFamily() (result IPAddressFamily) { +func (self TCPSocket) AddressFamily() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_TCPSocketAddressFamily((uint32)(self0)) - result = (network.IPAddressFamily)((uint32)(result0)) + wasmimport_TCPSocketAddressFamily((uint32)(self0)) return } // FinishBind represents the imported method "finish-bind". // -// finish-bind: func() -> result<_, error-code> +// finish-bind: func() // //go:nosplit -func (self TCPSocket) FinishBind() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) FinishBind() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketFinishBind((uint32)(self0), &result) + wasmimport_TCPSocketFinishBind((uint32)(self0)) return } // FinishConnect represents the imported method "finish-connect". // -// finish-connect: func() -> result, error-code> +// finish-connect: func() // //go:nosplit -func (self TCPSocket) FinishConnect() (result cm.Result[TupleInputStreamOutputStreamShape, cm.Tuple[InputStream, OutputStream], ErrorCode]) { +func (self TCPSocket) FinishConnect() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketFinishConnect((uint32)(self0), &result) + wasmimport_TCPSocketFinishConnect((uint32)(self0)) return } // FinishListen represents the imported method "finish-listen". // -// finish-listen: func() -> result<_, error-code> +// finish-listen: func() // //go:nosplit -func (self TCPSocket) FinishListen() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) FinishListen() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketFinishListen((uint32)(self0), &result) + wasmimport_TCPSocketFinishListen((uint32)(self0)) return } // HopLimit represents the imported method "hop-limit". // -// hop-limit: func() -> result +// hop-limit: func() // //go:nosplit -func (self TCPSocket) HopLimit() (result cm.Result[uint8, uint8, ErrorCode]) { +func (self TCPSocket) HopLimit() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketHopLimit((uint32)(self0), &result) + wasmimport_TCPSocketHopLimit((uint32)(self0)) return } // IsListening represents the imported method "is-listening". // -// is-listening: func() -> bool +// is-listening: func() // //go:nosplit -func (self TCPSocket) IsListening() (result bool) { +func (self TCPSocket) IsListening() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_TCPSocketIsListening((uint32)(self0)) - result = (bool)(cm.U32ToBool((uint32)(result0))) + wasmimport_TCPSocketIsListening((uint32)(self0)) return } // KeepAliveCount represents the imported method "keep-alive-count". // -// keep-alive-count: func() -> result +// keep-alive-count: func() // //go:nosplit -func (self TCPSocket) KeepAliveCount() (result cm.Result[uint32, uint32, ErrorCode]) { +func (self TCPSocket) KeepAliveCount() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveCount((uint32)(self0), &result) + wasmimport_TCPSocketKeepAliveCount((uint32)(self0)) return } // KeepAliveEnabled represents the imported method "keep-alive-enabled". // -// keep-alive-enabled: func() -> result +// keep-alive-enabled: func() // //go:nosplit -func (self TCPSocket) KeepAliveEnabled() (result cm.Result[bool, bool, ErrorCode]) { +func (self TCPSocket) KeepAliveEnabled() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveEnabled((uint32)(self0), &result) + wasmimport_TCPSocketKeepAliveEnabled((uint32)(self0)) return } // KeepAliveIdleTime represents the imported method "keep-alive-idle-time". // -// keep-alive-idle-time: func() -> result +// keep-alive-idle-time: func() // //go:nosplit -func (self TCPSocket) KeepAliveIdleTime() (result cm.Result[uint64, Duration, ErrorCode]) { +func (self TCPSocket) KeepAliveIdleTime() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveIdleTime((uint32)(self0), &result) + wasmimport_TCPSocketKeepAliveIdleTime((uint32)(self0)) return } // KeepAliveInterval represents the imported method "keep-alive-interval". // -// keep-alive-interval: func() -> result +// keep-alive-interval: func() // //go:nosplit -func (self TCPSocket) KeepAliveInterval() (result cm.Result[uint64, Duration, ErrorCode]) { +func (self TCPSocket) KeepAliveInterval() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveInterval((uint32)(self0), &result) + wasmimport_TCPSocketKeepAliveInterval((uint32)(self0)) return } // LocalAddress represents the imported method "local-address". // -// local-address: func() -> result +// local-address: func() // //go:nosplit -func (self TCPSocket) LocalAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) { +func (self TCPSocket) LocalAddress() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketLocalAddress((uint32)(self0), &result) + wasmimport_TCPSocketLocalAddress((uint32)(self0)) return } // ReceiveBufferSize represents the imported method "receive-buffer-size". // -// receive-buffer-size: func() -> result +// receive-buffer-size: func() // //go:nosplit -func (self TCPSocket) ReceiveBufferSize() (result cm.Result[uint64, uint64, ErrorCode]) { +func (self TCPSocket) ReceiveBufferSize() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketReceiveBufferSize((uint32)(self0), &result) + wasmimport_TCPSocketReceiveBufferSize((uint32)(self0)) return } // RemoteAddress represents the imported method "remote-address". // -// remote-address: func() -> result +// remote-address: func() // //go:nosplit -func (self TCPSocket) RemoteAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) { +func (self TCPSocket) RemoteAddress() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketRemoteAddress((uint32)(self0), &result) + wasmimport_TCPSocketRemoteAddress((uint32)(self0)) return } // SendBufferSize represents the imported method "send-buffer-size". // -// send-buffer-size: func() -> result +// send-buffer-size: func() // //go:nosplit -func (self TCPSocket) SendBufferSize() (result cm.Result[uint64, uint64, ErrorCode]) { +func (self TCPSocket) SendBufferSize() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketSendBufferSize((uint32)(self0), &result) + wasmimport_TCPSocketSendBufferSize((uint32)(self0)) return } // SetHopLimit represents the imported method "set-hop-limit". // -// set-hop-limit: func(value: u8) -> result<_, error-code> +// set-hop-limit: func(value: u8) // //go:nosplit -func (self TCPSocket) SetHopLimit(value uint8) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetHopLimit(value uint8) { self0 := cm.Reinterpret[uint32](self) value0 := (uint32)(value) - wasmimport_TCPSocketSetHopLimit((uint32)(self0), (uint32)(value0), &result) + wasmimport_TCPSocketSetHopLimit((uint32)(self0), (uint32)(value0)) return } // SetKeepAliveCount represents the imported method "set-keep-alive-count". // -// set-keep-alive-count: func(value: u32) -> result<_, error-code> +// set-keep-alive-count: func(value: u32) // //go:nosplit -func (self TCPSocket) SetKeepAliveCount(value uint32) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetKeepAliveCount(value uint32) { self0 := cm.Reinterpret[uint32](self) value0 := (uint32)(value) - wasmimport_TCPSocketSetKeepAliveCount((uint32)(self0), (uint32)(value0), &result) + wasmimport_TCPSocketSetKeepAliveCount((uint32)(self0), (uint32)(value0)) return } // SetKeepAliveEnabled represents the imported method "set-keep-alive-enabled". // -// set-keep-alive-enabled: func(value: bool) -> result<_, error-code> +// set-keep-alive-enabled: func(value: bool) // //go:nosplit -func (self TCPSocket) SetKeepAliveEnabled(value bool) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetKeepAliveEnabled(value bool) { self0 := cm.Reinterpret[uint32](self) value0 := (uint32)(cm.BoolToU32(value)) - wasmimport_TCPSocketSetKeepAliveEnabled((uint32)(self0), (uint32)(value0), &result) + wasmimport_TCPSocketSetKeepAliveEnabled((uint32)(self0), (uint32)(value0)) return } // SetKeepAliveIdleTime represents the imported method "set-keep-alive-idle-time". // -// set-keep-alive-idle-time: func(value: duration) -> result<_, error-code> +// set-keep-alive-idle-time: func(value: duration) // //go:nosplit -func (self TCPSocket) SetKeepAliveIdleTime(value Duration) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetKeepAliveIdleTime(value Duration) { self0 := cm.Reinterpret[uint32](self) value0 := (uint64)(value) - wasmimport_TCPSocketSetKeepAliveIdleTime((uint32)(self0), (uint64)(value0), &result) + wasmimport_TCPSocketSetKeepAliveIdleTime((uint32)(self0), (uint64)(value0)) return } // SetKeepAliveInterval represents the imported method "set-keep-alive-interval". // -// set-keep-alive-interval: func(value: duration) -> result<_, error-code> +// set-keep-alive-interval: func(value: duration) // //go:nosplit -func (self TCPSocket) SetKeepAliveInterval(value Duration) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetKeepAliveInterval(value Duration) { self0 := cm.Reinterpret[uint32](self) value0 := (uint64)(value) - wasmimport_TCPSocketSetKeepAliveInterval((uint32)(self0), (uint64)(value0), &result) + wasmimport_TCPSocketSetKeepAliveInterval((uint32)(self0), (uint64)(value0)) return } // SetListenBacklogSize represents the imported method "set-listen-backlog-size". // -// set-listen-backlog-size: func(value: u64) -> result<_, error-code> +// set-listen-backlog-size: func(value: u64) // //go:nosplit -func (self TCPSocket) SetListenBacklogSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetListenBacklogSize(value uint64) { self0 := cm.Reinterpret[uint32](self) value0 := (uint64)(value) - wasmimport_TCPSocketSetListenBacklogSize((uint32)(self0), (uint64)(value0), &result) + wasmimport_TCPSocketSetListenBacklogSize((uint32)(self0), (uint64)(value0)) return } // SetReceiveBufferSize represents the imported method "set-receive-buffer-size". // -// set-receive-buffer-size: func(value: u64) -> result<_, error-code> +// set-receive-buffer-size: func(value: u64) // //go:nosplit -func (self TCPSocket) SetReceiveBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetReceiveBufferSize(value uint64) { self0 := cm.Reinterpret[uint32](self) value0 := (uint64)(value) - wasmimport_TCPSocketSetReceiveBufferSize((uint32)(self0), (uint64)(value0), &result) + wasmimport_TCPSocketSetReceiveBufferSize((uint32)(self0), (uint64)(value0)) return } // SetSendBufferSize represents the imported method "set-send-buffer-size". // -// set-send-buffer-size: func(value: u64) -> result<_, error-code> +// set-send-buffer-size: func(value: u64) // //go:nosplit -func (self TCPSocket) SetSendBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) SetSendBufferSize(value uint64) { self0 := cm.Reinterpret[uint32](self) value0 := (uint64)(value) - wasmimport_TCPSocketSetSendBufferSize((uint32)(self0), (uint64)(value0), &result) + wasmimport_TCPSocketSetSendBufferSize((uint32)(self0), (uint64)(value0)) return } // Shutdown represents the imported method "shutdown". // -// shutdown: func(shutdown-type: shutdown-type) -> result<_, error-code> +// shutdown: func(shutdown-type: shutdown-type) // //go:nosplit -func (self TCPSocket) Shutdown(shutdownType ShutdownType) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) Shutdown(shutdownType ShutdownType) { self0 := cm.Reinterpret[uint32](self) shutdownType0 := (uint32)(shutdownType) - wasmimport_TCPSocketShutdown((uint32)(self0), (uint32)(shutdownType0), &result) + wasmimport_TCPSocketShutdown((uint32)(self0), (uint32)(shutdownType0)) return } // StartBind represents the imported method "start-bind". // -// start-bind: func(network: borrow, local-address: ip-socket-address) -> -// result<_, error-code> +// start-bind: func(network: borrow, local-address: ip-socket-address) // //go:nosplit -func (self TCPSocket) StartBind(network_ Network, localAddress IPSocketAddress) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) StartBind(network_ Network, localAddress IPSocketAddress) { self0 := cm.Reinterpret[uint32](self) network0 := cm.Reinterpret[uint32](network_) localAddress0, localAddress1, localAddress2, localAddress3, localAddress4, localAddress5, localAddress6, localAddress7, localAddress8, localAddress9, localAddress10, localAddress11 := lower_IPSocketAddress(localAddress) - wasmimport_TCPSocketStartBind((uint32)(self0), (uint32)(network0), (uint32)(localAddress0), (uint32)(localAddress1), (uint32)(localAddress2), (uint32)(localAddress3), (uint32)(localAddress4), (uint32)(localAddress5), (uint32)(localAddress6), (uint32)(localAddress7), (uint32)(localAddress8), (uint32)(localAddress9), (uint32)(localAddress10), (uint32)(localAddress11), &result) + wasmimport_TCPSocketStartBind((uint32)(self0), (uint32)(network0), (uint32)(localAddress0), (uint32)(localAddress1), (uint32)(localAddress2), (uint32)(localAddress3), (uint32)(localAddress4), (uint32)(localAddress5), (uint32)(localAddress6), (uint32)(localAddress7), (uint32)(localAddress8), (uint32)(localAddress9), (uint32)(localAddress10), (uint32)(localAddress11)) return } // StartConnect represents the imported method "start-connect". // // start-connect: func(network: borrow, remote-address: ip-socket-address) -// -> result<_, error-code> // //go:nosplit -func (self TCPSocket) StartConnect(network_ Network, remoteAddress IPSocketAddress) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) StartConnect(network_ Network, remoteAddress IPSocketAddress) { self0 := cm.Reinterpret[uint32](self) network0 := cm.Reinterpret[uint32](network_) remoteAddress0, remoteAddress1, remoteAddress2, remoteAddress3, remoteAddress4, remoteAddress5, remoteAddress6, remoteAddress7, remoteAddress8, remoteAddress9, remoteAddress10, remoteAddress11 := lower_IPSocketAddress(remoteAddress) - wasmimport_TCPSocketStartConnect((uint32)(self0), (uint32)(network0), (uint32)(remoteAddress0), (uint32)(remoteAddress1), (uint32)(remoteAddress2), (uint32)(remoteAddress3), (uint32)(remoteAddress4), (uint32)(remoteAddress5), (uint32)(remoteAddress6), (uint32)(remoteAddress7), (uint32)(remoteAddress8), (uint32)(remoteAddress9), (uint32)(remoteAddress10), (uint32)(remoteAddress11), &result) + wasmimport_TCPSocketStartConnect((uint32)(self0), (uint32)(network0), (uint32)(remoteAddress0), (uint32)(remoteAddress1), (uint32)(remoteAddress2), (uint32)(remoteAddress3), (uint32)(remoteAddress4), (uint32)(remoteAddress5), (uint32)(remoteAddress6), (uint32)(remoteAddress7), (uint32)(remoteAddress8), (uint32)(remoteAddress9), (uint32)(remoteAddress10), (uint32)(remoteAddress11)) return } // StartListen represents the imported method "start-listen". // -// start-listen: func() -> result<_, error-code> +// start-listen: func() // //go:nosplit -func (self TCPSocket) StartListen() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self TCPSocket) StartListen() { self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketStartListen((uint32)(self0), &result) + wasmimport_TCPSocketStartListen((uint32)(self0)) return } // Subscribe represents the imported method "subscribe". // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self TCPSocket) Subscribe() (result Pollable) { +func (self TCPSocket) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_TCPSocketSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_TCPSocketSubscribe((uint32)(self0)) return } diff --git a/examples/component/wasitel-http/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go b/examples/component/wasitel-http/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go index 999b2c42..d2e22132 100755 --- a/examples/component/wasitel-http/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go +++ b/examples/component/wasitel-http/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go @@ -4,7 +4,6 @@ package udpcreatesocket import ( - "go.bytecodealliance.org/cm" "wasitel-http/gen/wasi/sockets/network" "wasitel-http/gen/wasi/sockets/udp" ) @@ -31,12 +30,11 @@ type UDPSocket = udp.UDPSocket // CreateUDPSocket represents the imported function "create-udp-socket". // -// create-udp-socket: func(address-family: ip-address-family) -> result +// create-udp-socket: func(address-family: ip-address-family) // //go:nosplit -func CreateUDPSocket(addressFamily IPAddressFamily) (result cm.Result[UDPSocket, UDPSocket, ErrorCode]) { +func CreateUDPSocket(addressFamily IPAddressFamily) { addressFamily0 := (uint32)(addressFamily) - wasmimport_CreateUDPSocket((uint32)(addressFamily0), &result) + wasmimport_CreateUDPSocket((uint32)(addressFamily0)) return } diff --git a/examples/component/wasitel-http/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go b/examples/component/wasitel-http/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go index 94b1ab67..dfe49e18 100755 --- a/examples/component/wasitel-http/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go +++ b/examples/component/wasitel-http/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go @@ -2,12 +2,8 @@ package udpcreatesocket -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". //go:wasmimport wasi:sockets/udp-create-socket@0.2.0 create-udp-socket //go:noescape -func wasmimport_CreateUDPSocket(addressFamily0 uint32, result *cm.Result[UDPSocket, UDPSocket, ErrorCode]) +func wasmimport_CreateUDPSocket(addressFamily0 uint32) diff --git a/examples/component/wasitel-http/gen/wasi/sockets/udp/abi.go b/examples/component/wasitel-http/gen/wasi/sockets/udp/abi.go index 64da87ce..ca84b458 100755 --- a/examples/component/wasitel-http/gen/wasi/sockets/udp/abi.go +++ b/examples/component/wasitel-http/gen/wasi/sockets/udp/abi.go @@ -4,16 +4,9 @@ package udp import ( "go.bytecodealliance.org/cm" - "unsafe" "wasitel-http/gen/wasi/sockets/network" ) -// IPSocketAddressShape is used for storage in variant or result types. -type IPSocketAddressShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(network.IPSocketAddress{})]byte -} - func lower_IPv4Address(v network.IPv4Address) (f0 uint32, f1 uint32, f2 uint32, f3 uint32) { f0 = (uint32)(v[0]) f1 = (uint32)(v[1]) @@ -75,12 +68,6 @@ func lower_IPSocketAddress(v network.IPSocketAddress) (f0 uint32, f1 uint32, f2 return } -// TupleIncomingDatagramStreamOutgoingDatagramStreamShape is used for storage in variant or result types. -type TupleIncomingDatagramStreamOutgoingDatagramStreamShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Tuple[IncomingDatagramStream, OutgoingDatagramStream]{})]byte -} - func lower_OptionIPSocketAddress(v cm.Option[IPSocketAddress]) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32, f11 uint32, f12 uint32) { some := v.Some() if some != nil { diff --git a/examples/component/wasitel-http/gen/wasi/sockets/udp/udp.wasm.go b/examples/component/wasitel-http/gen/wasi/sockets/udp/udp.wasm.go index 83ce8ca7..0b0fd6ba 100755 --- a/examples/component/wasitel-http/gen/wasi/sockets/udp/udp.wasm.go +++ b/examples/component/wasitel-http/gen/wasi/sockets/udp/udp.wasm.go @@ -2,10 +2,6 @@ package udp -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". //go:wasmimport wasi:sockets/udp@0.2.0 [resource-drop]udp-socket @@ -14,55 +10,55 @@ func wasmimport_UDPSocketResourceDrop(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.address-family //go:noescape -func wasmimport_UDPSocketAddressFamily(self0 uint32) (result0 uint32) +func wasmimport_UDPSocketAddressFamily(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.finish-bind //go:noescape -func wasmimport_UDPSocketFinishBind(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_UDPSocketFinishBind(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.local-address //go:noescape -func wasmimport_UDPSocketLocalAddress(self0 uint32, result *cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) +func wasmimport_UDPSocketLocalAddress(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.receive-buffer-size //go:noescape -func wasmimport_UDPSocketReceiveBufferSize(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) +func wasmimport_UDPSocketReceiveBufferSize(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.remote-address //go:noescape -func wasmimport_UDPSocketRemoteAddress(self0 uint32, result *cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) +func wasmimport_UDPSocketRemoteAddress(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.send-buffer-size //go:noescape -func wasmimport_UDPSocketSendBufferSize(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) +func wasmimport_UDPSocketSendBufferSize(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.set-receive-buffer-size //go:noescape -func wasmimport_UDPSocketSetReceiveBufferSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_UDPSocketSetReceiveBufferSize(self0 uint32, value0 uint64) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.set-send-buffer-size //go:noescape -func wasmimport_UDPSocketSetSendBufferSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_UDPSocketSetSendBufferSize(self0 uint32, value0 uint64) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.set-unicast-hop-limit //go:noescape -func wasmimport_UDPSocketSetUnicastHopLimit(self0 uint32, value0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_UDPSocketSetUnicastHopLimit(self0 uint32, value0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.start-bind //go:noescape -func wasmimport_UDPSocketStartBind(self0 uint32, network0 uint32, localAddress0 uint32, localAddress1 uint32, localAddress2 uint32, localAddress3 uint32, localAddress4 uint32, localAddress5 uint32, localAddress6 uint32, localAddress7 uint32, localAddress8 uint32, localAddress9 uint32, localAddress10 uint32, localAddress11 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) +func wasmimport_UDPSocketStartBind(self0 uint32, network0 uint32, localAddress0 uint32, localAddress1 uint32, localAddress2 uint32, localAddress3 uint32, localAddress4 uint32, localAddress5 uint32, localAddress6 uint32, localAddress7 uint32, localAddress8 uint32, localAddress9 uint32, localAddress10 uint32, localAddress11 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.stream //go:noescape -func wasmimport_UDPSocketStream(self0 uint32, remoteAddress0 uint32, remoteAddress1 uint32, remoteAddress2 uint32, remoteAddress3 uint32, remoteAddress4 uint32, remoteAddress5 uint32, remoteAddress6 uint32, remoteAddress7 uint32, remoteAddress8 uint32, remoteAddress9 uint32, remoteAddress10 uint32, remoteAddress11 uint32, remoteAddress12 uint32, result *cm.Result[TupleIncomingDatagramStreamOutgoingDatagramStreamShape, cm.Tuple[IncomingDatagramStream, OutgoingDatagramStream], ErrorCode]) +func wasmimport_UDPSocketStream(self0 uint32, remoteAddress0 uint32, remoteAddress1 uint32, remoteAddress2 uint32, remoteAddress3 uint32, remoteAddress4 uint32, remoteAddress5 uint32, remoteAddress6 uint32, remoteAddress7 uint32, remoteAddress8 uint32, remoteAddress9 uint32, remoteAddress10 uint32, remoteAddress11 uint32, remoteAddress12 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.subscribe //go:noescape -func wasmimport_UDPSocketSubscribe(self0 uint32) (result0 uint32) +func wasmimport_UDPSocketSubscribe(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.unicast-hop-limit //go:noescape -func wasmimport_UDPSocketUnicastHopLimit(self0 uint32, result *cm.Result[uint8, uint8, ErrorCode]) +func wasmimport_UDPSocketUnicastHopLimit(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [resource-drop]incoming-datagram-stream //go:noescape @@ -70,11 +66,11 @@ func wasmimport_IncomingDatagramStreamResourceDrop(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]incoming-datagram-stream.receive //go:noescape -func wasmimport_IncomingDatagramStreamReceive(self0 uint32, maxResults0 uint64, result *cm.Result[cm.List[IncomingDatagram], cm.List[IncomingDatagram], ErrorCode]) +func wasmimport_IncomingDatagramStreamReceive(self0 uint32, maxResults0 uint64) //go:wasmimport wasi:sockets/udp@0.2.0 [method]incoming-datagram-stream.subscribe //go:noescape -func wasmimport_IncomingDatagramStreamSubscribe(self0 uint32) (result0 uint32) +func wasmimport_IncomingDatagramStreamSubscribe(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [resource-drop]outgoing-datagram-stream //go:noescape @@ -82,12 +78,12 @@ func wasmimport_OutgoingDatagramStreamResourceDrop(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]outgoing-datagram-stream.check-send //go:noescape -func wasmimport_OutgoingDatagramStreamCheckSend(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) +func wasmimport_OutgoingDatagramStreamCheckSend(self0 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]outgoing-datagram-stream.send //go:noescape -func wasmimport_OutgoingDatagramStreamSend(self0 uint32, datagrams0 *OutgoingDatagram, datagrams1 uint32, result *cm.Result[uint64, uint64, ErrorCode]) +func wasmimport_OutgoingDatagramStreamSend(self0 uint32, datagrams0 *OutgoingDatagram, datagrams1 uint32) //go:wasmimport wasi:sockets/udp@0.2.0 [method]outgoing-datagram-stream.subscribe //go:noescape -func wasmimport_OutgoingDatagramStreamSubscribe(self0 uint32) (result0 uint32) +func wasmimport_OutgoingDatagramStreamSubscribe(self0 uint32) diff --git a/examples/component/wasitel-http/gen/wasi/sockets/udp/udp.wit.go b/examples/component/wasitel-http/gen/wasi/sockets/udp/udp.wit.go index 95d00fa6..1fd1e78e 100755 --- a/examples/component/wasitel-http/gen/wasi/sockets/udp/udp.wit.go +++ b/examples/component/wasitel-http/gen/wasi/sockets/udp/udp.wit.go @@ -76,154 +76,150 @@ func (self UDPSocket) ResourceDrop() { // AddressFamily represents the imported method "address-family". // -// address-family: func() -> ip-address-family +// address-family: func() // //go:nosplit -func (self UDPSocket) AddressFamily() (result IPAddressFamily) { +func (self UDPSocket) AddressFamily() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_UDPSocketAddressFamily((uint32)(self0)) - result = (network.IPAddressFamily)((uint32)(result0)) + wasmimport_UDPSocketAddressFamily((uint32)(self0)) return } // FinishBind represents the imported method "finish-bind". // -// finish-bind: func() -> result<_, error-code> +// finish-bind: func() // //go:nosplit -func (self UDPSocket) FinishBind() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self UDPSocket) FinishBind() { self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketFinishBind((uint32)(self0), &result) + wasmimport_UDPSocketFinishBind((uint32)(self0)) return } // LocalAddress represents the imported method "local-address". // -// local-address: func() -> result +// local-address: func() // //go:nosplit -func (self UDPSocket) LocalAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) { +func (self UDPSocket) LocalAddress() { self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketLocalAddress((uint32)(self0), &result) + wasmimport_UDPSocketLocalAddress((uint32)(self0)) return } // ReceiveBufferSize represents the imported method "receive-buffer-size". // -// receive-buffer-size: func() -> result +// receive-buffer-size: func() // //go:nosplit -func (self UDPSocket) ReceiveBufferSize() (result cm.Result[uint64, uint64, ErrorCode]) { +func (self UDPSocket) ReceiveBufferSize() { self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketReceiveBufferSize((uint32)(self0), &result) + wasmimport_UDPSocketReceiveBufferSize((uint32)(self0)) return } // RemoteAddress represents the imported method "remote-address". // -// remote-address: func() -> result +// remote-address: func() // //go:nosplit -func (self UDPSocket) RemoteAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) { +func (self UDPSocket) RemoteAddress() { self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketRemoteAddress((uint32)(self0), &result) + wasmimport_UDPSocketRemoteAddress((uint32)(self0)) return } // SendBufferSize represents the imported method "send-buffer-size". // -// send-buffer-size: func() -> result +// send-buffer-size: func() // //go:nosplit -func (self UDPSocket) SendBufferSize() (result cm.Result[uint64, uint64, ErrorCode]) { +func (self UDPSocket) SendBufferSize() { self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketSendBufferSize((uint32)(self0), &result) + wasmimport_UDPSocketSendBufferSize((uint32)(self0)) return } // SetReceiveBufferSize represents the imported method "set-receive-buffer-size". // -// set-receive-buffer-size: func(value: u64) -> result<_, error-code> +// set-receive-buffer-size: func(value: u64) // //go:nosplit -func (self UDPSocket) SetReceiveBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self UDPSocket) SetReceiveBufferSize(value uint64) { self0 := cm.Reinterpret[uint32](self) value0 := (uint64)(value) - wasmimport_UDPSocketSetReceiveBufferSize((uint32)(self0), (uint64)(value0), &result) + wasmimport_UDPSocketSetReceiveBufferSize((uint32)(self0), (uint64)(value0)) return } // SetSendBufferSize represents the imported method "set-send-buffer-size". // -// set-send-buffer-size: func(value: u64) -> result<_, error-code> +// set-send-buffer-size: func(value: u64) // //go:nosplit -func (self UDPSocket) SetSendBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self UDPSocket) SetSendBufferSize(value uint64) { self0 := cm.Reinterpret[uint32](self) value0 := (uint64)(value) - wasmimport_UDPSocketSetSendBufferSize((uint32)(self0), (uint64)(value0), &result) + wasmimport_UDPSocketSetSendBufferSize((uint32)(self0), (uint64)(value0)) return } // SetUnicastHopLimit represents the imported method "set-unicast-hop-limit". // -// set-unicast-hop-limit: func(value: u8) -> result<_, error-code> +// set-unicast-hop-limit: func(value: u8) // //go:nosplit -func (self UDPSocket) SetUnicastHopLimit(value uint8) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self UDPSocket) SetUnicastHopLimit(value uint8) { self0 := cm.Reinterpret[uint32](self) value0 := (uint32)(value) - wasmimport_UDPSocketSetUnicastHopLimit((uint32)(self0), (uint32)(value0), &result) + wasmimport_UDPSocketSetUnicastHopLimit((uint32)(self0), (uint32)(value0)) return } // StartBind represents the imported method "start-bind". // -// start-bind: func(network: borrow, local-address: ip-socket-address) -> -// result<_, error-code> +// start-bind: func(network: borrow, local-address: ip-socket-address) // //go:nosplit -func (self UDPSocket) StartBind(network_ Network, localAddress IPSocketAddress) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { +func (self UDPSocket) StartBind(network_ Network, localAddress IPSocketAddress) { self0 := cm.Reinterpret[uint32](self) network0 := cm.Reinterpret[uint32](network_) localAddress0, localAddress1, localAddress2, localAddress3, localAddress4, localAddress5, localAddress6, localAddress7, localAddress8, localAddress9, localAddress10, localAddress11 := lower_IPSocketAddress(localAddress) - wasmimport_UDPSocketStartBind((uint32)(self0), (uint32)(network0), (uint32)(localAddress0), (uint32)(localAddress1), (uint32)(localAddress2), (uint32)(localAddress3), (uint32)(localAddress4), (uint32)(localAddress5), (uint32)(localAddress6), (uint32)(localAddress7), (uint32)(localAddress8), (uint32)(localAddress9), (uint32)(localAddress10), (uint32)(localAddress11), &result) + wasmimport_UDPSocketStartBind((uint32)(self0), (uint32)(network0), (uint32)(localAddress0), (uint32)(localAddress1), (uint32)(localAddress2), (uint32)(localAddress3), (uint32)(localAddress4), (uint32)(localAddress5), (uint32)(localAddress6), (uint32)(localAddress7), (uint32)(localAddress8), (uint32)(localAddress9), (uint32)(localAddress10), (uint32)(localAddress11)) return } // Stream represents the imported method "stream". // -// %stream: func(remote-address: option) -> result, error-code> +// %stream: func(remote-address: option) // //go:nosplit -func (self UDPSocket) Stream(remoteAddress cm.Option[IPSocketAddress]) (result cm.Result[TupleIncomingDatagramStreamOutgoingDatagramStreamShape, cm.Tuple[IncomingDatagramStream, OutgoingDatagramStream], ErrorCode]) { +func (self UDPSocket) Stream(remoteAddress cm.Option[IPSocketAddress]) { self0 := cm.Reinterpret[uint32](self) remoteAddress0, remoteAddress1, remoteAddress2, remoteAddress3, remoteAddress4, remoteAddress5, remoteAddress6, remoteAddress7, remoteAddress8, remoteAddress9, remoteAddress10, remoteAddress11, remoteAddress12 := lower_OptionIPSocketAddress(remoteAddress) - wasmimport_UDPSocketStream((uint32)(self0), (uint32)(remoteAddress0), (uint32)(remoteAddress1), (uint32)(remoteAddress2), (uint32)(remoteAddress3), (uint32)(remoteAddress4), (uint32)(remoteAddress5), (uint32)(remoteAddress6), (uint32)(remoteAddress7), (uint32)(remoteAddress8), (uint32)(remoteAddress9), (uint32)(remoteAddress10), (uint32)(remoteAddress11), (uint32)(remoteAddress12), &result) + wasmimport_UDPSocketStream((uint32)(self0), (uint32)(remoteAddress0), (uint32)(remoteAddress1), (uint32)(remoteAddress2), (uint32)(remoteAddress3), (uint32)(remoteAddress4), (uint32)(remoteAddress5), (uint32)(remoteAddress6), (uint32)(remoteAddress7), (uint32)(remoteAddress8), (uint32)(remoteAddress9), (uint32)(remoteAddress10), (uint32)(remoteAddress11), (uint32)(remoteAddress12)) return } // Subscribe represents the imported method "subscribe". // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self UDPSocket) Subscribe() (result Pollable) { +func (self UDPSocket) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_UDPSocketSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_UDPSocketSubscribe((uint32)(self0)) return } // UnicastHopLimit represents the imported method "unicast-hop-limit". // -// unicast-hop-limit: func() -> result +// unicast-hop-limit: func() // //go:nosplit -func (self UDPSocket) UnicastHopLimit() (result cm.Result[uint8, uint8, ErrorCode]) { +func (self UDPSocket) UnicastHopLimit() { self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketUnicastHopLimit((uint32)(self0), &result) + wasmimport_UDPSocketUnicastHopLimit((uint32)(self0)) return } @@ -245,25 +241,24 @@ func (self IncomingDatagramStream) ResourceDrop() { // Receive represents the imported method "receive". // -// receive: func(max-results: u64) -> result, error-code> +// receive: func(max-results: u64) // //go:nosplit -func (self IncomingDatagramStream) Receive(maxResults uint64) (result cm.Result[cm.List[IncomingDatagram], cm.List[IncomingDatagram], ErrorCode]) { +func (self IncomingDatagramStream) Receive(maxResults uint64) { self0 := cm.Reinterpret[uint32](self) maxResults0 := (uint64)(maxResults) - wasmimport_IncomingDatagramStreamReceive((uint32)(self0), (uint64)(maxResults0), &result) + wasmimport_IncomingDatagramStreamReceive((uint32)(self0), (uint64)(maxResults0)) return } // Subscribe represents the imported method "subscribe". // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self IncomingDatagramStream) Subscribe() (result Pollable) { +func (self IncomingDatagramStream) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_IncomingDatagramStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_IncomingDatagramStreamSubscribe((uint32)(self0)) return } @@ -285,35 +280,34 @@ func (self OutgoingDatagramStream) ResourceDrop() { // CheckSend represents the imported method "check-send". // -// check-send: func() -> result +// check-send: func() // //go:nosplit -func (self OutgoingDatagramStream) CheckSend() (result cm.Result[uint64, uint64, ErrorCode]) { +func (self OutgoingDatagramStream) CheckSend() { self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingDatagramStreamCheckSend((uint32)(self0), &result) + wasmimport_OutgoingDatagramStreamCheckSend((uint32)(self0)) return } // Send represents the imported method "send". // -// send: func(datagrams: list) -> result +// send: func(datagrams: list) // //go:nosplit -func (self OutgoingDatagramStream) Send(datagrams cm.List[OutgoingDatagram]) (result cm.Result[uint64, uint64, ErrorCode]) { +func (self OutgoingDatagramStream) Send(datagrams cm.List[OutgoingDatagram]) { self0 := cm.Reinterpret[uint32](self) datagrams0, datagrams1 := cm.LowerList(datagrams) - wasmimport_OutgoingDatagramStreamSend((uint32)(self0), (*OutgoingDatagram)(datagrams0), (uint32)(datagrams1), &result) + wasmimport_OutgoingDatagramStreamSend((uint32)(self0), (*OutgoingDatagram)(datagrams0), (uint32)(datagrams1)) return } // Subscribe represents the imported method "subscribe". // -// subscribe: func() -> pollable +// subscribe: func() // //go:nosplit -func (self OutgoingDatagramStream) Subscribe() (result Pollable) { +func (self OutgoingDatagramStream) Subscribe() { self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutgoingDatagramStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) + wasmimport_OutgoingDatagramStreamSubscribe((uint32)(self0)) return } diff --git a/examples/component/wasitel-http/gen/wasmcloud/bus/lattice/lattice.wasm.go b/examples/component/wasitel-http/gen/wasmcloud/bus/lattice/lattice.wasm.go index 7c7b9094..6c044549 100755 --- a/examples/component/wasitel-http/gen/wasmcloud/bus/lattice/lattice.wasm.go +++ b/examples/component/wasitel-http/gen/wasmcloud/bus/lattice/lattice.wasm.go @@ -10,7 +10,7 @@ func wasmimport_CallTargetInterfaceResourceDrop(self0 uint32) //go:wasmimport wasmcloud:bus/lattice@1.0.0 [constructor]call-target-interface //go:noescape -func wasmimport_NewCallTargetInterface(namespace0 *uint8, namespace1 uint32, package0 *uint8, package1 uint32, interface0 *uint8, interface1 uint32) (result0 uint32) +func wasmimport_NewCallTargetInterface(namespace0 *uint8, namespace1 uint32, package0 *uint8, package1 uint32, interface0 *uint8, interface1 uint32) //go:wasmimport wasmcloud:bus/lattice@1.0.0 set-link-name //go:noescape diff --git a/examples/component/wasitel-http/gen/wasmcloud/bus/lattice/lattice.wit.go b/examples/component/wasitel-http/gen/wasmcloud/bus/lattice/lattice.wit.go index ba34d30c..af5d44b6 100755 --- a/examples/component/wasitel-http/gen/wasmcloud/bus/lattice/lattice.wit.go +++ b/examples/component/wasitel-http/gen/wasmcloud/bus/lattice/lattice.wit.go @@ -28,12 +28,11 @@ func (self CallTargetInterface) ResourceDrop() { // constructor(namespace: string, %package: string, %interface: string) // //go:nosplit -func NewCallTargetInterface(namespace string, package_ string, interface_ string) (result CallTargetInterface) { +func NewCallTargetInterface(namespace string, package_ string, interface_ string) { namespace0, namespace1 := cm.LowerString(namespace) package0, package1 := cm.LowerString(package_) interface0, interface1 := cm.LowerString(interface_) - result0 := wasmimport_NewCallTargetInterface((*uint8)(namespace0), (uint32)(namespace1), (*uint8)(package0), (uint32)(package1), (*uint8)(interface0), (uint32)(interface1)) - result = cm.Reinterpret[CallTargetInterface]((uint32)(result0)) + wasmimport_NewCallTargetInterface((*uint8)(namespace0), (uint32)(namespace1), (*uint8)(package0), (uint32)(package1), (*uint8)(interface0), (uint32)(interface1)) return } diff --git a/examples/component/wasitel-http/gen/wasmcloud/secrets/reveal/reveal.wasm.go b/examples/component/wasitel-http/gen/wasmcloud/secrets/reveal/reveal.wasm.go index 65404eb3..a6d83174 100755 --- a/examples/component/wasitel-http/gen/wasmcloud/secrets/reveal/reveal.wasm.go +++ b/examples/component/wasitel-http/gen/wasmcloud/secrets/reveal/reveal.wasm.go @@ -6,4 +6,4 @@ package reveal //go:wasmimport wasmcloud:secrets/reveal@0.1.0-draft reveal //go:noescape -func wasmimport_Reveal(s0 uint32, result *SecretValue) +func wasmimport_Reveal(s0 uint32) diff --git a/examples/component/wasitel-http/gen/wasmcloud/secrets/reveal/reveal.wit.go b/examples/component/wasitel-http/gen/wasmcloud/secrets/reveal/reveal.wit.go index 039d5706..4ab0306c 100755 --- a/examples/component/wasitel-http/gen/wasmcloud/secrets/reveal/reveal.wit.go +++ b/examples/component/wasitel-http/gen/wasmcloud/secrets/reveal/reveal.wit.go @@ -20,11 +20,11 @@ type SecretValue = store.SecretValue // Reveal represents the imported function "reveal". // -// reveal: func(s: borrow) -> secret-value +// reveal: func(s: borrow) // //go:nosplit -func Reveal(s Secret) (result SecretValue) { +func Reveal(s Secret) { s0 := cm.Reinterpret[uint32](s) - wasmimport_Reveal((uint32)(s0), &result) + wasmimport_Reveal((uint32)(s0)) return } diff --git a/examples/component/wasitel-http/gen/wasmcloud/secrets/store/store.wasm.go b/examples/component/wasitel-http/gen/wasmcloud/secrets/store/store.wasm.go index cc94c517..4ef43490 100755 --- a/examples/component/wasitel-http/gen/wasmcloud/secrets/store/store.wasm.go +++ b/examples/component/wasitel-http/gen/wasmcloud/secrets/store/store.wasm.go @@ -2,10 +2,6 @@ package store -import ( - "go.bytecodealliance.org/cm" -) - // This file contains wasmimport and wasmexport declarations for "wasmcloud:secrets@0.1.0-draft". //go:wasmimport wasmcloud:secrets/store@0.1.0-draft [resource-drop]secret @@ -14,4 +10,4 @@ func wasmimport_SecretResourceDrop(self0 uint32) //go:wasmimport wasmcloud:secrets/store@0.1.0-draft get //go:noescape -func wasmimport_Get(key0 *uint8, key1 uint32, result *cm.Result[SecretsErrorShape, Secret, SecretsError]) +func wasmimport_Get(key0 *uint8, key1 uint32) diff --git a/examples/component/wasitel-http/gen/wasmcloud/secrets/store/store.wit.go b/examples/component/wasitel-http/gen/wasmcloud/secrets/store/store.wit.go index d3465e4f..405555fa 100755 --- a/examples/component/wasitel-http/gen/wasmcloud/secrets/store/store.wit.go +++ b/examples/component/wasitel-http/gen/wasmcloud/secrets/store/store.wit.go @@ -114,11 +114,11 @@ func (self Secret) ResourceDrop() { // Get represents the imported function "get". // -// get: func(key: string) -> result +// get: func(key: string) // //go:nosplit -func Get(key string) (result cm.Result[SecretsErrorShape, Secret, SecretsError]) { +func Get(key string) { key0, key1 := cm.LowerString(key) - wasmimport_Get((*uint8)(key0), (uint32)(key1), &result) + wasmimport_Get((*uint8)(key0), (uint32)(key1)) return } From 022ea971ccd385c20f33db30516afee3db5c6ae1 Mon Sep 17 00:00:00 2001 From: Eric Gregory Date: Wed, 16 Jul 2025 09:20:22 -0400 Subject: [PATCH 2/2] clean up generated bindings Signed-off-by: Eric Gregory --- examples/component/http-client/.gitignore | 2 + .../example/http-client/example/example.wit | 1132 ---------- .../http-client/example/example.wit.go | 4 - .../gen/wasi/cli/environment/empty.s | 3 - .../wasi/cli/environment/environment.wasm.go | 17 - .../wasi/cli/environment/environment.wit.go | 34 - .../http-client/gen/wasi/cli/exit/empty.s | 3 - .../gen/wasi/cli/exit/exit.wasm.go | 9 - .../http-client/gen/wasi/cli/exit/exit.wit.go | 19 - .../http-client/gen/wasi/cli/stderr/empty.s | 3 - .../gen/wasi/cli/stderr/stderr.wasm.go | 9 - .../gen/wasi/cli/stderr/stderr.wit.go | 23 - .../http-client/gen/wasi/cli/stdin/empty.s | 3 - .../gen/wasi/cli/stdin/stdin.wasm.go | 9 - .../gen/wasi/cli/stdin/stdin.wit.go | 23 - .../http-client/gen/wasi/cli/stdout/empty.s | 3 - .../gen/wasi/cli/stdout/stdout.wasm.go | 9 - .../gen/wasi/cli/stdout/stdout.wit.go | 23 - .../gen/wasi/cli/terminal-input/empty.s | 3 - .../cli/terminal-input/terminal-input.wit.go | 24 - .../cli/terminal-input/terminalinput.wasm.go | 9 - .../gen/wasi/cli/terminal-output/empty.s | 3 - .../terminal-output/terminal-output.wit.go | 24 - .../terminal-output/terminaloutput.wasm.go | 9 - .../gen/wasi/cli/terminal-stderr/empty.s | 3 - .../terminal-stderr/terminal-stderr.wit.go | 23 - .../terminal-stderr/terminalstderr.wasm.go | 9 - .../gen/wasi/cli/terminal-stdin/empty.s | 3 - .../cli/terminal-stdin/terminal-stdin.wit.go | 23 - .../cli/terminal-stdin/terminalstdin.wasm.go | 9 - .../gen/wasi/cli/terminal-stdout/empty.s | 3 - .../terminal-stdout/terminal-stdout.wit.go | 23 - .../terminal-stdout/terminalstdout.wasm.go | 9 - .../gen/wasi/clocks/monotonic-clock/empty.s | 3 - .../monotonic-clock/monotonic-clock.wit.go | 65 - .../monotonic-clock/monotonicclock.wasm.go | 21 - .../gen/wasi/clocks/wall-clock/empty.s | 3 - .../wasi/clocks/wall-clock/wall-clock.wit.go | 40 - .../wasi/clocks/wall-clock/wallclock.wasm.go | 13 - .../gen/wasi/config/runtime/abi.go | 20 - .../gen/wasi/config/runtime/empty.s | 3 - .../gen/wasi/config/runtime/runtime.wasm.go | 13 - .../gen/wasi/config/runtime/runtime.wit.go | 67 - .../gen/wasi/filesystem/preopens/empty.s | 3 - .../wasi/filesystem/preopens/preopens.wasm.go | 9 - .../wasi/filesystem/preopens/preopens.wit.go | 23 - .../gen/wasi/filesystem/types/abi.go | 25 - .../gen/wasi/filesystem/types/empty.s | 3 - .../gen/wasi/filesystem/types/types.wasm.go | 129 -- .../gen/wasi/filesystem/types/types.wit.go | 783 ------- .../gen/wasi/http/incoming-handler/empty.s | 3 - .../incoming-handler.exports.go | 22 - .../incoming-handler/incoming-handler.wit.go | 21 - .../incoming-handler/incominghandler.wasm.go | 18 - .../gen/wasi/http/outgoing-handler/abi.go | 17 - .../gen/wasi/http/outgoing-handler/empty.s | 3 - .../outgoing-handler/outgoing-handler.wit.go | 55 - .../outgoing-handler/outgoinghandler.wasm.go | 9 - .../http-client/gen/wasi/http/types/abi.go | 264 --- .../http-client/gen/wasi/http/types/empty.s | 3 - .../gen/wasi/http/types/types.wasm.go | 257 --- .../gen/wasi/http/types/types.wit.go | 1982 ----------------- .../http-client/gen/wasi/io/error/empty.s | 3 - .../gen/wasi/io/error/error.wit.go | 35 - .../gen/wasi/io/error/ioerror.wasm.go | 13 - .../http-client/gen/wasi/io/poll/empty.s | 3 - .../http-client/gen/wasi/io/poll/poll.wasm.go | 21 - .../http-client/gen/wasi/io/poll/poll.wit.go | 57 - .../http-client/gen/wasi/io/streams/empty.s | 3 - .../gen/wasi/io/streams/streams.wasm.go | 73 - .../gen/wasi/io/streams/streams.wit.go | 268 --- .../gen/wasi/logging/logging/empty.s | 3 - .../gen/wasi/logging/logging/logging.wasm.go | 9 - .../gen/wasi/logging/logging/logging.wit.go | 56 - .../gen/wasi/random/insecure-seed/empty.s | 3 - .../random/insecure-seed/insecure-seed.wit.go | 14 - .../random/insecure-seed/insecureseed.wasm.go | 9 - .../gen/wasi/random/insecure/empty.s | 3 - .../gen/wasi/random/insecure/insecure.wasm.go | 13 - .../gen/wasi/random/insecure/insecure.wit.go | 25 - .../gen/wasi/random/random/empty.s | 3 - .../gen/wasi/random/random/random.wasm.go | 13 - .../gen/wasi/random/random/random.wit.go | 25 - .../gen/wasi/sockets/instance-network/empty.s | 3 - .../instance-network/instance-network.wit.go | 23 - .../instance-network/instancenetwork.wasm.go | 9 - .../gen/wasi/sockets/ip-name-lookup/abi.go | 14 - .../gen/wasi/sockets/ip-name-lookup/empty.s | 3 - .../ip-name-lookup/ip-name-lookup.wit.go | 80 - .../ip-name-lookup/ipnamelookup.wasm.go | 21 - .../gen/wasi/sockets/network/abi.go | 14 - .../gen/wasi/sockets/network/empty.s | 3 - .../gen/wasi/sockets/network/network.wasm.go | 9 - .../gen/wasi/sockets/network/network.wit.go | 241 -- .../wasi/sockets/tcp-create-socket/empty.s | 3 - .../tcp-create-socket.wit.go | 40 - .../tcp-create-socket/tcpcreatesocket.wasm.go | 9 - .../http-client/gen/wasi/sockets/tcp/abi.go | 69 - .../http-client/gen/wasi/sockets/tcp/empty.s | 3 - .../gen/wasi/sockets/tcp/tcp.wasm.go | 121 - .../gen/wasi/sockets/tcp/tcp.wit.go | 415 ---- .../wasi/sockets/udp-create-socket/empty.s | 3 - .../udp-create-socket.wit.go | 40 - .../udp-create-socket/udpcreatesocket.wasm.go | 9 - .../http-client/gen/wasi/sockets/udp/abi.go | 90 - .../http-client/gen/wasi/sockets/udp/empty.s | 3 - .../gen/wasi/sockets/udp/udp.wasm.go | 89 - .../gen/wasi/sockets/udp/udp.wit.go | 313 --- .../gen/wasmcloud/bus/lattice/empty.s | 3 - .../gen/wasmcloud/bus/lattice/lattice.wasm.go | 17 - .../gen/wasmcloud/bus/lattice/lattice.wit.go | 49 - .../gen/wasmcloud/secrets/reveal/empty.s | 3 - .../wasmcloud/secrets/reveal/reveal.wasm.go | 9 - .../wasmcloud/secrets/reveal/reveal.wit.go | 30 - .../gen/wasmcloud/secrets/store/abi.go | 14 - .../gen/wasmcloud/secrets/store/empty.s | 3 - .../gen/wasmcloud/secrets/store/store.wasm.go | 13 - .../gen/wasmcloud/secrets/store/store.wit.go | 124 -- .../http-password-checker/.gitignore | 1 + .../gen/wasi/cli/environment/empty.s | 3 - .../wasi/cli/environment/environment.wasm.go | 17 - .../wasi/cli/environment/environment.wit.go | 34 - .../gen/wasi/cli/exit/empty.s | 3 - .../gen/wasi/cli/exit/exit.wasm.go | 9 - .../gen/wasi/cli/exit/exit.wit.go | 19 - .../gen/wasi/cli/stderr/empty.s | 3 - .../gen/wasi/cli/stderr/stderr.wasm.go | 9 - .../gen/wasi/cli/stderr/stderr.wit.go | 23 - .../gen/wasi/cli/stdin/empty.s | 3 - .../gen/wasi/cli/stdin/stdin.wasm.go | 9 - .../gen/wasi/cli/stdin/stdin.wit.go | 23 - .../gen/wasi/cli/stdout/empty.s | 3 - .../gen/wasi/cli/stdout/stdout.wasm.go | 9 - .../gen/wasi/cli/stdout/stdout.wit.go | 23 - .../gen/wasi/cli/terminal-input/empty.s | 3 - .../cli/terminal-input/terminal-input.wit.go | 24 - .../cli/terminal-input/terminalinput.wasm.go | 9 - .../gen/wasi/cli/terminal-output/empty.s | 3 - .../terminal-output/terminal-output.wit.go | 24 - .../terminal-output/terminaloutput.wasm.go | 9 - .../gen/wasi/cli/terminal-stderr/empty.s | 3 - .../terminal-stderr/terminal-stderr.wit.go | 23 - .../terminal-stderr/terminalstderr.wasm.go | 9 - .../gen/wasi/cli/terminal-stdin/empty.s | 3 - .../cli/terminal-stdin/terminal-stdin.wit.go | 23 - .../cli/terminal-stdin/terminalstdin.wasm.go | 9 - .../gen/wasi/cli/terminal-stdout/empty.s | 3 - .../terminal-stdout/terminal-stdout.wit.go | 23 - .../terminal-stdout/terminalstdout.wasm.go | 9 - .../gen/wasi/clocks/monotonic-clock/empty.s | 3 - .../monotonic-clock/monotonic-clock.wit.go | 65 - .../monotonic-clock/monotonicclock.wasm.go | 21 - .../gen/wasi/clocks/wall-clock/empty.s | 3 - .../wasi/clocks/wall-clock/wall-clock.wit.go | 40 - .../wasi/clocks/wall-clock/wallclock.wasm.go | 13 - .../gen/wasi/config/runtime/abi.go | 20 - .../gen/wasi/config/runtime/empty.s | 3 - .../gen/wasi/config/runtime/runtime.wasm.go | 13 - .../gen/wasi/config/runtime/runtime.wit.go | 67 - .../gen/wasi/filesystem/preopens/empty.s | 3 - .../wasi/filesystem/preopens/preopens.wasm.go | 9 - .../wasi/filesystem/preopens/preopens.wit.go | 23 - .../gen/wasi/filesystem/types/abi.go | 25 - .../gen/wasi/filesystem/types/empty.s | 3 - .../gen/wasi/filesystem/types/types.wasm.go | 129 -- .../gen/wasi/filesystem/types/types.wit.go | 783 ------- .../gen/wasi/http/incoming-handler/empty.s | 3 - .../incoming-handler.exports.go | 22 - .../incoming-handler/incoming-handler.wit.go | 21 - .../incoming-handler/incominghandler.wasm.go | 18 - .../gen/wasi/http/outgoing-handler/abi.go | 17 - .../gen/wasi/http/outgoing-handler/empty.s | 3 - .../outgoing-handler/outgoing-handler.wit.go | 55 - .../outgoing-handler/outgoinghandler.wasm.go | 9 - .../gen/wasi/http/types/abi.go | 264 --- .../gen/wasi/http/types/empty.s | 3 - .../gen/wasi/http/types/types.wasm.go | 257 --- .../gen/wasi/http/types/types.wit.go | 1982 ----------------- .../gen/wasi/io/error/empty.s | 3 - .../gen/wasi/io/error/error.wit.go | 35 - .../gen/wasi/io/error/ioerror.wasm.go | 13 - .../gen/wasi/io/poll/empty.s | 3 - .../gen/wasi/io/poll/poll.wasm.go | 21 - .../gen/wasi/io/poll/poll.wit.go | 57 - .../gen/wasi/io/streams/empty.s | 3 - .../gen/wasi/io/streams/streams.wasm.go | 73 - .../gen/wasi/io/streams/streams.wit.go | 268 --- .../gen/wasi/logging/logging/empty.s | 3 - .../gen/wasi/logging/logging/logging.wasm.go | 9 - .../gen/wasi/logging/logging/logging.wit.go | 56 - .../gen/wasi/random/insecure-seed/empty.s | 3 - .../random/insecure-seed/insecure-seed.wit.go | 14 - .../random/insecure-seed/insecureseed.wasm.go | 9 - .../gen/wasi/random/insecure/empty.s | 3 - .../gen/wasi/random/insecure/insecure.wasm.go | 13 - .../gen/wasi/random/insecure/insecure.wit.go | 25 - .../gen/wasi/random/random/empty.s | 3 - .../gen/wasi/random/random/random.wasm.go | 13 - .../gen/wasi/random/random/random.wit.go | 25 - .../gen/wasi/sockets/instance-network/empty.s | 3 - .../instance-network/instance-network.wit.go | 23 - .../instance-network/instancenetwork.wasm.go | 9 - .../gen/wasi/sockets/ip-name-lookup/abi.go | 14 - .../gen/wasi/sockets/ip-name-lookup/empty.s | 3 - .../ip-name-lookup/ip-name-lookup.wit.go | 80 - .../ip-name-lookup/ipnamelookup.wasm.go | 21 - .../gen/wasi/sockets/network/abi.go | 14 - .../gen/wasi/sockets/network/empty.s | 3 - .../gen/wasi/sockets/network/network.wasm.go | 9 - .../gen/wasi/sockets/network/network.wit.go | 241 -- .../wasi/sockets/tcp-create-socket/empty.s | 3 - .../tcp-create-socket.wit.go | 40 - .../tcp-create-socket/tcpcreatesocket.wasm.go | 9 - .../gen/wasi/sockets/tcp/abi.go | 69 - .../gen/wasi/sockets/tcp/empty.s | 3 - .../gen/wasi/sockets/tcp/tcp.wasm.go | 121 - .../gen/wasi/sockets/tcp/tcp.wit.go | 415 ---- .../wasi/sockets/udp-create-socket/empty.s | 3 - .../udp-create-socket.wit.go | 40 - .../udp-create-socket/udpcreatesocket.wasm.go | 9 - .../gen/wasi/sockets/udp/abi.go | 90 - .../gen/wasi/sockets/udp/empty.s | 3 - .../gen/wasi/sockets/udp/udp.wasm.go | 89 - .../gen/wasi/sockets/udp/udp.wit.go | 313 --- .../gen/wasmcloud/bus/lattice/empty.s | 3 - .../gen/wasmcloud/bus/lattice/lattice.wasm.go | 17 - .../gen/wasmcloud/bus/lattice/lattice.wit.go | 49 - .../password-checker/password-checker.wit.go | 4 - .../gen/wasmcloud/secrets/reveal/empty.s | 3 - .../wasmcloud/secrets/reveal/reveal.wasm.go | 9 - .../wasmcloud/secrets/reveal/reveal.wit.go | 30 - .../gen/wasmcloud/secrets/store/abi.go | 14 - .../gen/wasmcloud/secrets/store/empty.s | 3 - .../gen/wasmcloud/secrets/store/store.wasm.go | 13 - .../gen/wasmcloud/secrets/store/store.wit.go | 124 -- examples/component/http-server/.gitignore | 2 + .../example/http-server/example/example.wit | 1132 ---------- .../http-server/example/example.wit.go | 4 - .../gen/wasi/cli/environment/empty.s | 3 - .../wasi/cli/environment/environment.wasm.go | 17 - .../wasi/cli/environment/environment.wit.go | 34 - .../http-server/gen/wasi/cli/exit/empty.s | 3 - .../gen/wasi/cli/exit/exit.wasm.go | 9 - .../http-server/gen/wasi/cli/exit/exit.wit.go | 19 - .../http-server/gen/wasi/cli/stderr/empty.s | 3 - .../gen/wasi/cli/stderr/stderr.wasm.go | 9 - .../gen/wasi/cli/stderr/stderr.wit.go | 23 - .../http-server/gen/wasi/cli/stdin/empty.s | 3 - .../gen/wasi/cli/stdin/stdin.wasm.go | 9 - .../gen/wasi/cli/stdin/stdin.wit.go | 23 - .../http-server/gen/wasi/cli/stdout/empty.s | 3 - .../gen/wasi/cli/stdout/stdout.wasm.go | 9 - .../gen/wasi/cli/stdout/stdout.wit.go | 23 - .../gen/wasi/cli/terminal-input/empty.s | 3 - .../cli/terminal-input/terminal-input.wit.go | 24 - .../cli/terminal-input/terminalinput.wasm.go | 9 - .../gen/wasi/cli/terminal-output/empty.s | 3 - .../terminal-output/terminal-output.wit.go | 24 - .../terminal-output/terminaloutput.wasm.go | 9 - .../gen/wasi/cli/terminal-stderr/empty.s | 3 - .../terminal-stderr/terminal-stderr.wit.go | 23 - .../terminal-stderr/terminalstderr.wasm.go | 9 - .../gen/wasi/cli/terminal-stdin/empty.s | 3 - .../cli/terminal-stdin/terminal-stdin.wit.go | 23 - .../cli/terminal-stdin/terminalstdin.wasm.go | 9 - .../gen/wasi/cli/terminal-stdout/empty.s | 3 - .../terminal-stdout/terminal-stdout.wit.go | 23 - .../terminal-stdout/terminalstdout.wasm.go | 9 - .../gen/wasi/clocks/monotonic-clock/empty.s | 3 - .../monotonic-clock/monotonic-clock.wit.go | 65 - .../monotonic-clock/monotonicclock.wasm.go | 21 - .../gen/wasi/clocks/wall-clock/empty.s | 3 - .../wasi/clocks/wall-clock/wall-clock.wit.go | 40 - .../wasi/clocks/wall-clock/wallclock.wasm.go | 13 - .../gen/wasi/config/runtime/abi.go | 20 - .../gen/wasi/config/runtime/empty.s | 3 - .../gen/wasi/config/runtime/runtime.wasm.go | 13 - .../gen/wasi/config/runtime/runtime.wit.go | 67 - .../gen/wasi/filesystem/preopens/empty.s | 3 - .../wasi/filesystem/preopens/preopens.wasm.go | 9 - .../wasi/filesystem/preopens/preopens.wit.go | 23 - .../gen/wasi/filesystem/types/abi.go | 25 - .../gen/wasi/filesystem/types/empty.s | 3 - .../gen/wasi/filesystem/types/types.wasm.go | 129 -- .../gen/wasi/filesystem/types/types.wit.go | 783 ------- .../gen/wasi/http/incoming-handler/empty.s | 3 - .../incoming-handler.exports.go | 22 - .../incoming-handler/incoming-handler.wit.go | 21 - .../incoming-handler/incominghandler.wasm.go | 18 - .../gen/wasi/http/outgoing-handler/abi.go | 17 - .../gen/wasi/http/outgoing-handler/empty.s | 3 - .../outgoing-handler/outgoing-handler.wit.go | 55 - .../outgoing-handler/outgoinghandler.wasm.go | 9 - .../http-server/gen/wasi/http/types/abi.go | 264 --- .../http-server/gen/wasi/http/types/empty.s | 3 - .../gen/wasi/http/types/types.wasm.go | 257 --- .../gen/wasi/http/types/types.wit.go | 1982 ----------------- .../http-server/gen/wasi/io/error/empty.s | 3 - .../gen/wasi/io/error/error.wit.go | 35 - .../gen/wasi/io/error/ioerror.wasm.go | 13 - .../http-server/gen/wasi/io/poll/empty.s | 3 - .../http-server/gen/wasi/io/poll/poll.wasm.go | 21 - .../http-server/gen/wasi/io/poll/poll.wit.go | 57 - .../http-server/gen/wasi/io/streams/empty.s | 3 - .../gen/wasi/io/streams/streams.wasm.go | 73 - .../gen/wasi/io/streams/streams.wit.go | 268 --- .../gen/wasi/logging/logging/empty.s | 3 - .../gen/wasi/logging/logging/logging.wasm.go | 9 - .../gen/wasi/logging/logging/logging.wit.go | 56 - .../gen/wasi/random/insecure-seed/empty.s | 3 - .../random/insecure-seed/insecure-seed.wit.go | 14 - .../random/insecure-seed/insecureseed.wasm.go | 9 - .../gen/wasi/random/insecure/empty.s | 3 - .../gen/wasi/random/insecure/insecure.wasm.go | 13 - .../gen/wasi/random/insecure/insecure.wit.go | 25 - .../gen/wasi/random/random/empty.s | 3 - .../gen/wasi/random/random/random.wasm.go | 13 - .../gen/wasi/random/random/random.wit.go | 25 - .../gen/wasi/sockets/instance-network/empty.s | 3 - .../instance-network/instance-network.wit.go | 23 - .../instance-network/instancenetwork.wasm.go | 9 - .../gen/wasi/sockets/ip-name-lookup/abi.go | 14 - .../gen/wasi/sockets/ip-name-lookup/empty.s | 3 - .../ip-name-lookup/ip-name-lookup.wit.go | 80 - .../ip-name-lookup/ipnamelookup.wasm.go | 21 - .../gen/wasi/sockets/network/abi.go | 14 - .../gen/wasi/sockets/network/empty.s | 3 - .../gen/wasi/sockets/network/network.wasm.go | 9 - .../gen/wasi/sockets/network/network.wit.go | 241 -- .../wasi/sockets/tcp-create-socket/empty.s | 3 - .../tcp-create-socket.wit.go | 40 - .../tcp-create-socket/tcpcreatesocket.wasm.go | 9 - .../http-server/gen/wasi/sockets/tcp/abi.go | 69 - .../http-server/gen/wasi/sockets/tcp/empty.s | 3 - .../gen/wasi/sockets/tcp/tcp.wasm.go | 121 - .../gen/wasi/sockets/tcp/tcp.wit.go | 415 ---- .../wasi/sockets/udp-create-socket/empty.s | 3 - .../udp-create-socket.wit.go | 40 - .../udp-create-socket/udpcreatesocket.wasm.go | 9 - .../http-server/gen/wasi/sockets/udp/abi.go | 90 - .../http-server/gen/wasi/sockets/udp/empty.s | 3 - .../gen/wasi/sockets/udp/udp.wasm.go | 89 - .../gen/wasi/sockets/udp/udp.wit.go | 313 --- .../gen/wasmcloud/bus/lattice/empty.s | 3 - .../gen/wasmcloud/bus/lattice/lattice.wasm.go | 17 - .../gen/wasmcloud/bus/lattice/lattice.wit.go | 49 - .../gen/wasmcloud/secrets/reveal/empty.s | 3 - .../wasmcloud/secrets/reveal/reveal.wasm.go | 9 - .../wasmcloud/secrets/reveal/reveal.wit.go | 30 - .../gen/wasmcloud/secrets/store/abi.go | 14 - .../gen/wasmcloud/secrets/store/empty.s | 3 - .../gen/wasmcloud/secrets/store/store.wasm.go | 13 - .../gen/wasmcloud/secrets/store/store.wit.go | 124 -- examples/component/invoke/.gitignore | 2 + .../gen/example/invoker/example/example.wit | 704 ------ .../example/invoker/example/example.wit.go | 4 - .../gen/example/invoker/invoker/empty.s | 3 - .../invoker/invoker/invoker.exports.go | 11 - .../example/invoker/invoker/invoker.wasm.go | 13 - .../example/invoker/invoker/invoker.wit.go | 4 - .../invoke/gen/wasi/cli/environment/empty.s | 3 - .../wasi/cli/environment/environment.wasm.go | 21 - .../wasi/cli/environment/environment.wit.go | 38 - .../invoke/gen/wasi/cli/exit/empty.s | 3 - .../invoke/gen/wasi/cli/exit/exit.wasm.go | 9 - .../invoke/gen/wasi/cli/exit/exit.wit.go | 19 - .../invoke/gen/wasi/cli/stderr/empty.s | 3 - .../invoke/gen/wasi/cli/stderr/stderr.wasm.go | 9 - .../invoke/gen/wasi/cli/stderr/stderr.wit.go | 25 - .../invoke/gen/wasi/cli/stdin/empty.s | 3 - .../invoke/gen/wasi/cli/stdin/stdin.wasm.go | 9 - .../invoke/gen/wasi/cli/stdin/stdin.wit.go | 25 - .../invoke/gen/wasi/cli/stdout/empty.s | 3 - .../invoke/gen/wasi/cli/stdout/stdout.wasm.go | 9 - .../invoke/gen/wasi/cli/stdout/stdout.wit.go | 25 - .../gen/wasi/cli/terminal-input/empty.s | 3 - .../cli/terminal-input/terminal-input.wit.go | 24 - .../cli/terminal-input/terminalinput.wasm.go | 9 - .../gen/wasi/cli/terminal-output/empty.s | 3 - .../terminal-output/terminal-output.wit.go | 24 - .../terminal-output/terminaloutput.wasm.go | 9 - .../gen/wasi/cli/terminal-stderr/empty.s | 3 - .../terminal-stderr/terminal-stderr.wit.go | 24 - .../terminal-stderr/terminalstderr.wasm.go | 13 - .../gen/wasi/cli/terminal-stdin/empty.s | 3 - .../cli/terminal-stdin/terminal-stdin.wit.go | 24 - .../cli/terminal-stdin/terminalstdin.wasm.go | 13 - .../gen/wasi/cli/terminal-stdout/empty.s | 3 - .../terminal-stdout/terminal-stdout.wit.go | 24 - .../terminal-stdout/terminalstdout.wasm.go | 13 - .../gen/wasi/clocks/monotonic-clock/empty.s | 3 - .../monotonic-clock/monotonic-clock.wit.go | 70 - .../monotonic-clock/monotonicclock.wasm.go | 21 - .../invoke/gen/wasi/clocks/wall-clock/empty.s | 3 - .../wasi/clocks/wall-clock/wall-clock.wit.go | 40 - .../wasi/clocks/wall-clock/wallclock.wasm.go | 13 - .../invoke/gen/wasi/config/runtime/abi.go | 20 - .../invoke/gen/wasi/config/runtime/empty.s | 3 - .../gen/wasi/config/runtime/runtime.wasm.go | 17 - .../gen/wasi/config/runtime/runtime.wit.go | 67 - .../gen/wasi/filesystem/preopens/empty.s | 3 - .../wasi/filesystem/preopens/preopens.wasm.go | 13 - .../wasi/filesystem/preopens/preopens.wit.go | 24 - .../invoke/gen/wasi/filesystem/types/abi.go | 50 - .../invoke/gen/wasi/filesystem/types/empty.s | 3 - .../gen/wasi/filesystem/types/types.wasm.go | 133 -- .../gen/wasi/filesystem/types/types.wit.go | 787 ------- .../gen/wasi/http/outgoing-handler/abi.go | 25 - .../gen/wasi/http/outgoing-handler/empty.s | 3 - .../outgoing-handler/outgoing-handler.wit.go | 42 - .../outgoing-handler/outgoinghandler.wasm.go | 13 - .../invoke/gen/wasi/http/types/abi.go | 264 --- .../invoke/gen/wasi/http/types/empty.s | 3 - .../invoke/gen/wasi/http/types/types.wasm.go | 257 --- .../invoke/gen/wasi/http/types/types.wit.go | 1603 ------------- .../invoke/gen/wasi/io/error/empty.s | 3 - .../invoke/gen/wasi/io/error/error.wit.go | 35 - .../invoke/gen/wasi/io/error/ioerror.wasm.go | 13 - .../component/invoke/gen/wasi/io/poll/empty.s | 3 - .../invoke/gen/wasi/io/poll/poll.wasm.go | 25 - .../invoke/gen/wasi/io/poll/poll.wit.go | 58 - .../invoke/gen/wasi/io/streams/abi.go | 12 - .../invoke/gen/wasi/io/streams/empty.s | 3 - .../gen/wasi/io/streams/streams.wasm.go | 77 - .../invoke/gen/wasi/io/streams/streams.wit.go | 270 --- .../invoke/gen/wasi/logging/logging/empty.s | 3 - .../gen/wasi/logging/logging/logging.wasm.go | 9 - .../gen/wasi/logging/logging/logging.wit.go | 56 - .../gen/wasi/random/insecure-seed/empty.s | 3 - .../random/insecure-seed/insecure-seed.wit.go | 14 - .../random/insecure-seed/insecureseed.wasm.go | 9 - .../invoke/gen/wasi/random/insecure/empty.s | 3 - .../gen/wasi/random/insecure/insecure.wasm.go | 17 - .../gen/wasi/random/insecure/insecure.wit.go | 30 - .../invoke/gen/wasi/random/random/empty.s | 3 - .../gen/wasi/random/random/random.wasm.go | 17 - .../gen/wasi/random/random/random.wit.go | 30 - .../gen/wasi/sockets/instance-network/empty.s | 3 - .../instance-network/instance-network.wit.go | 25 - .../instance-network/instancenetwork.wasm.go | 9 - .../gen/wasi/sockets/ip-name-lookup/abi.go | 14 - .../gen/wasi/sockets/ip-name-lookup/empty.s | 3 - .../ip-name-lookup/ip-name-lookup.wit.go | 82 - .../ip-name-lookup/ipnamelookup.wasm.go | 25 - .../invoke/gen/wasi/sockets/network/abi.go | 14 - .../invoke/gen/wasi/sockets/network/empty.s | 3 - .../gen/wasi/sockets/network/network.wasm.go | 9 - .../gen/wasi/sockets/network/network.wit.go | 241 -- .../wasi/sockets/tcp-create-socket/empty.s | 3 - .../tcp-create-socket.wit.go | 42 - .../tcp-create-socket/tcpcreatesocket.wasm.go | 13 - .../invoke/gen/wasi/sockets/tcp/abi.go | 88 - .../invoke/gen/wasi/sockets/tcp/empty.s | 3 - .../invoke/gen/wasi/sockets/tcp/tcp.wasm.go | 125 -- .../invoke/gen/wasi/sockets/tcp/tcp.wit.go | 420 ---- .../wasi/sockets/udp-create-socket/empty.s | 3 - .../udp-create-socket.wit.go | 42 - .../udp-create-socket/udpcreatesocket.wasm.go | 13 - .../invoke/gen/wasi/sockets/udp/abi.go | 103 - .../invoke/gen/wasi/sockets/udp/empty.s | 3 - .../invoke/gen/wasi/sockets/udp/udp.wasm.go | 93 - .../invoke/gen/wasi/sockets/udp/udp.wit.go | 319 --- .../invoke/gen/wasmcloud/bus/lattice/empty.s | 3 - .../gen/wasmcloud/bus/lattice/lattice.wasm.go | 17 - .../gen/wasmcloud/bus/lattice/lattice.wit.go | 50 - .../gen/wasmcloud/secrets/reveal/empty.s | 3 - .../wasmcloud/secrets/reveal/reveal.wasm.go | 9 - .../wasmcloud/secrets/reveal/reveal.wit.go | 30 - .../invoke/gen/wasmcloud/secrets/store/abi.go | 14 - .../gen/wasmcloud/secrets/store/empty.s | 3 - .../gen/wasmcloud/secrets/store/store.wasm.go | 17 - .../gen/wasmcloud/secrets/store/store.wit.go | 124 -- .../component/sqldb-postgres-query/.gitignore | 3 +- .../sqldb-postgres-query/gen/.gitkeep | 0 .../gen/wasi/cli/environment/empty.s | 3 - .../wasi/cli/environment/environment.wasm.go | 21 - .../wasi/cli/environment/environment.wit.go | 38 - .../gen/wasi/cli/exit/empty.s | 3 - .../gen/wasi/cli/exit/exit.wasm.go | 9 - .../gen/wasi/cli/exit/exit.wit.go | 19 - .../gen/wasi/cli/stderr/empty.s | 3 - .../gen/wasi/cli/stderr/stderr.wasm.go | 9 - .../gen/wasi/cli/stderr/stderr.wit.go | 25 - .../gen/wasi/cli/stdin/empty.s | 3 - .../gen/wasi/cli/stdin/stdin.wasm.go | 9 - .../gen/wasi/cli/stdin/stdin.wit.go | 25 - .../gen/wasi/cli/stdout/empty.s | 3 - .../gen/wasi/cli/stdout/stdout.wasm.go | 9 - .../gen/wasi/cli/stdout/stdout.wit.go | 25 - .../gen/wasi/cli/terminal-input/empty.s | 3 - .../cli/terminal-input/terminal-input.wit.go | 24 - .../cli/terminal-input/terminalinput.wasm.go | 9 - .../gen/wasi/cli/terminal-output/empty.s | 3 - .../terminal-output/terminal-output.wit.go | 24 - .../terminal-output/terminaloutput.wasm.go | 9 - .../gen/wasi/cli/terminal-stderr/empty.s | 3 - .../terminal-stderr/terminal-stderr.wit.go | 24 - .../terminal-stderr/terminalstderr.wasm.go | 13 - .../gen/wasi/cli/terminal-stdin/empty.s | 3 - .../cli/terminal-stdin/terminal-stdin.wit.go | 24 - .../cli/terminal-stdin/terminalstdin.wasm.go | 13 - .../gen/wasi/cli/terminal-stdout/empty.s | 3 - .../terminal-stdout/terminal-stdout.wit.go | 24 - .../terminal-stdout/terminalstdout.wasm.go | 13 - .../gen/wasi/clocks/monotonic-clock/empty.s | 3 - .../monotonic-clock/monotonic-clock.wit.go | 70 - .../monotonic-clock/monotonicclock.wasm.go | 21 - .../gen/wasi/clocks/wall-clock/empty.s | 3 - .../wasi/clocks/wall-clock/wall-clock.wit.go | 40 - .../wasi/clocks/wall-clock/wallclock.wasm.go | 13 - .../gen/wasi/config/runtime/abi.go | 20 - .../gen/wasi/config/runtime/empty.s | 3 - .../gen/wasi/config/runtime/runtime.wasm.go | 17 - .../gen/wasi/config/runtime/runtime.wit.go | 67 - .../gen/wasi/filesystem/preopens/empty.s | 3 - .../wasi/filesystem/preopens/preopens.wasm.go | 13 - .../wasi/filesystem/preopens/preopens.wit.go | 24 - .../gen/wasi/filesystem/types/abi.go | 50 - .../gen/wasi/filesystem/types/empty.s | 3 - .../gen/wasi/filesystem/types/types.wasm.go | 133 -- .../gen/wasi/filesystem/types/types.wit.go | 787 ------- .../gen/wasi/http/outgoing-handler/abi.go | 25 - .../gen/wasi/http/outgoing-handler/empty.s | 3 - .../outgoing-handler/outgoing-handler.wit.go | 42 - .../outgoing-handler/outgoinghandler.wasm.go | 13 - .../gen/wasi/http/types/abi.go | 264 --- .../gen/wasi/http/types/empty.s | 3 - .../gen/wasi/http/types/types.wasm.go | 257 --- .../gen/wasi/http/types/types.wit.go | 1603 ------------- .../gen/wasi/io/error/empty.s | 3 - .../gen/wasi/io/error/error.wit.go | 35 - .../gen/wasi/io/error/ioerror.wasm.go | 13 - .../gen/wasi/io/poll/empty.s | 3 - .../gen/wasi/io/poll/poll.wasm.go | 25 - .../gen/wasi/io/poll/poll.wit.go | 58 - .../gen/wasi/io/streams/abi.go | 12 - .../gen/wasi/io/streams/empty.s | 3 - .../gen/wasi/io/streams/streams.wasm.go | 77 - .../gen/wasi/io/streams/streams.wit.go | 270 --- .../gen/wasi/logging/logging/empty.s | 3 - .../gen/wasi/logging/logging/logging.wasm.go | 9 - .../gen/wasi/logging/logging/logging.wit.go | 56 - .../gen/wasi/random/insecure-seed/empty.s | 3 - .../random/insecure-seed/insecure-seed.wit.go | 14 - .../random/insecure-seed/insecureseed.wasm.go | 9 - .../gen/wasi/random/insecure/empty.s | 3 - .../gen/wasi/random/insecure/insecure.wasm.go | 17 - .../gen/wasi/random/insecure/insecure.wit.go | 30 - .../gen/wasi/random/random/empty.s | 3 - .../gen/wasi/random/random/random.wasm.go | 17 - .../gen/wasi/random/random/random.wit.go | 30 - .../gen/wasi/sockets/instance-network/empty.s | 3 - .../instance-network/instance-network.wit.go | 25 - .../instance-network/instancenetwork.wasm.go | 9 - .../gen/wasi/sockets/ip-name-lookup/abi.go | 14 - .../gen/wasi/sockets/ip-name-lookup/empty.s | 3 - .../ip-name-lookup/ip-name-lookup.wit.go | 82 - .../ip-name-lookup/ipnamelookup.wasm.go | 25 - .../gen/wasi/sockets/network/abi.go | 14 - .../gen/wasi/sockets/network/empty.s | 3 - .../gen/wasi/sockets/network/network.wasm.go | 9 - .../gen/wasi/sockets/network/network.wit.go | 241 -- .../wasi/sockets/tcp-create-socket/empty.s | 3 - .../tcp-create-socket.wit.go | 42 - .../tcp-create-socket/tcpcreatesocket.wasm.go | 13 - .../gen/wasi/sockets/tcp/abi.go | 88 - .../gen/wasi/sockets/tcp/empty.s | 3 - .../gen/wasi/sockets/tcp/tcp.wasm.go | 125 -- .../gen/wasi/sockets/tcp/tcp.wit.go | 420 ---- .../wasi/sockets/udp-create-socket/empty.s | 3 - .../udp-create-socket.wit.go | 42 - .../udp-create-socket/udpcreatesocket.wasm.go | 13 - .../gen/wasi/sockets/udp/abi.go | 103 - .../gen/wasi/sockets/udp/empty.s | 3 - .../gen/wasi/sockets/udp/udp.wasm.go | 93 - .../gen/wasi/sockets/udp/udp.wit.go | 319 --- .../gen/wasmcloud/bus/lattice/empty.s | 3 - .../gen/wasmcloud/bus/lattice/lattice.wasm.go | 17 - .../gen/wasmcloud/bus/lattice/lattice.wit.go | 50 - .../examples/component/component.wit | 1001 --------- .../examples/component/component.wit.go | 4 - .../gen/wasmcloud/examples/invoke/empty.s | 3 - .../examples/invoke/invoke.exports.go | 13 - .../wasmcloud/examples/invoke/invoke.wasm.go | 13 - .../wasmcloud/examples/invoke/invoke.wit.go | 9 - .../gen/wasmcloud/postgres/query/abi.go | 15 - .../gen/wasmcloud/postgres/query/empty.s | 3 - .../wasmcloud/postgres/query/query.wasm.go | 17 - .../gen/wasmcloud/postgres/query/query.wit.go | 69 - .../gen/wasmcloud/postgres/types/abi.go | 20 - .../gen/wasmcloud/postgres/types/types.wit.go | 1751 --------------- .../gen/wasmcloud/secrets/reveal/empty.s | 3 - .../wasmcloud/secrets/reveal/reveal.wasm.go | 9 - .../wasmcloud/secrets/reveal/reveal.wit.go | 30 - .../gen/wasmcloud/secrets/store/abi.go | 14 - .../gen/wasmcloud/secrets/store/empty.s | 3 - .../gen/wasmcloud/secrets/store/store.wasm.go | 17 - .../gen/wasmcloud/secrets/store/store.wit.go | 124 -- examples/component/wasitel-http/.gitignore | 2 + .../wasitel-echo/component/component.wit.go | 4 - .../gen/wasi/cli/environment/empty.s | 3 - .../wasi/cli/environment/environment.wasm.go | 17 - .../wasi/cli/environment/environment.wit.go | 34 - .../wasitel-http/gen/wasi/cli/exit/empty.s | 3 - .../gen/wasi/cli/exit/exit.wasm.go | 9 - .../gen/wasi/cli/exit/exit.wit.go | 19 - .../wasitel-http/gen/wasi/cli/stderr/empty.s | 3 - .../gen/wasi/cli/stderr/stderr.wasm.go | 9 - .../gen/wasi/cli/stderr/stderr.wit.go | 23 - .../wasitel-http/gen/wasi/cli/stdin/empty.s | 3 - .../gen/wasi/cli/stdin/stdin.wasm.go | 9 - .../gen/wasi/cli/stdin/stdin.wit.go | 23 - .../wasitel-http/gen/wasi/cli/stdout/empty.s | 3 - .../gen/wasi/cli/stdout/stdout.wasm.go | 9 - .../gen/wasi/cli/stdout/stdout.wit.go | 23 - .../gen/wasi/cli/terminal-input/empty.s | 3 - .../cli/terminal-input/terminal-input.wit.go | 24 - .../cli/terminal-input/terminalinput.wasm.go | 9 - .../gen/wasi/cli/terminal-output/empty.s | 3 - .../terminal-output/terminal-output.wit.go | 24 - .../terminal-output/terminaloutput.wasm.go | 9 - .../gen/wasi/cli/terminal-stderr/empty.s | 3 - .../terminal-stderr/terminal-stderr.wit.go | 23 - .../terminal-stderr/terminalstderr.wasm.go | 9 - .../gen/wasi/cli/terminal-stdin/empty.s | 3 - .../cli/terminal-stdin/terminal-stdin.wit.go | 23 - .../cli/terminal-stdin/terminalstdin.wasm.go | 9 - .../gen/wasi/cli/terminal-stdout/empty.s | 3 - .../terminal-stdout/terminal-stdout.wit.go | 23 - .../terminal-stdout/terminalstdout.wasm.go | 9 - .../gen/wasi/clocks/monotonic-clock/empty.s | 3 - .../monotonic-clock/monotonic-clock.wit.go | 65 - .../monotonic-clock/monotonicclock.wasm.go | 21 - .../gen/wasi/clocks/wall-clock/empty.s | 3 - .../wasi/clocks/wall-clock/wall-clock.wit.go | 40 - .../wasi/clocks/wall-clock/wallclock.wasm.go | 13 - .../gen/wasi/config/runtime/abi.go | 20 - .../gen/wasi/config/runtime/empty.s | 3 - .../gen/wasi/config/runtime/runtime.wasm.go | 13 - .../gen/wasi/config/runtime/runtime.wit.go | 67 - .../gen/wasi/filesystem/preopens/empty.s | 3 - .../wasi/filesystem/preopens/preopens.wasm.go | 9 - .../wasi/filesystem/preopens/preopens.wit.go | 23 - .../gen/wasi/filesystem/types/abi.go | 25 - .../gen/wasi/filesystem/types/empty.s | 3 - .../gen/wasi/filesystem/types/types.wasm.go | 129 -- .../gen/wasi/filesystem/types/types.wit.go | 783 ------- .../gen/wasi/http/incoming-handler/empty.s | 3 - .../incoming-handler.exports.go | 22 - .../incoming-handler/incoming-handler.wit.go | 21 - .../incoming-handler/incominghandler.wasm.go | 18 - .../gen/wasi/http/outgoing-handler/abi.go | 17 - .../gen/wasi/http/outgoing-handler/empty.s | 3 - .../outgoing-handler/outgoing-handler.wit.go | 55 - .../outgoing-handler/outgoinghandler.wasm.go | 9 - .../wasitel-http/gen/wasi/http/types/abi.go | 264 --- .../wasitel-http/gen/wasi/http/types/empty.s | 3 - .../gen/wasi/http/types/types.wasm.go | 257 --- .../gen/wasi/http/types/types.wit.go | 1982 ----------------- .../wasitel-http/gen/wasi/io/error/empty.s | 3 - .../gen/wasi/io/error/error.wit.go | 35 - .../gen/wasi/io/error/ioerror.wasm.go | 13 - .../wasitel-http/gen/wasi/io/poll/empty.s | 3 - .../gen/wasi/io/poll/poll.wasm.go | 21 - .../wasitel-http/gen/wasi/io/poll/poll.wit.go | 57 - .../wasitel-http/gen/wasi/io/streams/empty.s | 3 - .../gen/wasi/io/streams/streams.wasm.go | 73 - .../gen/wasi/io/streams/streams.wit.go | 268 --- .../gen/wasi/logging/logging/empty.s | 3 - .../gen/wasi/logging/logging/logging.wasm.go | 9 - .../gen/wasi/logging/logging/logging.wit.go | 56 - .../gen/wasi/random/insecure-seed/empty.s | 3 - .../random/insecure-seed/insecure-seed.wit.go | 14 - .../random/insecure-seed/insecureseed.wasm.go | 9 - .../gen/wasi/random/insecure/empty.s | 3 - .../gen/wasi/random/insecure/insecure.wasm.go | 13 - .../gen/wasi/random/insecure/insecure.wit.go | 25 - .../gen/wasi/random/random/empty.s | 3 - .../gen/wasi/random/random/random.wasm.go | 13 - .../gen/wasi/random/random/random.wit.go | 25 - .../gen/wasi/sockets/instance-network/empty.s | 3 - .../instance-network/instance-network.wit.go | 23 - .../instance-network/instancenetwork.wasm.go | 9 - .../gen/wasi/sockets/ip-name-lookup/abi.go | 14 - .../gen/wasi/sockets/ip-name-lookup/empty.s | 3 - .../ip-name-lookup/ip-name-lookup.wit.go | 80 - .../ip-name-lookup/ipnamelookup.wasm.go | 21 - .../gen/wasi/sockets/network/abi.go | 14 - .../gen/wasi/sockets/network/empty.s | 3 - .../gen/wasi/sockets/network/network.wasm.go | 9 - .../gen/wasi/sockets/network/network.wit.go | 241 -- .../wasi/sockets/tcp-create-socket/empty.s | 3 - .../tcp-create-socket.wit.go | 40 - .../tcp-create-socket/tcpcreatesocket.wasm.go | 9 - .../wasitel-http/gen/wasi/sockets/tcp/abi.go | 69 - .../wasitel-http/gen/wasi/sockets/tcp/empty.s | 3 - .../gen/wasi/sockets/tcp/tcp.wasm.go | 121 - .../gen/wasi/sockets/tcp/tcp.wit.go | 415 ---- .../wasi/sockets/udp-create-socket/empty.s | 3 - .../udp-create-socket.wit.go | 40 - .../udp-create-socket/udpcreatesocket.wasm.go | 9 - .../wasitel-http/gen/wasi/sockets/udp/abi.go | 90 - .../wasitel-http/gen/wasi/sockets/udp/empty.s | 3 - .../gen/wasi/sockets/udp/udp.wasm.go | 89 - .../gen/wasi/sockets/udp/udp.wit.go | 313 --- .../gen/wasmcloud/bus/lattice/empty.s | 3 - .../gen/wasmcloud/bus/lattice/lattice.wasm.go | 17 - .../gen/wasmcloud/bus/lattice/lattice.wit.go | 49 - .../gen/wasmcloud/secrets/reveal/empty.s | 3 - .../wasmcloud/secrets/reveal/reveal.wasm.go | 9 - .../wasmcloud/secrets/reveal/reveal.wit.go | 30 - .../gen/wasmcloud/secrets/store/abi.go | 14 - .../gen/wasmcloud/secrets/store/empty.s | 3 - .../gen/wasmcloud/secrets/store/store.wasm.go | 13 - .../gen/wasmcloud/secrets/store/store.wit.go | 124 -- 715 files changed, 11 insertions(+), 46164 deletions(-) delete mode 100755 examples/component/http-client/gen/example/http-client/example/example.wit delete mode 100755 examples/component/http-client/gen/example/http-client/example/example.wit.go delete mode 100755 examples/component/http-client/gen/wasi/cli/environment/empty.s delete mode 100755 examples/component/http-client/gen/wasi/cli/environment/environment.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/cli/environment/environment.wit.go delete mode 100755 examples/component/http-client/gen/wasi/cli/exit/empty.s delete mode 100755 examples/component/http-client/gen/wasi/cli/exit/exit.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/cli/exit/exit.wit.go delete mode 100755 examples/component/http-client/gen/wasi/cli/stderr/empty.s delete mode 100755 examples/component/http-client/gen/wasi/cli/stderr/stderr.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/cli/stderr/stderr.wit.go delete mode 100755 examples/component/http-client/gen/wasi/cli/stdin/empty.s delete mode 100755 examples/component/http-client/gen/wasi/cli/stdin/stdin.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/cli/stdin/stdin.wit.go delete mode 100755 examples/component/http-client/gen/wasi/cli/stdout/empty.s delete mode 100755 examples/component/http-client/gen/wasi/cli/stdout/stdout.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/cli/stdout/stdout.wit.go delete mode 100755 examples/component/http-client/gen/wasi/cli/terminal-input/empty.s delete mode 100755 examples/component/http-client/gen/wasi/cli/terminal-input/terminal-input.wit.go delete mode 100755 examples/component/http-client/gen/wasi/cli/terminal-input/terminalinput.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/cli/terminal-output/empty.s delete mode 100755 examples/component/http-client/gen/wasi/cli/terminal-output/terminal-output.wit.go delete mode 100755 examples/component/http-client/gen/wasi/cli/terminal-output/terminaloutput.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/cli/terminal-stderr/empty.s delete mode 100755 examples/component/http-client/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go delete mode 100755 examples/component/http-client/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/cli/terminal-stdin/empty.s delete mode 100755 examples/component/http-client/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go delete mode 100755 examples/component/http-client/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/cli/terminal-stdout/empty.s delete mode 100755 examples/component/http-client/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go delete mode 100755 examples/component/http-client/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/clocks/monotonic-clock/empty.s delete mode 100755 examples/component/http-client/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go delete mode 100755 examples/component/http-client/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/clocks/wall-clock/empty.s delete mode 100755 examples/component/http-client/gen/wasi/clocks/wall-clock/wall-clock.wit.go delete mode 100755 examples/component/http-client/gen/wasi/clocks/wall-clock/wallclock.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/config/runtime/abi.go delete mode 100755 examples/component/http-client/gen/wasi/config/runtime/empty.s delete mode 100755 examples/component/http-client/gen/wasi/config/runtime/runtime.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/config/runtime/runtime.wit.go delete mode 100755 examples/component/http-client/gen/wasi/filesystem/preopens/empty.s delete mode 100755 examples/component/http-client/gen/wasi/filesystem/preopens/preopens.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/filesystem/preopens/preopens.wit.go delete mode 100755 examples/component/http-client/gen/wasi/filesystem/types/abi.go delete mode 100755 examples/component/http-client/gen/wasi/filesystem/types/empty.s delete mode 100755 examples/component/http-client/gen/wasi/filesystem/types/types.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/filesystem/types/types.wit.go delete mode 100755 examples/component/http-client/gen/wasi/http/incoming-handler/empty.s delete mode 100755 examples/component/http-client/gen/wasi/http/incoming-handler/incoming-handler.exports.go delete mode 100755 examples/component/http-client/gen/wasi/http/incoming-handler/incoming-handler.wit.go delete mode 100755 examples/component/http-client/gen/wasi/http/incoming-handler/incominghandler.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/http/outgoing-handler/abi.go delete mode 100755 examples/component/http-client/gen/wasi/http/outgoing-handler/empty.s delete mode 100755 examples/component/http-client/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go delete mode 100755 examples/component/http-client/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/http/types/abi.go delete mode 100755 examples/component/http-client/gen/wasi/http/types/empty.s delete mode 100755 examples/component/http-client/gen/wasi/http/types/types.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/http/types/types.wit.go delete mode 100755 examples/component/http-client/gen/wasi/io/error/empty.s delete mode 100755 examples/component/http-client/gen/wasi/io/error/error.wit.go delete mode 100755 examples/component/http-client/gen/wasi/io/error/ioerror.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/io/poll/empty.s delete mode 100755 examples/component/http-client/gen/wasi/io/poll/poll.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/io/poll/poll.wit.go delete mode 100755 examples/component/http-client/gen/wasi/io/streams/empty.s delete mode 100755 examples/component/http-client/gen/wasi/io/streams/streams.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/io/streams/streams.wit.go delete mode 100755 examples/component/http-client/gen/wasi/logging/logging/empty.s delete mode 100755 examples/component/http-client/gen/wasi/logging/logging/logging.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/logging/logging/logging.wit.go delete mode 100755 examples/component/http-client/gen/wasi/random/insecure-seed/empty.s delete mode 100755 examples/component/http-client/gen/wasi/random/insecure-seed/insecure-seed.wit.go delete mode 100755 examples/component/http-client/gen/wasi/random/insecure-seed/insecureseed.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/random/insecure/empty.s delete mode 100755 examples/component/http-client/gen/wasi/random/insecure/insecure.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/random/insecure/insecure.wit.go delete mode 100755 examples/component/http-client/gen/wasi/random/random/empty.s delete mode 100755 examples/component/http-client/gen/wasi/random/random/random.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/random/random/random.wit.go delete mode 100755 examples/component/http-client/gen/wasi/sockets/instance-network/empty.s delete mode 100755 examples/component/http-client/gen/wasi/sockets/instance-network/instance-network.wit.go delete mode 100755 examples/component/http-client/gen/wasi/sockets/instance-network/instancenetwork.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/sockets/ip-name-lookup/abi.go delete mode 100755 examples/component/http-client/gen/wasi/sockets/ip-name-lookup/empty.s delete mode 100755 examples/component/http-client/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go delete mode 100755 examples/component/http-client/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/sockets/network/abi.go delete mode 100755 examples/component/http-client/gen/wasi/sockets/network/empty.s delete mode 100755 examples/component/http-client/gen/wasi/sockets/network/network.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/sockets/network/network.wit.go delete mode 100755 examples/component/http-client/gen/wasi/sockets/tcp-create-socket/empty.s delete mode 100755 examples/component/http-client/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go delete mode 100755 examples/component/http-client/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/sockets/tcp/abi.go delete mode 100755 examples/component/http-client/gen/wasi/sockets/tcp/empty.s delete mode 100755 examples/component/http-client/gen/wasi/sockets/tcp/tcp.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/sockets/tcp/tcp.wit.go delete mode 100755 examples/component/http-client/gen/wasi/sockets/udp-create-socket/empty.s delete mode 100755 examples/component/http-client/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go delete mode 100755 examples/component/http-client/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/sockets/udp/abi.go delete mode 100755 examples/component/http-client/gen/wasi/sockets/udp/empty.s delete mode 100755 examples/component/http-client/gen/wasi/sockets/udp/udp.wasm.go delete mode 100755 examples/component/http-client/gen/wasi/sockets/udp/udp.wit.go delete mode 100755 examples/component/http-client/gen/wasmcloud/bus/lattice/empty.s delete mode 100755 examples/component/http-client/gen/wasmcloud/bus/lattice/lattice.wasm.go delete mode 100755 examples/component/http-client/gen/wasmcloud/bus/lattice/lattice.wit.go delete mode 100755 examples/component/http-client/gen/wasmcloud/secrets/reveal/empty.s delete mode 100755 examples/component/http-client/gen/wasmcloud/secrets/reveal/reveal.wasm.go delete mode 100755 examples/component/http-client/gen/wasmcloud/secrets/reveal/reveal.wit.go delete mode 100755 examples/component/http-client/gen/wasmcloud/secrets/store/abi.go delete mode 100755 examples/component/http-client/gen/wasmcloud/secrets/store/empty.s delete mode 100755 examples/component/http-client/gen/wasmcloud/secrets/store/store.wasm.go delete mode 100755 examples/component/http-client/gen/wasmcloud/secrets/store/store.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/environment/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/environment/environment.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/environment/environment.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/exit/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/exit/exit.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/exit/exit.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/stderr/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/stderr/stderr.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/stderr/stderr.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/stdin/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/stdin/stdin.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/stdin/stdin.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/stdout/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/stdout/stdout.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/stdout/stdout.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/terminal-input/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/terminal-input/terminal-input.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/terminal-input/terminalinput.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/terminal-output/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/terminal-output/terminal-output.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/terminal-output/terminaloutput.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/terminal-stderr/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/terminal-stdin/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/terminal-stdout/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/clocks/monotonic-clock/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/clocks/wall-clock/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/clocks/wall-clock/wall-clock.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/clocks/wall-clock/wallclock.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/config/runtime/abi.go delete mode 100755 examples/component/http-password-checker/gen/wasi/config/runtime/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/config/runtime/runtime.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/config/runtime/runtime.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/filesystem/preopens/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/filesystem/preopens/preopens.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/filesystem/preopens/preopens.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/filesystem/types/abi.go delete mode 100755 examples/component/http-password-checker/gen/wasi/filesystem/types/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/filesystem/types/types.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/filesystem/types/types.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/http/incoming-handler/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/http/incoming-handler/incoming-handler.exports.go delete mode 100755 examples/component/http-password-checker/gen/wasi/http/incoming-handler/incoming-handler.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/http/incoming-handler/incominghandler.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/http/outgoing-handler/abi.go delete mode 100755 examples/component/http-password-checker/gen/wasi/http/outgoing-handler/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/http/types/abi.go delete mode 100755 examples/component/http-password-checker/gen/wasi/http/types/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/http/types/types.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/http/types/types.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/io/error/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/io/error/error.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/io/error/ioerror.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/io/poll/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/io/poll/poll.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/io/poll/poll.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/io/streams/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/io/streams/streams.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/io/streams/streams.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/logging/logging/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/logging/logging/logging.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/logging/logging/logging.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/random/insecure-seed/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/random/insecure-seed/insecure-seed.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/random/insecure-seed/insecureseed.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/random/insecure/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/random/insecure/insecure.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/random/insecure/insecure.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/random/random/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/random/random/random.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/random/random/random.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/sockets/instance-network/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/sockets/instance-network/instance-network.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/sockets/instance-network/instancenetwork.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/sockets/ip-name-lookup/abi.go delete mode 100755 examples/component/http-password-checker/gen/wasi/sockets/ip-name-lookup/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/sockets/network/abi.go delete mode 100755 examples/component/http-password-checker/gen/wasi/sockets/network/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/sockets/network/network.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/sockets/network/network.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/sockets/tcp-create-socket/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/sockets/tcp/abi.go delete mode 100755 examples/component/http-password-checker/gen/wasi/sockets/tcp/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/sockets/tcp/tcp.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/sockets/tcp/tcp.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/sockets/udp-create-socket/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/sockets/udp/abi.go delete mode 100755 examples/component/http-password-checker/gen/wasi/sockets/udp/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasi/sockets/udp/udp.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasi/sockets/udp/udp.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasmcloud/bus/lattice/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasmcloud/bus/lattice/lattice.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasmcloud/bus/lattice/lattice.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasmcloud/password-checker/password-checker/password-checker.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasmcloud/secrets/reveal/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasmcloud/secrets/reveal/reveal.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasmcloud/secrets/reveal/reveal.wit.go delete mode 100755 examples/component/http-password-checker/gen/wasmcloud/secrets/store/abi.go delete mode 100755 examples/component/http-password-checker/gen/wasmcloud/secrets/store/empty.s delete mode 100755 examples/component/http-password-checker/gen/wasmcloud/secrets/store/store.wasm.go delete mode 100755 examples/component/http-password-checker/gen/wasmcloud/secrets/store/store.wit.go delete mode 100755 examples/component/http-server/gen/example/http-server/example/example.wit delete mode 100755 examples/component/http-server/gen/example/http-server/example/example.wit.go delete mode 100755 examples/component/http-server/gen/wasi/cli/environment/empty.s delete mode 100755 examples/component/http-server/gen/wasi/cli/environment/environment.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/cli/environment/environment.wit.go delete mode 100755 examples/component/http-server/gen/wasi/cli/exit/empty.s delete mode 100755 examples/component/http-server/gen/wasi/cli/exit/exit.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/cli/exit/exit.wit.go delete mode 100755 examples/component/http-server/gen/wasi/cli/stderr/empty.s delete mode 100755 examples/component/http-server/gen/wasi/cli/stderr/stderr.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/cli/stderr/stderr.wit.go delete mode 100755 examples/component/http-server/gen/wasi/cli/stdin/empty.s delete mode 100755 examples/component/http-server/gen/wasi/cli/stdin/stdin.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/cli/stdin/stdin.wit.go delete mode 100755 examples/component/http-server/gen/wasi/cli/stdout/empty.s delete mode 100755 examples/component/http-server/gen/wasi/cli/stdout/stdout.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/cli/stdout/stdout.wit.go delete mode 100755 examples/component/http-server/gen/wasi/cli/terminal-input/empty.s delete mode 100755 examples/component/http-server/gen/wasi/cli/terminal-input/terminal-input.wit.go delete mode 100755 examples/component/http-server/gen/wasi/cli/terminal-input/terminalinput.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/cli/terminal-output/empty.s delete mode 100755 examples/component/http-server/gen/wasi/cli/terminal-output/terminal-output.wit.go delete mode 100755 examples/component/http-server/gen/wasi/cli/terminal-output/terminaloutput.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/cli/terminal-stderr/empty.s delete mode 100755 examples/component/http-server/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go delete mode 100755 examples/component/http-server/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/cli/terminal-stdin/empty.s delete mode 100755 examples/component/http-server/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go delete mode 100755 examples/component/http-server/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/cli/terminal-stdout/empty.s delete mode 100755 examples/component/http-server/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go delete mode 100755 examples/component/http-server/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/clocks/monotonic-clock/empty.s delete mode 100755 examples/component/http-server/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go delete mode 100755 examples/component/http-server/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/clocks/wall-clock/empty.s delete mode 100755 examples/component/http-server/gen/wasi/clocks/wall-clock/wall-clock.wit.go delete mode 100755 examples/component/http-server/gen/wasi/clocks/wall-clock/wallclock.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/config/runtime/abi.go delete mode 100755 examples/component/http-server/gen/wasi/config/runtime/empty.s delete mode 100755 examples/component/http-server/gen/wasi/config/runtime/runtime.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/config/runtime/runtime.wit.go delete mode 100755 examples/component/http-server/gen/wasi/filesystem/preopens/empty.s delete mode 100755 examples/component/http-server/gen/wasi/filesystem/preopens/preopens.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/filesystem/preopens/preopens.wit.go delete mode 100755 examples/component/http-server/gen/wasi/filesystem/types/abi.go delete mode 100755 examples/component/http-server/gen/wasi/filesystem/types/empty.s delete mode 100755 examples/component/http-server/gen/wasi/filesystem/types/types.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/filesystem/types/types.wit.go delete mode 100755 examples/component/http-server/gen/wasi/http/incoming-handler/empty.s delete mode 100755 examples/component/http-server/gen/wasi/http/incoming-handler/incoming-handler.exports.go delete mode 100755 examples/component/http-server/gen/wasi/http/incoming-handler/incoming-handler.wit.go delete mode 100755 examples/component/http-server/gen/wasi/http/incoming-handler/incominghandler.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/http/outgoing-handler/abi.go delete mode 100755 examples/component/http-server/gen/wasi/http/outgoing-handler/empty.s delete mode 100755 examples/component/http-server/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go delete mode 100755 examples/component/http-server/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/http/types/abi.go delete mode 100755 examples/component/http-server/gen/wasi/http/types/empty.s delete mode 100755 examples/component/http-server/gen/wasi/http/types/types.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/http/types/types.wit.go delete mode 100755 examples/component/http-server/gen/wasi/io/error/empty.s delete mode 100755 examples/component/http-server/gen/wasi/io/error/error.wit.go delete mode 100755 examples/component/http-server/gen/wasi/io/error/ioerror.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/io/poll/empty.s delete mode 100755 examples/component/http-server/gen/wasi/io/poll/poll.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/io/poll/poll.wit.go delete mode 100755 examples/component/http-server/gen/wasi/io/streams/empty.s delete mode 100755 examples/component/http-server/gen/wasi/io/streams/streams.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/io/streams/streams.wit.go delete mode 100755 examples/component/http-server/gen/wasi/logging/logging/empty.s delete mode 100755 examples/component/http-server/gen/wasi/logging/logging/logging.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/logging/logging/logging.wit.go delete mode 100755 examples/component/http-server/gen/wasi/random/insecure-seed/empty.s delete mode 100755 examples/component/http-server/gen/wasi/random/insecure-seed/insecure-seed.wit.go delete mode 100755 examples/component/http-server/gen/wasi/random/insecure-seed/insecureseed.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/random/insecure/empty.s delete mode 100755 examples/component/http-server/gen/wasi/random/insecure/insecure.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/random/insecure/insecure.wit.go delete mode 100755 examples/component/http-server/gen/wasi/random/random/empty.s delete mode 100755 examples/component/http-server/gen/wasi/random/random/random.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/random/random/random.wit.go delete mode 100755 examples/component/http-server/gen/wasi/sockets/instance-network/empty.s delete mode 100755 examples/component/http-server/gen/wasi/sockets/instance-network/instance-network.wit.go delete mode 100755 examples/component/http-server/gen/wasi/sockets/instance-network/instancenetwork.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/sockets/ip-name-lookup/abi.go delete mode 100755 examples/component/http-server/gen/wasi/sockets/ip-name-lookup/empty.s delete mode 100755 examples/component/http-server/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go delete mode 100755 examples/component/http-server/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/sockets/network/abi.go delete mode 100755 examples/component/http-server/gen/wasi/sockets/network/empty.s delete mode 100755 examples/component/http-server/gen/wasi/sockets/network/network.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/sockets/network/network.wit.go delete mode 100755 examples/component/http-server/gen/wasi/sockets/tcp-create-socket/empty.s delete mode 100755 examples/component/http-server/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go delete mode 100755 examples/component/http-server/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/sockets/tcp/abi.go delete mode 100755 examples/component/http-server/gen/wasi/sockets/tcp/empty.s delete mode 100755 examples/component/http-server/gen/wasi/sockets/tcp/tcp.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/sockets/tcp/tcp.wit.go delete mode 100755 examples/component/http-server/gen/wasi/sockets/udp-create-socket/empty.s delete mode 100755 examples/component/http-server/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go delete mode 100755 examples/component/http-server/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/sockets/udp/abi.go delete mode 100755 examples/component/http-server/gen/wasi/sockets/udp/empty.s delete mode 100755 examples/component/http-server/gen/wasi/sockets/udp/udp.wasm.go delete mode 100755 examples/component/http-server/gen/wasi/sockets/udp/udp.wit.go delete mode 100755 examples/component/http-server/gen/wasmcloud/bus/lattice/empty.s delete mode 100755 examples/component/http-server/gen/wasmcloud/bus/lattice/lattice.wasm.go delete mode 100755 examples/component/http-server/gen/wasmcloud/bus/lattice/lattice.wit.go delete mode 100755 examples/component/http-server/gen/wasmcloud/secrets/reveal/empty.s delete mode 100755 examples/component/http-server/gen/wasmcloud/secrets/reveal/reveal.wasm.go delete mode 100755 examples/component/http-server/gen/wasmcloud/secrets/reveal/reveal.wit.go delete mode 100755 examples/component/http-server/gen/wasmcloud/secrets/store/abi.go delete mode 100755 examples/component/http-server/gen/wasmcloud/secrets/store/empty.s delete mode 100755 examples/component/http-server/gen/wasmcloud/secrets/store/store.wasm.go delete mode 100755 examples/component/http-server/gen/wasmcloud/secrets/store/store.wit.go delete mode 100755 examples/component/invoke/gen/example/invoker/example/example.wit delete mode 100644 examples/component/invoke/gen/example/invoker/example/example.wit.go delete mode 100644 examples/component/invoke/gen/example/invoker/invoker/empty.s delete mode 100644 examples/component/invoke/gen/example/invoker/invoker/invoker.exports.go delete mode 100755 examples/component/invoke/gen/example/invoker/invoker/invoker.wasm.go delete mode 100644 examples/component/invoke/gen/example/invoker/invoker/invoker.wit.go delete mode 100644 examples/component/invoke/gen/wasi/cli/environment/empty.s delete mode 100755 examples/component/invoke/gen/wasi/cli/environment/environment.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/cli/environment/environment.wit.go delete mode 100644 examples/component/invoke/gen/wasi/cli/exit/empty.s delete mode 100755 examples/component/invoke/gen/wasi/cli/exit/exit.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/cli/exit/exit.wit.go delete mode 100644 examples/component/invoke/gen/wasi/cli/stderr/empty.s delete mode 100755 examples/component/invoke/gen/wasi/cli/stderr/stderr.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/cli/stderr/stderr.wit.go delete mode 100644 examples/component/invoke/gen/wasi/cli/stdin/empty.s delete mode 100755 examples/component/invoke/gen/wasi/cli/stdin/stdin.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/cli/stdin/stdin.wit.go delete mode 100644 examples/component/invoke/gen/wasi/cli/stdout/empty.s delete mode 100755 examples/component/invoke/gen/wasi/cli/stdout/stdout.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/cli/stdout/stdout.wit.go delete mode 100644 examples/component/invoke/gen/wasi/cli/terminal-input/empty.s delete mode 100644 examples/component/invoke/gen/wasi/cli/terminal-input/terminal-input.wit.go delete mode 100755 examples/component/invoke/gen/wasi/cli/terminal-input/terminalinput.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/cli/terminal-output/empty.s delete mode 100644 examples/component/invoke/gen/wasi/cli/terminal-output/terminal-output.wit.go delete mode 100755 examples/component/invoke/gen/wasi/cli/terminal-output/terminaloutput.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/cli/terminal-stderr/empty.s delete mode 100644 examples/component/invoke/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go delete mode 100755 examples/component/invoke/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/cli/terminal-stdin/empty.s delete mode 100644 examples/component/invoke/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go delete mode 100755 examples/component/invoke/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/cli/terminal-stdout/empty.s delete mode 100644 examples/component/invoke/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go delete mode 100755 examples/component/invoke/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/clocks/monotonic-clock/empty.s delete mode 100644 examples/component/invoke/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go delete mode 100755 examples/component/invoke/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/clocks/wall-clock/empty.s delete mode 100644 examples/component/invoke/gen/wasi/clocks/wall-clock/wall-clock.wit.go delete mode 100755 examples/component/invoke/gen/wasi/clocks/wall-clock/wallclock.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/config/runtime/abi.go delete mode 100644 examples/component/invoke/gen/wasi/config/runtime/empty.s delete mode 100755 examples/component/invoke/gen/wasi/config/runtime/runtime.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/config/runtime/runtime.wit.go delete mode 100644 examples/component/invoke/gen/wasi/filesystem/preopens/empty.s delete mode 100755 examples/component/invoke/gen/wasi/filesystem/preopens/preopens.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/filesystem/preopens/preopens.wit.go delete mode 100644 examples/component/invoke/gen/wasi/filesystem/types/abi.go delete mode 100644 examples/component/invoke/gen/wasi/filesystem/types/empty.s delete mode 100755 examples/component/invoke/gen/wasi/filesystem/types/types.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/filesystem/types/types.wit.go delete mode 100644 examples/component/invoke/gen/wasi/http/outgoing-handler/abi.go delete mode 100644 examples/component/invoke/gen/wasi/http/outgoing-handler/empty.s delete mode 100644 examples/component/invoke/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go delete mode 100755 examples/component/invoke/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/http/types/abi.go delete mode 100644 examples/component/invoke/gen/wasi/http/types/empty.s delete mode 100755 examples/component/invoke/gen/wasi/http/types/types.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/http/types/types.wit.go delete mode 100644 examples/component/invoke/gen/wasi/io/error/empty.s delete mode 100644 examples/component/invoke/gen/wasi/io/error/error.wit.go delete mode 100755 examples/component/invoke/gen/wasi/io/error/ioerror.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/io/poll/empty.s delete mode 100755 examples/component/invoke/gen/wasi/io/poll/poll.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/io/poll/poll.wit.go delete mode 100644 examples/component/invoke/gen/wasi/io/streams/abi.go delete mode 100644 examples/component/invoke/gen/wasi/io/streams/empty.s delete mode 100755 examples/component/invoke/gen/wasi/io/streams/streams.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/io/streams/streams.wit.go delete mode 100644 examples/component/invoke/gen/wasi/logging/logging/empty.s delete mode 100755 examples/component/invoke/gen/wasi/logging/logging/logging.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/logging/logging/logging.wit.go delete mode 100644 examples/component/invoke/gen/wasi/random/insecure-seed/empty.s delete mode 100644 examples/component/invoke/gen/wasi/random/insecure-seed/insecure-seed.wit.go delete mode 100755 examples/component/invoke/gen/wasi/random/insecure-seed/insecureseed.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/random/insecure/empty.s delete mode 100755 examples/component/invoke/gen/wasi/random/insecure/insecure.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/random/insecure/insecure.wit.go delete mode 100644 examples/component/invoke/gen/wasi/random/random/empty.s delete mode 100755 examples/component/invoke/gen/wasi/random/random/random.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/random/random/random.wit.go delete mode 100644 examples/component/invoke/gen/wasi/sockets/instance-network/empty.s delete mode 100644 examples/component/invoke/gen/wasi/sockets/instance-network/instance-network.wit.go delete mode 100755 examples/component/invoke/gen/wasi/sockets/instance-network/instancenetwork.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/sockets/ip-name-lookup/abi.go delete mode 100644 examples/component/invoke/gen/wasi/sockets/ip-name-lookup/empty.s delete mode 100644 examples/component/invoke/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go delete mode 100755 examples/component/invoke/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/sockets/network/abi.go delete mode 100644 examples/component/invoke/gen/wasi/sockets/network/empty.s delete mode 100755 examples/component/invoke/gen/wasi/sockets/network/network.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/sockets/network/network.wit.go delete mode 100644 examples/component/invoke/gen/wasi/sockets/tcp-create-socket/empty.s delete mode 100644 examples/component/invoke/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go delete mode 100755 examples/component/invoke/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/sockets/tcp/abi.go delete mode 100644 examples/component/invoke/gen/wasi/sockets/tcp/empty.s delete mode 100755 examples/component/invoke/gen/wasi/sockets/tcp/tcp.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/sockets/tcp/tcp.wit.go delete mode 100644 examples/component/invoke/gen/wasi/sockets/udp-create-socket/empty.s delete mode 100644 examples/component/invoke/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go delete mode 100755 examples/component/invoke/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/sockets/udp/abi.go delete mode 100644 examples/component/invoke/gen/wasi/sockets/udp/empty.s delete mode 100755 examples/component/invoke/gen/wasi/sockets/udp/udp.wasm.go delete mode 100644 examples/component/invoke/gen/wasi/sockets/udp/udp.wit.go delete mode 100644 examples/component/invoke/gen/wasmcloud/bus/lattice/empty.s delete mode 100755 examples/component/invoke/gen/wasmcloud/bus/lattice/lattice.wasm.go delete mode 100644 examples/component/invoke/gen/wasmcloud/bus/lattice/lattice.wit.go delete mode 100644 examples/component/invoke/gen/wasmcloud/secrets/reveal/empty.s delete mode 100755 examples/component/invoke/gen/wasmcloud/secrets/reveal/reveal.wasm.go delete mode 100644 examples/component/invoke/gen/wasmcloud/secrets/reveal/reveal.wit.go delete mode 100644 examples/component/invoke/gen/wasmcloud/secrets/store/abi.go delete mode 100644 examples/component/invoke/gen/wasmcloud/secrets/store/empty.s delete mode 100755 examples/component/invoke/gen/wasmcloud/secrets/store/store.wasm.go delete mode 100644 examples/component/invoke/gen/wasmcloud/secrets/store/store.wit.go delete mode 100644 examples/component/sqldb-postgres-query/gen/.gitkeep delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/cli/environment/empty.s delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/cli/environment/environment.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/cli/environment/environment.wit.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/cli/exit/empty.s delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/cli/exit/exit.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/cli/exit/exit.wit.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/cli/stderr/empty.s delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/cli/stderr/stderr.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/cli/stderr/stderr.wit.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/cli/stdin/empty.s delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/cli/stdin/stdin.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/cli/stdin/stdin.wit.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/cli/stdout/empty.s delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/cli/stdout/stdout.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/cli/stdout/stdout.wit.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-input/empty.s delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-input/terminal-input.wit.go delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-input/terminalinput.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-output/empty.s delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-output/terminal-output.wit.go delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-output/terminaloutput.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stderr/empty.s delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stdin/empty.s delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stdout/empty.s delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/clocks/monotonic-clock/empty.s delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/clocks/wall-clock/empty.s delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/clocks/wall-clock/wall-clock.wit.go delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/clocks/wall-clock/wallclock.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/config/runtime/abi.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/config/runtime/empty.s delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/config/runtime/runtime.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/config/runtime/runtime.wit.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/filesystem/preopens/empty.s delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/filesystem/preopens/preopens.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/filesystem/preopens/preopens.wit.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/filesystem/types/abi.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/filesystem/types/empty.s delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/filesystem/types/types.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/filesystem/types/types.wit.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/http/outgoing-handler/abi.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/http/outgoing-handler/empty.s delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/http/types/abi.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/http/types/empty.s delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/http/types/types.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/http/types/types.wit.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/io/error/empty.s delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/io/error/error.wit.go delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/io/error/ioerror.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/io/poll/empty.s delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/io/poll/poll.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/io/poll/poll.wit.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/io/streams/abi.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/io/streams/empty.s delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/io/streams/streams.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/io/streams/streams.wit.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/logging/logging/empty.s delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/logging/logging/logging.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/logging/logging/logging.wit.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/random/insecure-seed/empty.s delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/random/insecure-seed/insecure-seed.wit.go delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/random/insecure-seed/insecureseed.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/random/insecure/empty.s delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/random/insecure/insecure.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/random/insecure/insecure.wit.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/random/random/empty.s delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/random/random/random.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/random/random/random.wit.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/sockets/instance-network/empty.s delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/sockets/instance-network/instance-network.wit.go delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/sockets/instance-network/instancenetwork.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/sockets/ip-name-lookup/abi.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/sockets/ip-name-lookup/empty.s delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/sockets/network/abi.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/sockets/network/empty.s delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/sockets/network/network.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/sockets/network/network.wit.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/sockets/tcp-create-socket/empty.s delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/sockets/tcp/abi.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/sockets/tcp/empty.s delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/sockets/tcp/tcp.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/sockets/tcp/tcp.wit.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/sockets/udp-create-socket/empty.s delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/sockets/udp/abi.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/sockets/udp/empty.s delete mode 100755 examples/component/sqldb-postgres-query/gen/wasi/sockets/udp/udp.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasi/sockets/udp/udp.wit.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasmcloud/bus/lattice/empty.s delete mode 100755 examples/component/sqldb-postgres-query/gen/wasmcloud/bus/lattice/lattice.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasmcloud/bus/lattice/lattice.wit.go delete mode 100755 examples/component/sqldb-postgres-query/gen/wasmcloud/examples/component/component.wit delete mode 100644 examples/component/sqldb-postgres-query/gen/wasmcloud/examples/component/component.wit.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasmcloud/examples/invoke/empty.s delete mode 100644 examples/component/sqldb-postgres-query/gen/wasmcloud/examples/invoke/invoke.exports.go delete mode 100755 examples/component/sqldb-postgres-query/gen/wasmcloud/examples/invoke/invoke.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasmcloud/examples/invoke/invoke.wit.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasmcloud/postgres/query/abi.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasmcloud/postgres/query/empty.s delete mode 100755 examples/component/sqldb-postgres-query/gen/wasmcloud/postgres/query/query.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasmcloud/postgres/query/query.wit.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasmcloud/postgres/types/abi.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasmcloud/postgres/types/types.wit.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasmcloud/secrets/reveal/empty.s delete mode 100755 examples/component/sqldb-postgres-query/gen/wasmcloud/secrets/reveal/reveal.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasmcloud/secrets/reveal/reveal.wit.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasmcloud/secrets/store/abi.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasmcloud/secrets/store/empty.s delete mode 100755 examples/component/sqldb-postgres-query/gen/wasmcloud/secrets/store/store.wasm.go delete mode 100644 examples/component/sqldb-postgres-query/gen/wasmcloud/secrets/store/store.wit.go create mode 100644 examples/component/wasitel-http/.gitignore delete mode 100755 examples/component/wasitel-http/gen/example/wasitel-echo/component/component.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/environment/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/environment/environment.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/environment/environment.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/exit/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/exit/exit.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/exit/exit.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/stderr/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/stderr/stderr.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/stderr/stderr.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/stdin/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/stdin/stdin.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/stdin/stdin.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/stdout/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/stdout/stdout.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/stdout/stdout.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/terminal-input/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/terminal-input/terminal-input.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/terminal-input/terminalinput.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/terminal-output/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/terminal-output/terminal-output.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/terminal-output/terminaloutput.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/terminal-stderr/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/terminal-stdin/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/terminal-stdout/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/clocks/monotonic-clock/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/clocks/wall-clock/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/clocks/wall-clock/wall-clock.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/clocks/wall-clock/wallclock.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/config/runtime/abi.go delete mode 100755 examples/component/wasitel-http/gen/wasi/config/runtime/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/config/runtime/runtime.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/config/runtime/runtime.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/filesystem/preopens/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/filesystem/preopens/preopens.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/filesystem/preopens/preopens.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/filesystem/types/abi.go delete mode 100755 examples/component/wasitel-http/gen/wasi/filesystem/types/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/filesystem/types/types.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/filesystem/types/types.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/http/incoming-handler/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/http/incoming-handler/incoming-handler.exports.go delete mode 100755 examples/component/wasitel-http/gen/wasi/http/incoming-handler/incoming-handler.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/http/incoming-handler/incominghandler.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/http/outgoing-handler/abi.go delete mode 100755 examples/component/wasitel-http/gen/wasi/http/outgoing-handler/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/http/types/abi.go delete mode 100755 examples/component/wasitel-http/gen/wasi/http/types/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/http/types/types.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/http/types/types.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/io/error/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/io/error/error.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/io/error/ioerror.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/io/poll/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/io/poll/poll.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/io/poll/poll.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/io/streams/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/io/streams/streams.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/io/streams/streams.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/logging/logging/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/logging/logging/logging.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/logging/logging/logging.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/random/insecure-seed/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/random/insecure-seed/insecure-seed.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/random/insecure-seed/insecureseed.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/random/insecure/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/random/insecure/insecure.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/random/insecure/insecure.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/random/random/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/random/random/random.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/random/random/random.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/sockets/instance-network/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/sockets/instance-network/instance-network.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/sockets/instance-network/instancenetwork.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/sockets/ip-name-lookup/abi.go delete mode 100755 examples/component/wasitel-http/gen/wasi/sockets/ip-name-lookup/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/sockets/network/abi.go delete mode 100755 examples/component/wasitel-http/gen/wasi/sockets/network/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/sockets/network/network.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/sockets/network/network.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/sockets/tcp-create-socket/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/sockets/tcp/abi.go delete mode 100755 examples/component/wasitel-http/gen/wasi/sockets/tcp/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/sockets/tcp/tcp.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/sockets/tcp/tcp.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/sockets/udp-create-socket/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/sockets/udp/abi.go delete mode 100755 examples/component/wasitel-http/gen/wasi/sockets/udp/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasi/sockets/udp/udp.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasi/sockets/udp/udp.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasmcloud/bus/lattice/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasmcloud/bus/lattice/lattice.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasmcloud/bus/lattice/lattice.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasmcloud/secrets/reveal/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasmcloud/secrets/reveal/reveal.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasmcloud/secrets/reveal/reveal.wit.go delete mode 100755 examples/component/wasitel-http/gen/wasmcloud/secrets/store/abi.go delete mode 100755 examples/component/wasitel-http/gen/wasmcloud/secrets/store/empty.s delete mode 100755 examples/component/wasitel-http/gen/wasmcloud/secrets/store/store.wasm.go delete mode 100755 examples/component/wasitel-http/gen/wasmcloud/secrets/store/store.wit.go diff --git a/examples/component/http-client/.gitignore b/examples/component/http-client/.gitignore index e69de29b..eaec1317 100644 --- a/examples/component/http-client/.gitignore +++ b/examples/component/http-client/.gitignore @@ -0,0 +1,2 @@ +gen/* +build/* \ No newline at end of file diff --git a/examples/component/http-client/gen/example/http-client/example/example.wit b/examples/component/http-client/gen/example/http-client/example/example.wit deleted file mode 100755 index 8402d63f..00000000 --- a/examples/component/http-client/gen/example/http-client/example/example.wit +++ /dev/null @@ -1,1132 +0,0 @@ -package example:http-client; - -world example { - import wasi:io/poll@0.2.0; - import wasi:clocks/monotonic-clock@0.2.0; - import wasi:io/error@0.2.0; - import wasi:io/streams@0.2.0; - import wasi:http/types@0.2.0; - import wasi:http/outgoing-handler@0.2.0; - import wasi:logging/logging@0.1.0-draft; - import wasi:config/runtime@0.2.0-draft; - import wasmcloud:bus/lattice@1.0.0; - import wasmcloud:secrets/store@0.1.0-draft; - import wasmcloud:secrets/reveal@0.1.0-draft; - import wasi:cli/environment@0.2.0; - import wasi:cli/exit@0.2.0; - import wasi:cli/stdin@0.2.0; - import wasi:cli/stdout@0.2.0; - import wasi:cli/stderr@0.2.0; - import wasi:cli/terminal-input@0.2.0; - import wasi:cli/terminal-output@0.2.0; - import wasi:cli/terminal-stdin@0.2.0; - import wasi:cli/terminal-stdout@0.2.0; - import wasi:cli/terminal-stderr@0.2.0; - import wasi:clocks/wall-clock@0.2.0; - import wasi:filesystem/types@0.2.0; - import wasi:filesystem/preopens@0.2.0; - import wasi:sockets/network@0.2.0; - import wasi:sockets/instance-network@0.2.0; - import wasi:sockets/udp@0.2.0; - import wasi:sockets/udp-create-socket@0.2.0; - import wasi:sockets/tcp@0.2.0; - import wasi:sockets/tcp-create-socket@0.2.0; - import wasi:sockets/ip-name-lookup@0.2.0; - import wasi:random/random@0.2.0; - import wasi:random/insecure@0.2.0; - import wasi:random/insecure-seed@0.2.0; - export wasi:http/incoming-handler@0.2.0; -} - -package wasi:cli@0.2.0 { - interface stdout { - use wasi:io/streams@0.2.0.{output-stream}; - get-stdout: func() -> output-stream; - } - - interface stderr { - use wasi:io/streams@0.2.0.{output-stream}; - get-stderr: func() -> output-stream; - } - - interface stdin { - use wasi:io/streams@0.2.0.{input-stream}; - get-stdin: func() -> input-stream; - } - - interface environment { - get-environment: func() -> list>; - get-arguments: func() -> list; - initial-cwd: func() -> option; - } - - interface exit { - exit: func(status: result); - } - - interface terminal-input { - resource terminal-input; - } - - interface terminal-output { - resource terminal-output; - } - - interface terminal-stdin { - use terminal-input.{terminal-input}; - get-terminal-stdin: func() -> option; - } - - interface terminal-stdout { - use terminal-output.{terminal-output}; - get-terminal-stdout: func() -> option; - } - - interface terminal-stderr { - use terminal-output.{terminal-output}; - get-terminal-stderr: func() -> option; - } -} - -package wasi:clocks@0.2.0 { - interface monotonic-clock { - use wasi:io/poll@0.2.0.{pollable}; - type instant = u64; - type duration = u64; - now: func() -> instant; - resolution: func() -> duration; - subscribe-instant: func(when: instant) -> pollable; - subscribe-duration: func(when: duration) -> pollable; - } - - interface wall-clock { - record datetime { - seconds: u64, - nanoseconds: u32, - } - now: func() -> datetime; - resolution: func() -> datetime; - } -} - -package wasi:config@0.2.0-draft { - interface runtime { - variant config-error { - upstream(string), - io(string), - } - get: func(key: string) -> result, config-error>; - get-all: func() -> result>, config-error>; - } -} - -package wasi:filesystem@0.2.0 { - interface types { - use wasi:io/streams@0.2.0.{input-stream}; - use wasi:io/streams@0.2.0.{output-stream}; - use wasi:io/streams@0.2.0.{error}; - use wasi:clocks/wall-clock@0.2.0.{datetime}; - type filesize = u64; - enum descriptor-type { - unknown, - block-device, - character-device, - directory, - fifo, - symbolic-link, - regular-file, - socket - } - flags descriptor-flags { - read, - write, - file-integrity-sync, - data-integrity-sync, - requested-write-sync, - mutate-directory, - } - flags path-flags { symlink-follow } - flags open-flags { - create, - directory, - exclusive, - truncate, - } - type link-count = u64; - record descriptor-stat { - %type: descriptor-type, - link-count: link-count, - size: filesize, - data-access-timestamp: option, - data-modification-timestamp: option, - status-change-timestamp: option, - } - variant new-timestamp { - no-change, - now, - timestamp(datetime), - } - record directory-entry { - %type: descriptor-type, - name: string, - } - enum error-code { - access, - would-block, - already, - bad-descriptor, - busy, - deadlock, - quota, - exist, - file-too-large, - illegal-byte-sequence, - in-progress, - interrupted, - invalid, - io, - is-directory, - loop, - too-many-links, - message-size, - name-too-long, - no-device, - no-entry, - no-lock, - insufficient-memory, - insufficient-space, - not-directory, - not-empty, - not-recoverable, - unsupported, - no-tty, - no-such-device, - overflow, - not-permitted, - pipe, - read-only, - invalid-seek, - text-file-busy, - cross-device - } - enum advice { - normal, - sequential, - random, - will-need, - dont-need, - no-reuse - } - record metadata-hash-value { - lower: u64, - upper: u64, - } - resource descriptor { - advise: func(offset: filesize, length: filesize, advice: advice) -> result<_, error-code>; - append-via-stream: func() -> result; - create-directory-at: func(path: string) -> result<_, error-code>; - get-flags: func() -> result; - get-type: func() -> result; - is-same-object: func(other: borrow) -> bool; - link-at: func(old-path-flags: path-flags, old-path: string, new-descriptor: borrow, new-path: string) -> result<_, error-code>; - metadata-hash: func() -> result; - metadata-hash-at: func(path-flags: path-flags, path: string) -> result; - open-at: func(path-flags: path-flags, path: string, open-flags: open-flags, %flags: descriptor-flags) -> result; - read: func(length: filesize, offset: filesize) -> result, bool>, error-code>; - read-directory: func() -> result; - read-via-stream: func(offset: filesize) -> result; - readlink-at: func(path: string) -> result; - remove-directory-at: func(path: string) -> result<_, error-code>; - rename-at: func(old-path: string, new-descriptor: borrow, new-path: string) -> result<_, error-code>; - set-size: func(size: filesize) -> result<_, error-code>; - set-times: func(data-access-timestamp: new-timestamp, data-modification-timestamp: new-timestamp) -> result<_, error-code>; - set-times-at: func(path-flags: path-flags, path: string, data-access-timestamp: new-timestamp, data-modification-timestamp: new-timestamp) -> result<_, error-code>; - stat: func() -> result; - stat-at: func(path-flags: path-flags, path: string) -> result; - symlink-at: func(old-path: string, new-path: string) -> result<_, error-code>; - sync: func() -> result<_, error-code>; - sync-data: func() -> result<_, error-code>; - unlink-file-at: func(path: string) -> result<_, error-code>; - write: func(buffer: list, offset: filesize) -> result; - write-via-stream: func(offset: filesize) -> result; - } - resource directory-entry-stream { - read-directory-entry: func() -> result, error-code>; - } - filesystem-error-code: func(err: borrow) -> option; - } - - interface preopens { - use types.{descriptor}; - get-directories: func() -> list>; - } -} - -package wasi:http@0.2.0 { - /// This interface defines all of the types and methods for implementing - /// HTTP Requests and Responses, both incoming and outgoing, as well as - /// their headers, trailers, and bodies. - interface types { - use wasi:clocks/monotonic-clock@0.2.0.{duration}; - use wasi:io/streams@0.2.0.{input-stream}; - use wasi:io/streams@0.2.0.{output-stream}; - use wasi:io/error@0.2.0.{error as io-error}; - use wasi:io/poll@0.2.0.{pollable}; - - /// This type corresponds to HTTP standard Methods. - variant method { - get, - head, - post, - put, - delete, - connect, - options, - trace, - patch, - other(string), - } - - /// This type corresponds to HTTP standard Related Schemes. - variant scheme { HTTP, HTTPS, other(string) } - - /// Defines the case payload type for `DNS-error` above: - record DNS-error-payload { - rcode: option, - info-code: option, - } - - /// Defines the case payload type for `TLS-alert-received` above: - record TLS-alert-received-payload { - alert-id: option, - alert-message: option, - } - - /// Defines the case payload type for `HTTP-response-{header,trailer}-size` above: - record field-size-payload { - field-name: option, - field-size: option, - } - - /// These cases are inspired by the IANA HTTP Proxy Error Types: - /// https://www.iana.org/assignments/http-proxy-status/http-proxy-status.xhtml#table-http-proxy-error-types - variant error-code { - DNS-timeout, - DNS-error(DNS-error-payload), - destination-not-found, - destination-unavailable, - destination-IP-prohibited, - destination-IP-unroutable, - connection-refused, - connection-terminated, - connection-timeout, - connection-read-timeout, - connection-write-timeout, - connection-limit-reached, - TLS-protocol-error, - TLS-certificate-error, - TLS-alert-received(TLS-alert-received-payload), - HTTP-request-denied, - HTTP-request-length-required, - HTTP-request-body-size(option), - HTTP-request-method-invalid, - HTTP-request-URI-invalid, - HTTP-request-URI-too-long, - HTTP-request-header-section-size(option), - HTTP-request-header-size(option), - HTTP-request-trailer-section-size(option), - HTTP-request-trailer-size(field-size-payload), - HTTP-response-incomplete, - HTTP-response-header-section-size(option), - HTTP-response-header-size(field-size-payload), - HTTP-response-body-size(option), - HTTP-response-trailer-section-size(option), - HTTP-response-trailer-size(field-size-payload), - HTTP-response-transfer-coding(option), - HTTP-response-content-coding(option), - HTTP-response-timeout, - HTTP-upgrade-failed, - HTTP-protocol-error, - loop-detected, - configuration-error, - /// This is a catch-all error for anything that doesn't fit cleanly into a - /// more specific case. It also includes an optional string for an - /// unstructured description of the error. Users should not depend on the - /// string for diagnosing errors, as it's not required to be consistent - /// between implementations. - internal-error(option), - } - - /// This type enumerates the different kinds of errors that may occur when - /// setting or appending to a `fields` resource. - variant header-error { - /// This error indicates that a `field-key` or `field-value` was - /// syntactically invalid when used with an operation that sets headers in a - /// `fields`. - invalid-syntax, - /// This error indicates that a forbidden `field-key` was used when trying - /// to set a header in a `fields`. - forbidden, - /// This error indicates that the operation on the `fields` was not - /// permitted because the fields are immutable. - immutable, - } - - /// Field keys are always strings. - type field-key = string; - - /// Field values should always be ASCII strings. However, in - /// reality, HTTP implementations often have to interpret malformed values, - /// so they are provided as a list of bytes. - type field-value = list; - - /// This following block defines the `fields` resource which corresponds to - /// HTTP standard Fields. Fields are a common representation used for both - /// Headers and Trailers. - /// - /// A `fields` may be mutable or immutable. A `fields` created using the - /// constructor, `from-list`, or `clone` will be mutable, but a `fields` - /// resource given by other means (including, but not limited to, - /// `incoming-request.headers`, `outgoing-request.headers`) might be be - /// immutable. In an immutable fields, the `set`, `append`, and `delete` - /// operations will fail with `header-error.immutable`. - resource fields { - /// Construct an empty HTTP Fields. - /// - /// The resulting `fields` is mutable. - constructor(); - - /// Append a value for a key. Does not change or delete any existing - /// values for that key. - /// - /// Fails with `header-error.immutable` if the `fields` are immutable. - append: func(name: field-key, value: field-value) -> result<_, header-error>; - - /// Make a deep copy of the Fields. Equivelant in behavior to calling the - /// `fields` constructor on the return value of `entries`. The resulting - /// `fields` is mutable. - clone: func() -> fields; - - /// Delete all values for a key. Does nothing if no values for the key - /// exist. - /// - /// Fails with `header-error.immutable` if the `fields` are immutable. - delete: func(name: field-key) -> result<_, header-error>; - - /// Retrieve the full set of keys and values in the Fields. Like the - /// constructor, the list represents each key-value pair. - /// - /// The outer list represents each key-value pair in the Fields. Keys - /// which have multiple values are represented by multiple entries in this - /// list with the same key. - entries: func() -> list>; - - /// Get all of the values corresponding to a key. If the key is not present - /// in this `fields`, an empty list is returned. However, if the key is - /// present but empty, this is represented by a list with one or more - /// empty field-values present. - get: func(name: field-key) -> list; - - /// Returns `true` when the key is present in this `fields`. If the key is - /// syntactically invalid, `false` is returned. - has: func(name: field-key) -> bool; - - /// Set all of the values for a key. Clears any existing values for that - /// key, if they have been set. - /// - /// Fails with `header-error.immutable` if the `fields` are immutable. - set: func(name: field-key, value: list) -> result<_, header-error>; - - /// Construct an HTTP Fields. - /// - /// The resulting `fields` is mutable. - /// - /// The list represents each key-value pair in the Fields. Keys - /// which have multiple values are represented by multiple entries in this - /// list with the same key. - /// - /// The tuple is a pair of the field key, represented as a string, and - /// Value, represented as a list of bytes. In a valid Fields, all keys - /// and values are valid UTF-8 strings. However, values are not always - /// well-formed, so they are represented as a raw list of bytes. - /// - /// An error result will be returned if any header or value was - /// syntactically invalid, or if a header was forbidden. - from-list: static func(entries: list>) -> result; - } - - /// Headers is an alias for Fields. - type headers = fields; - - /// Trailers is an alias for Fields. - type trailers = fields; - - /// Represents an incoming HTTP Request. - resource incoming-request { - - /// Returns the authority from the request, if it was present. - authority: func() -> option; - - /// Gives the `incoming-body` associated with this request. Will only - /// return success at most once, and subsequent calls will return error. - consume: func() -> result; - - /// Get the `headers` associated with the request. - /// - /// The returned `headers` resource is immutable: `set`, `append`, and - /// `delete` operations will fail with `header-error.immutable`. - /// - /// The `headers` returned are a child resource: it must be dropped before - /// the parent `incoming-request` is dropped. Dropping this - /// `incoming-request` before all children are dropped will trap. - headers: func() -> headers; - - /// Returns the method of the incoming request. - method: func() -> method; - - /// Returns the path with query parameters from the request, as a string. - path-with-query: func() -> option; - - /// Returns the protocol scheme from the request. - scheme: func() -> option; - } - - /// Represents an outgoing HTTP Request. - resource outgoing-request { - /// Construct a new `outgoing-request` with a default `method` of `GET`, and - /// `none` values for `path-with-query`, `scheme`, and `authority`. - /// - /// * `headers` is the HTTP Headers for the Request. - /// - /// It is possible to construct, or manipulate with the accessor functions - /// below, an `outgoing-request` with an invalid combination of `scheme` - /// and `authority`, or `headers` which are not permitted to be sent. - /// It is the obligation of the `outgoing-handler.handle` implementation - /// to reject invalid constructions of `outgoing-request`. - constructor(headers: headers); - - /// Get the HTTP Authority for the Request. A value of `none` may be used - /// with Related Schemes which do not require an Authority. The HTTP and - /// HTTPS schemes always require an authority. - authority: func() -> option; - - /// Returns the resource corresponding to the outgoing Body for this - /// Request. - /// - /// Returns success on the first call: the `outgoing-body` resource for - /// this `outgoing-request` can be retrieved at most once. Subsequent - /// calls will return error. - body: func() -> result; - - /// Get the headers associated with the Request. - /// - /// The returned `headers` resource is immutable: `set`, `append`, and - /// `delete` operations will fail with `header-error.immutable`. - /// - /// This headers resource is a child: it must be dropped before the parent - /// `outgoing-request` is dropped, or its ownership is transfered to - /// another component by e.g. `outgoing-handler.handle`. - headers: func() -> headers; - - /// Get the Method for the Request. - method: func() -> method; - - /// Get the combination of the HTTP Path and Query for the Request. - /// When `none`, this represents an empty Path and empty Query. - path-with-query: func() -> option; - - /// Get the HTTP Related Scheme for the Request. When `none`, the - /// implementation may choose an appropriate default scheme. - scheme: func() -> option; - - /// Set the HTTP Authority for the Request. A value of `none` may be used - /// with Related Schemes which do not require an Authority. The HTTP and - /// HTTPS schemes always require an authority. Fails if the string given is - /// not a syntactically valid uri authority. - set-authority: func(authority: option) -> result; - - /// Set the Method for the Request. Fails if the string present in a - /// `method.other` argument is not a syntactically valid method. - set-method: func(method: method) -> result; - - /// Set the combination of the HTTP Path and Query for the Request. - /// When `none`, this represents an empty Path and empty Query. Fails is the - /// string given is not a syntactically valid path and query uri component. - set-path-with-query: func(path-with-query: option) -> result; - - /// Set the HTTP Related Scheme for the Request. When `none`, the - /// implementation may choose an appropriate default scheme. Fails if the - /// string given is not a syntactically valid uri scheme. - set-scheme: func(scheme: option) -> result; - } - - /// Parameters for making an HTTP Request. Each of these parameters is - /// currently an optional timeout applicable to the transport layer of the - /// HTTP protocol. - /// - /// These timeouts are separate from any the user may use to bound a - /// blocking call to `wasi:io/poll.poll`. - resource request-options { - /// Construct a default `request-options` value. - constructor(); - - /// The timeout for receiving subsequent chunks of bytes in the Response - /// body stream. - between-bytes-timeout: func() -> option; - - /// The timeout for the initial connect to the HTTP Server. - connect-timeout: func() -> option; - - /// The timeout for receiving the first byte of the Response body. - first-byte-timeout: func() -> option; - - /// Set the timeout for receiving subsequent chunks of bytes in the Response - /// body stream. An error return value indicates that this timeout is not - /// supported. - set-between-bytes-timeout: func(duration: option) -> result; - - /// Set the timeout for the initial connect to the HTTP Server. An error - /// return value indicates that this timeout is not supported. - set-connect-timeout: func(duration: option) -> result; - - /// Set the timeout for receiving the first byte of the Response body. An - /// error return value indicates that this timeout is not supported. - set-first-byte-timeout: func(duration: option) -> result; - } - - /// Represents the ability to send an HTTP Response. - /// - /// This resource is used by the `wasi:http/incoming-handler` interface to - /// allow a Response to be sent corresponding to the Request provided as the - /// other argument to `incoming-handler.handle`. - resource response-outparam { - - /// Set the value of the `response-outparam` to either send a response, - /// or indicate an error. - /// - /// This method consumes the `response-outparam` to ensure that it is - /// called at most once. If it is never called, the implementation - /// will respond with an error. - /// - /// The user may provide an `error` to `response` to allow the - /// implementation determine how to respond with an HTTP error response. - set: static func(param: response-outparam, response: result); - } - - /// This type corresponds to the HTTP standard Status Code. - type status-code = u16; - - /// Represents an incoming HTTP Response. - resource incoming-response { - - /// Returns the incoming body. May be called at most once. Returns error - /// if called additional times. - consume: func() -> result; - - /// Returns the headers from the incoming response. - /// - /// The returned `headers` resource is immutable: `set`, `append`, and - /// `delete` operations will fail with `header-error.immutable`. - /// - /// This headers resource is a child: it must be dropped before the parent - /// `incoming-response` is dropped. - headers: func() -> headers; - - /// Returns the status code from the incoming response. - status: func() -> status-code; - } - - /// Represents an incoming HTTP Request or Response's Body. - /// - /// A body has both its contents - a stream of bytes - and a (possibly - /// empty) set of trailers, indicating that the full contents of the - /// body have been received. This resource represents the contents as - /// an `input-stream` and the delivery of trailers as a `future-trailers`, - /// and ensures that the user of this interface may only be consuming either - /// the body contents or waiting on trailers at any given time. - resource incoming-body { - - /// Returns the contents of the body, as a stream of bytes. - /// - /// Returns success on first call: the stream representing the contents - /// can be retrieved at most once. Subsequent calls will return error. - /// - /// The returned `input-stream` resource is a child: it must be dropped - /// before the parent `incoming-body` is dropped, or consumed by - /// `incoming-body.finish`. - /// - /// This invariant ensures that the implementation can determine whether - /// the user is consuming the contents of the body, waiting on the - /// `future-trailers` to be ready, or neither. This allows for network - /// backpressure is to be applied when the user is consuming the body, - /// and for that backpressure to not inhibit delivery of the trailers if - /// the user does not read the entire body. - %stream: func() -> result; - - /// Takes ownership of `incoming-body`, and returns a `future-trailers`. - /// This function will trap if the `input-stream` child is still alive. - finish: static func(this: incoming-body) -> future-trailers; - } - - /// Represents a future which may eventaully return trailers, or an error. - /// - /// In the case that the incoming HTTP Request or Response did not have any - /// trailers, this future will resolve to the empty set of trailers once the - /// complete Request or Response body has been received. - resource future-trailers { - - /// Returns the contents of the trailers, or an error which occured, - /// once the future is ready. - /// - /// The outer `option` represents future readiness. Users can wait on this - /// `option` to become `some` using the `subscribe` method. - /// - /// The outer `result` is used to retrieve the trailers or error at most - /// once. It will be success on the first call in which the outer option - /// is `some`, and error on subsequent calls. - /// - /// The inner `result` represents that either the HTTP Request or Response - /// body, as well as any trailers, were received successfully, or that an - /// error occured receiving them. The optional `trailers` indicates whether - /// or not trailers were present in the body. - /// - /// When some `trailers` are returned by this method, the `trailers` - /// resource is immutable, and a child. Use of the `set`, `append`, or - /// `delete` methods will return an error, and the resource must be - /// dropped before the parent `future-trailers` is dropped. - get: func() -> option, error-code>>>; - - /// Returns a pollable which becomes ready when either the trailers have - /// been received, or an error has occured. When this pollable is ready, - /// the `get` method will return `some`. - subscribe: func() -> pollable; - } - - /// Represents an outgoing HTTP Response. - resource outgoing-response { - /// Construct an `outgoing-response`, with a default `status-code` of `200`. - /// If a different `status-code` is needed, it must be set via the - /// `set-status-code` method. - /// - /// * `headers` is the HTTP Headers for the Response. - constructor(headers: headers); - - /// Returns the resource corresponding to the outgoing Body for this Response. - /// - /// Returns success on the first call: the `outgoing-body` resource for - /// this `outgoing-response` can be retrieved at most once. Subsequent - /// calls will return error. - body: func() -> result; - - /// Get the headers associated with the Request. - /// - /// The returned `headers` resource is immutable: `set`, `append`, and - /// `delete` operations will fail with `header-error.immutable`. - /// - /// This headers resource is a child: it must be dropped before the parent - /// `outgoing-request` is dropped, or its ownership is transfered to - /// another component by e.g. `outgoing-handler.handle`. - headers: func() -> headers; - - /// Set the HTTP Status Code for the Response. Fails if the status-code - /// given is not a valid http status code. - set-status-code: func(status-code: status-code) -> result; - - /// Get the HTTP Status Code for the Response. - status-code: func() -> status-code; - } - - /// Represents an outgoing HTTP Request or Response's Body. - /// - /// A body has both its contents - a stream of bytes - and a (possibly - /// empty) set of trailers, inducating the full contents of the body - /// have been sent. This resource represents the contents as an - /// `output-stream` child resource, and the completion of the body (with - /// optional trailers) with a static function that consumes the - /// `outgoing-body` resource, and ensures that the user of this interface - /// may not write to the body contents after the body has been finished. - /// - /// If the user code drops this resource, as opposed to calling the static - /// method `finish`, the implementation should treat the body as incomplete, - /// and that an error has occured. The implementation should propogate this - /// error to the HTTP protocol by whatever means it has available, - /// including: corrupting the body on the wire, aborting the associated - /// Request, or sending a late status code for the Response. - resource outgoing-body { - - /// Returns a stream for writing the body contents. - /// - /// The returned `output-stream` is a child resource: it must be dropped - /// before the parent `outgoing-body` resource is dropped (or finished), - /// otherwise the `outgoing-body` drop or `finish` will trap. - /// - /// Returns success on the first call: the `output-stream` resource for - /// this `outgoing-body` may be retrieved at most once. Subsequent calls - /// will return error. - write: func() -> result; - - /// Finalize an outgoing body, optionally providing trailers. This must be - /// called to signal that the response is complete. If the `outgoing-body` - /// is dropped without calling `outgoing-body.finalize`, the implementation - /// should treat the body as corrupted. - /// - /// Fails if the body's `outgoing-request` or `outgoing-response` was - /// constructed with a Content-Length header, and the contents written - /// to the body (via `write`) does not match the value given in the - /// Content-Length. - finish: static func(this: outgoing-body, trailers: option) -> result<_, error-code>; - } - - /// Represents a future which may eventaully return an incoming HTTP - /// Response, or an error. - /// - /// This resource is returned by the `wasi:http/outgoing-handler` interface to - /// provide the HTTP Response corresponding to the sent Request. - resource future-incoming-response { - - /// Returns the incoming HTTP Response, or an error, once one is ready. - /// - /// The outer `option` represents future readiness. Users can wait on this - /// `option` to become `some` using the `subscribe` method. - /// - /// The outer `result` is used to retrieve the response or error at most - /// once. It will be success on the first call in which the outer option - /// is `some`, and error on subsequent calls. - /// - /// The inner `result` represents that either the incoming HTTP Response - /// status and headers have recieved successfully, or that an error - /// occured. Errors may also occur while consuming the response body, - /// but those will be reported by the `incoming-body` and its - /// `output-stream` child. - get: func() -> option>>; - - /// Returns a pollable which becomes ready when either the Response has - /// been received, or an error has occured. When this pollable is ready, - /// the `get` method will return `some`. - subscribe: func() -> pollable; - } - - /// Attempts to extract a http-related `error` from the wasi:io `error` - /// provided. - /// - /// Stream operations which return - /// `wasi:io/stream/stream-error::last-operation-failed` have a payload of - /// type `wasi:io/error/error` with more information about the operation - /// that failed. This payload can be passed through to this function to see - /// if there's http-related information about the error to return. - /// - /// Note that this function is fallible because not all io-errors are - /// http-related errors. - http-error-code: func(err: borrow) -> option; - } - - /// This interface defines a handler of incoming HTTP Requests. It should - /// be exported by components which can respond to HTTP Requests. - interface incoming-handler { - use types.{incoming-request}; - use types.{response-outparam}; - - /// This function is invoked with an incoming HTTP Request, and a resource - /// `response-outparam` which provides the capability to reply with an HTTP - /// Response. The response is sent by calling the `response-outparam.set` - /// method, which allows execution to continue after the response has been - /// sent. This enables both streaming to the response body, and performing other - /// work. - /// - /// The implementor of this function must write a response to the - /// `response-outparam` before returning, or else the caller will respond - /// with an error on its behalf. - handle: func(request: incoming-request, response-out: response-outparam); - } - - /// This interface defines a handler of outgoing HTTP Requests. It should be - /// imported by components which wish to make HTTP Requests. - interface outgoing-handler { - use types.{outgoing-request}; - use types.{request-options}; - use types.{future-incoming-response}; - use types.{error-code}; - - /// This function is invoked with an outgoing HTTP Request, and it returns - /// a resource `future-incoming-response` which represents an HTTP Response - /// which may arrive in the future. - /// - /// The `options` argument accepts optional parameters for the HTTP - /// protocol's transport layer. - /// - /// This function may return an error if the `outgoing-request` is invalid - /// or not allowed to be made. Otherwise, protocol errors are reported - /// through the `future-incoming-response`. - handle: func(request: outgoing-request, options: option) -> result; - } -} - -package wasi:io@0.2.0 { - interface poll { - resource pollable { - block: func(); - ready: func() -> bool; - } - poll: func(in: list>) -> list; - } - - interface error { - resource error { - to-debug-string: func() -> string; - } - } - - interface streams { - use error.{error}; - use poll.{pollable}; - variant stream-error { - last-operation-failed(error), - closed, - } - resource input-stream { - blocking-read: func(len: u64) -> result, stream-error>; - blocking-skip: func(len: u64) -> result; - read: func(len: u64) -> result, stream-error>; - skip: func(len: u64) -> result; - subscribe: func() -> pollable; - } - resource output-stream { - blocking-flush: func() -> result<_, stream-error>; - blocking-splice: func(src: borrow, len: u64) -> result; - blocking-write-and-flush: func(contents: list) -> result<_, stream-error>; - blocking-write-zeroes-and-flush: func(len: u64) -> result<_, stream-error>; - check-write: func() -> result; - flush: func() -> result<_, stream-error>; - splice: func(src: borrow, len: u64) -> result; - subscribe: func() -> pollable; - write: func(contents: list) -> result<_, stream-error>; - write-zeroes: func(len: u64) -> result<_, stream-error>; - } - } -} - -package wasi:logging@0.1.0-draft { - interface logging { - enum level { - trace, - debug, - info, - warn, - error, - critical - } - log: func(level: level, context: string, message: string); - } -} - -package wasi:random@0.2.0 { - interface random { - get-random-bytes: func(len: u64) -> list; - get-random-u64: func() -> u64; - } - - interface insecure { - get-insecure-random-bytes: func(len: u64) -> list; - get-insecure-random-u64: func() -> u64; - } - - interface insecure-seed { - insecure-seed: func() -> tuple; - } -} - -package wasi:sockets@0.2.0 { - interface network { - resource network; - enum error-code { - unknown, - access-denied, - not-supported, - invalid-argument, - out-of-memory, - timeout, - concurrency-conflict, - not-in-progress, - would-block, - invalid-state, - new-socket-limit, - address-not-bindable, - address-in-use, - remote-unreachable, - connection-refused, - connection-reset, - connection-aborted, - datagram-too-large, - name-unresolvable, - temporary-resolver-failure, - permanent-resolver-failure - } - enum ip-address-family { ipv4, ipv6 } - type ipv4-address = tuple; - type ipv6-address = tuple; - variant ip-address { - ipv4(ipv4-address), - ipv6(ipv6-address), - } - record ipv4-socket-address { - port: u16, - address: ipv4-address, - } - record ipv6-socket-address { - port: u16, - flow-info: u32, - address: ipv6-address, - scope-id: u32, - } - variant ip-socket-address { - ipv4(ipv4-socket-address), - ipv6(ipv6-socket-address), - } - } - - interface instance-network { - use network.{network}; - instance-network: func() -> network; - } - - interface udp { - use wasi:io/poll@0.2.0.{pollable}; - use network.{network}; - use network.{error-code}; - use network.{ip-socket-address}; - use network.{ip-address-family}; - record incoming-datagram { - data: list, - remote-address: ip-socket-address, - } - record outgoing-datagram { - data: list, - remote-address: option, - } - resource udp-socket { - address-family: func() -> ip-address-family; - finish-bind: func() -> result<_, error-code>; - local-address: func() -> result; - receive-buffer-size: func() -> result; - remote-address: func() -> result; - send-buffer-size: func() -> result; - set-receive-buffer-size: func(value: u64) -> result<_, error-code>; - set-send-buffer-size: func(value: u64) -> result<_, error-code>; - set-unicast-hop-limit: func(value: u8) -> result<_, error-code>; - start-bind: func(network: borrow, local-address: ip-socket-address) -> result<_, error-code>; - %stream: func(remote-address: option) -> result, error-code>; - subscribe: func() -> pollable; - unicast-hop-limit: func() -> result; - } - resource incoming-datagram-stream { - receive: func(max-results: u64) -> result, error-code>; - subscribe: func() -> pollable; - } - resource outgoing-datagram-stream { - check-send: func() -> result; - send: func(datagrams: list) -> result; - subscribe: func() -> pollable; - } - } - - interface udp-create-socket { - use network.{network}; - use network.{error-code}; - use network.{ip-address-family}; - use udp.{udp-socket}; - create-udp-socket: func(address-family: ip-address-family) -> result; - } - - interface tcp { - use wasi:io/streams@0.2.0.{input-stream}; - use wasi:io/streams@0.2.0.{output-stream}; - use wasi:io/poll@0.2.0.{pollable}; - use wasi:clocks/monotonic-clock@0.2.0.{duration}; - use network.{network}; - use network.{error-code}; - use network.{ip-socket-address}; - use network.{ip-address-family}; - enum shutdown-type { receive, send, both } - resource tcp-socket { - accept: func() -> result, error-code>; - address-family: func() -> ip-address-family; - finish-bind: func() -> result<_, error-code>; - finish-connect: func() -> result, error-code>; - finish-listen: func() -> result<_, error-code>; - hop-limit: func() -> result; - is-listening: func() -> bool; - keep-alive-count: func() -> result; - keep-alive-enabled: func() -> result; - keep-alive-idle-time: func() -> result; - keep-alive-interval: func() -> result; - local-address: func() -> result; - receive-buffer-size: func() -> result; - remote-address: func() -> result; - send-buffer-size: func() -> result; - set-hop-limit: func(value: u8) -> result<_, error-code>; - set-keep-alive-count: func(value: u32) -> result<_, error-code>; - set-keep-alive-enabled: func(value: bool) -> result<_, error-code>; - set-keep-alive-idle-time: func(value: duration) -> result<_, error-code>; - set-keep-alive-interval: func(value: duration) -> result<_, error-code>; - set-listen-backlog-size: func(value: u64) -> result<_, error-code>; - set-receive-buffer-size: func(value: u64) -> result<_, error-code>; - set-send-buffer-size: func(value: u64) -> result<_, error-code>; - shutdown: func(shutdown-type: shutdown-type) -> result<_, error-code>; - start-bind: func(network: borrow, local-address: ip-socket-address) -> result<_, error-code>; - start-connect: func(network: borrow, remote-address: ip-socket-address) -> result<_, error-code>; - start-listen: func() -> result<_, error-code>; - subscribe: func() -> pollable; - } - } - - interface tcp-create-socket { - use network.{network}; - use network.{error-code}; - use network.{ip-address-family}; - use tcp.{tcp-socket}; - create-tcp-socket: func(address-family: ip-address-family) -> result; - } - - interface ip-name-lookup { - use wasi:io/poll@0.2.0.{pollable}; - use network.{network}; - use network.{error-code}; - use network.{ip-address}; - resource resolve-address-stream { - resolve-next-address: func() -> result, error-code>; - subscribe: func() -> pollable; - } - resolve-addresses: func(network: borrow, name: string) -> result; - } -} - -package wasmcloud:bus@1.0.0 { - interface lattice { - resource call-target-interface { - constructor(namespace: string, %package: string, %interface: string); - } - set-link-name: func(name: string, interfaces: list); - } -} - -package wasmcloud:secrets@0.1.0-draft { - interface store { - variant secrets-error { - upstream(string), - io(string), - not-found, - } - variant secret-value { - %string(string), - bytes(list), - } - resource secret; - get: func(key: string) -> result; - } - - interface reveal { - use store.{secret}; - use store.{secret-value}; - reveal: func(s: borrow) -> secret-value; - } -} diff --git a/examples/component/http-client/gen/example/http-client/example/example.wit.go b/examples/component/http-client/gen/example/http-client/example/example.wit.go deleted file mode 100755 index 0b592383..00000000 --- a/examples/component/http-client/gen/example/http-client/example/example.wit.go +++ /dev/null @@ -1,4 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package example represents the world "example:http-client/example". -package example diff --git a/examples/component/http-client/gen/wasi/cli/environment/empty.s b/examples/component/http-client/gen/wasi/cli/environment/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/cli/environment/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/cli/environment/environment.wasm.go b/examples/component/http-client/gen/wasi/cli/environment/environment.wasm.go deleted file mode 100755 index b4c02ba4..00000000 --- a/examples/component/http-client/gen/wasi/cli/environment/environment.wasm.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package environment - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/environment@0.2.0 get-environment -//go:noescape -func wasmimport_GetEnvironment() - -//go:wasmimport wasi:cli/environment@0.2.0 get-arguments -//go:noescape -func wasmimport_GetArguments() - -//go:wasmimport wasi:cli/environment@0.2.0 initial-cwd -//go:noescape -func wasmimport_InitialCWD() diff --git a/examples/component/http-client/gen/wasi/cli/environment/environment.wit.go b/examples/component/http-client/gen/wasi/cli/environment/environment.wit.go deleted file mode 100755 index 7d1f8133..00000000 --- a/examples/component/http-client/gen/wasi/cli/environment/environment.wit.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package environment represents the imported interface "wasi:cli/environment@0.2.0". -package environment - -// GetEnvironment represents the imported function "get-environment". -// -// get-environment: func() -// -//go:nosplit -func GetEnvironment() { - wasmimport_GetEnvironment() - return -} - -// GetArguments represents the imported function "get-arguments". -// -// get-arguments: func() -// -//go:nosplit -func GetArguments() { - wasmimport_GetArguments() - return -} - -// InitialCWD represents the imported function "initial-cwd". -// -// initial-cwd: func() -// -//go:nosplit -func InitialCWD() { - wasmimport_InitialCWD() - return -} diff --git a/examples/component/http-client/gen/wasi/cli/exit/empty.s b/examples/component/http-client/gen/wasi/cli/exit/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/cli/exit/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/cli/exit/exit.wasm.go b/examples/component/http-client/gen/wasi/cli/exit/exit.wasm.go deleted file mode 100755 index 849d5f50..00000000 --- a/examples/component/http-client/gen/wasi/cli/exit/exit.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package exit - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/exit@0.2.0 exit -//go:noescape -func wasmimport_Exit(status0 uint32) diff --git a/examples/component/http-client/gen/wasi/cli/exit/exit.wit.go b/examples/component/http-client/gen/wasi/cli/exit/exit.wit.go deleted file mode 100755 index 7a347b60..00000000 --- a/examples/component/http-client/gen/wasi/cli/exit/exit.wit.go +++ /dev/null @@ -1,19 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package exit represents the imported interface "wasi:cli/exit@0.2.0". -package exit - -import ( - "go.bytecodealliance.org/cm" -) - -// Exit represents the imported function "exit". -// -// exit: func(status: result) -// -//go:nosplit -func Exit(status cm.BoolResult) { - status0 := (uint32)(cm.BoolToU32(status)) - wasmimport_Exit((uint32)(status0)) - return -} diff --git a/examples/component/http-client/gen/wasi/cli/stderr/empty.s b/examples/component/http-client/gen/wasi/cli/stderr/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/cli/stderr/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/cli/stderr/stderr.wasm.go b/examples/component/http-client/gen/wasi/cli/stderr/stderr.wasm.go deleted file mode 100755 index 9c5bcdb9..00000000 --- a/examples/component/http-client/gen/wasi/cli/stderr/stderr.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package stderr - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/stderr@0.2.0 get-stderr -//go:noescape -func wasmimport_GetStderr() diff --git a/examples/component/http-client/gen/wasi/cli/stderr/stderr.wit.go b/examples/component/http-client/gen/wasi/cli/stderr/stderr.wit.go deleted file mode 100755 index c124719e..00000000 --- a/examples/component/http-client/gen/wasi/cli/stderr/stderr.wit.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package stderr represents the imported interface "wasi:cli/stderr@0.2.0". -package stderr - -import ( - "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/io/streams" -) - -// OutputStream represents the imported type alias "wasi:cli/stderr@0.2.0#output-stream". -// -// See [streams.OutputStream] for more information. -type OutputStream = streams.OutputStream - -// GetStderr represents the imported function "get-stderr". -// -// get-stderr: func() -// -//go:nosplit -func GetStderr() { - wasmimport_GetStderr() - return -} diff --git a/examples/component/http-client/gen/wasi/cli/stdin/empty.s b/examples/component/http-client/gen/wasi/cli/stdin/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/cli/stdin/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/cli/stdin/stdin.wasm.go b/examples/component/http-client/gen/wasi/cli/stdin/stdin.wasm.go deleted file mode 100755 index 090f2e31..00000000 --- a/examples/component/http-client/gen/wasi/cli/stdin/stdin.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package stdin - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/stdin@0.2.0 get-stdin -//go:noescape -func wasmimport_GetStdin() diff --git a/examples/component/http-client/gen/wasi/cli/stdin/stdin.wit.go b/examples/component/http-client/gen/wasi/cli/stdin/stdin.wit.go deleted file mode 100755 index 4fb261bf..00000000 --- a/examples/component/http-client/gen/wasi/cli/stdin/stdin.wit.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package stdin represents the imported interface "wasi:cli/stdin@0.2.0". -package stdin - -import ( - "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/io/streams" -) - -// InputStream represents the imported type alias "wasi:cli/stdin@0.2.0#input-stream". -// -// See [streams.InputStream] for more information. -type InputStream = streams.InputStream - -// GetStdin represents the imported function "get-stdin". -// -// get-stdin: func() -// -//go:nosplit -func GetStdin() { - wasmimport_GetStdin() - return -} diff --git a/examples/component/http-client/gen/wasi/cli/stdout/empty.s b/examples/component/http-client/gen/wasi/cli/stdout/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/cli/stdout/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/cli/stdout/stdout.wasm.go b/examples/component/http-client/gen/wasi/cli/stdout/stdout.wasm.go deleted file mode 100755 index 1a1a2650..00000000 --- a/examples/component/http-client/gen/wasi/cli/stdout/stdout.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package stdout - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/stdout@0.2.0 get-stdout -//go:noescape -func wasmimport_GetStdout() diff --git a/examples/component/http-client/gen/wasi/cli/stdout/stdout.wit.go b/examples/component/http-client/gen/wasi/cli/stdout/stdout.wit.go deleted file mode 100755 index a0a16fb0..00000000 --- a/examples/component/http-client/gen/wasi/cli/stdout/stdout.wit.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package stdout represents the imported interface "wasi:cli/stdout@0.2.0". -package stdout - -import ( - "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/io/streams" -) - -// OutputStream represents the imported type alias "wasi:cli/stdout@0.2.0#output-stream". -// -// See [streams.OutputStream] for more information. -type OutputStream = streams.OutputStream - -// GetStdout represents the imported function "get-stdout". -// -// get-stdout: func() -// -//go:nosplit -func GetStdout() { - wasmimport_GetStdout() - return -} diff --git a/examples/component/http-client/gen/wasi/cli/terminal-input/empty.s b/examples/component/http-client/gen/wasi/cli/terminal-input/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/cli/terminal-input/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/cli/terminal-input/terminal-input.wit.go b/examples/component/http-client/gen/wasi/cli/terminal-input/terminal-input.wit.go deleted file mode 100755 index 18b9a9d7..00000000 --- a/examples/component/http-client/gen/wasi/cli/terminal-input/terminal-input.wit.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package terminalinput represents the imported interface "wasi:cli/terminal-input@0.2.0". -package terminalinput - -import ( - "go.bytecodealliance.org/cm" -) - -// TerminalInput represents the imported resource "wasi:cli/terminal-input@0.2.0#terminal-input". -// -// resource terminal-input -type TerminalInput cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "terminal-input". -// -// Drops a resource handle. -// -//go:nosplit -func (self TerminalInput) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TerminalInputResourceDrop((uint32)(self0)) - return -} diff --git a/examples/component/http-client/gen/wasi/cli/terminal-input/terminalinput.wasm.go b/examples/component/http-client/gen/wasi/cli/terminal-input/terminalinput.wasm.go deleted file mode 100755 index 1df3794f..00000000 --- a/examples/component/http-client/gen/wasi/cli/terminal-input/terminalinput.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package terminalinput - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/terminal-input@0.2.0 [resource-drop]terminal-input -//go:noescape -func wasmimport_TerminalInputResourceDrop(self0 uint32) diff --git a/examples/component/http-client/gen/wasi/cli/terminal-output/empty.s b/examples/component/http-client/gen/wasi/cli/terminal-output/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/cli/terminal-output/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/cli/terminal-output/terminal-output.wit.go b/examples/component/http-client/gen/wasi/cli/terminal-output/terminal-output.wit.go deleted file mode 100755 index 823aaf52..00000000 --- a/examples/component/http-client/gen/wasi/cli/terminal-output/terminal-output.wit.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package terminaloutput represents the imported interface "wasi:cli/terminal-output@0.2.0". -package terminaloutput - -import ( - "go.bytecodealliance.org/cm" -) - -// TerminalOutput represents the imported resource "wasi:cli/terminal-output@0.2.0#terminal-output". -// -// resource terminal-output -type TerminalOutput cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "terminal-output". -// -// Drops a resource handle. -// -//go:nosplit -func (self TerminalOutput) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TerminalOutputResourceDrop((uint32)(self0)) - return -} diff --git a/examples/component/http-client/gen/wasi/cli/terminal-output/terminaloutput.wasm.go b/examples/component/http-client/gen/wasi/cli/terminal-output/terminaloutput.wasm.go deleted file mode 100755 index fb35fc41..00000000 --- a/examples/component/http-client/gen/wasi/cli/terminal-output/terminaloutput.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package terminaloutput - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/terminal-output@0.2.0 [resource-drop]terminal-output -//go:noescape -func wasmimport_TerminalOutputResourceDrop(self0 uint32) diff --git a/examples/component/http-client/gen/wasi/cli/terminal-stderr/empty.s b/examples/component/http-client/gen/wasi/cli/terminal-stderr/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/cli/terminal-stderr/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go b/examples/component/http-client/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go deleted file mode 100755 index 76a4b8cb..00000000 --- a/examples/component/http-client/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package terminalstderr represents the imported interface "wasi:cli/terminal-stderr@0.2.0". -package terminalstderr - -import ( - terminaloutput "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/cli/terminal-output" -) - -// TerminalOutput represents the imported type alias "wasi:cli/terminal-stderr@0.2.0#terminal-output". -// -// See [terminaloutput.TerminalOutput] for more information. -type TerminalOutput = terminaloutput.TerminalOutput - -// GetTerminalStderr represents the imported function "get-terminal-stderr". -// -// get-terminal-stderr: func() -// -//go:nosplit -func GetTerminalStderr() { - wasmimport_GetTerminalStderr() - return -} diff --git a/examples/component/http-client/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go b/examples/component/http-client/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go deleted file mode 100755 index 03cbe909..00000000 --- a/examples/component/http-client/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package terminalstderr - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/terminal-stderr@0.2.0 get-terminal-stderr -//go:noescape -func wasmimport_GetTerminalStderr() diff --git a/examples/component/http-client/gen/wasi/cli/terminal-stdin/empty.s b/examples/component/http-client/gen/wasi/cli/terminal-stdin/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/cli/terminal-stdin/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go b/examples/component/http-client/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go deleted file mode 100755 index 8f74fdb2..00000000 --- a/examples/component/http-client/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package terminalstdin represents the imported interface "wasi:cli/terminal-stdin@0.2.0". -package terminalstdin - -import ( - terminalinput "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/cli/terminal-input" -) - -// TerminalInput represents the imported type alias "wasi:cli/terminal-stdin@0.2.0#terminal-input". -// -// See [terminalinput.TerminalInput] for more information. -type TerminalInput = terminalinput.TerminalInput - -// GetTerminalStdin represents the imported function "get-terminal-stdin". -// -// get-terminal-stdin: func() -// -//go:nosplit -func GetTerminalStdin() { - wasmimport_GetTerminalStdin() - return -} diff --git a/examples/component/http-client/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go b/examples/component/http-client/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go deleted file mode 100755 index 1a59d9fd..00000000 --- a/examples/component/http-client/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package terminalstdin - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/terminal-stdin@0.2.0 get-terminal-stdin -//go:noescape -func wasmimport_GetTerminalStdin() diff --git a/examples/component/http-client/gen/wasi/cli/terminal-stdout/empty.s b/examples/component/http-client/gen/wasi/cli/terminal-stdout/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/cli/terminal-stdout/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go b/examples/component/http-client/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go deleted file mode 100755 index 088721c1..00000000 --- a/examples/component/http-client/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package terminalstdout represents the imported interface "wasi:cli/terminal-stdout@0.2.0". -package terminalstdout - -import ( - terminaloutput "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/cli/terminal-output" -) - -// TerminalOutput represents the imported type alias "wasi:cli/terminal-stdout@0.2.0#terminal-output". -// -// See [terminaloutput.TerminalOutput] for more information. -type TerminalOutput = terminaloutput.TerminalOutput - -// GetTerminalStdout represents the imported function "get-terminal-stdout". -// -// get-terminal-stdout: func() -// -//go:nosplit -func GetTerminalStdout() { - wasmimport_GetTerminalStdout() - return -} diff --git a/examples/component/http-client/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go b/examples/component/http-client/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go deleted file mode 100755 index c45db1d2..00000000 --- a/examples/component/http-client/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package terminalstdout - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/terminal-stdout@0.2.0 get-terminal-stdout -//go:noescape -func wasmimport_GetTerminalStdout() diff --git a/examples/component/http-client/gen/wasi/clocks/monotonic-clock/empty.s b/examples/component/http-client/gen/wasi/clocks/monotonic-clock/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/clocks/monotonic-clock/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go b/examples/component/http-client/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go deleted file mode 100755 index d7e40039..00000000 --- a/examples/component/http-client/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package monotonicclock represents the imported interface "wasi:clocks/monotonic-clock@0.2.0". -package monotonicclock - -import ( - "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/io/poll" -) - -// Pollable represents the imported type alias "wasi:clocks/monotonic-clock@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// Instant represents the u64 "wasi:clocks/monotonic-clock@0.2.0#instant". -// -// type instant = u64 -type Instant uint64 - -// Duration represents the u64 "wasi:clocks/monotonic-clock@0.2.0#duration". -// -// type duration = u64 -type Duration uint64 - -// Now represents the imported function "now". -// -// now: func() -// -//go:nosplit -func Now() { - wasmimport_Now() - return -} - -// Resolution represents the imported function "resolution". -// -// resolution: func() -// -//go:nosplit -func Resolution() { - wasmimport_Resolution() - return -} - -// SubscribeInstant represents the imported function "subscribe-instant". -// -// subscribe-instant: func(when: instant) -// -//go:nosplit -func SubscribeInstant(when Instant) { - when0 := (uint64)(when) - wasmimport_SubscribeInstant((uint64)(when0)) - return -} - -// SubscribeDuration represents the imported function "subscribe-duration". -// -// subscribe-duration: func(when: duration) -// -//go:nosplit -func SubscribeDuration(when Duration) { - when0 := (uint64)(when) - wasmimport_SubscribeDuration((uint64)(when0)) - return -} diff --git a/examples/component/http-client/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go b/examples/component/http-client/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go deleted file mode 100755 index 4494c61a..00000000 --- a/examples/component/http-client/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package monotonicclock - -// This file contains wasmimport and wasmexport declarations for "wasi:clocks@0.2.0". - -//go:wasmimport wasi:clocks/monotonic-clock@0.2.0 now -//go:noescape -func wasmimport_Now() - -//go:wasmimport wasi:clocks/monotonic-clock@0.2.0 resolution -//go:noescape -func wasmimport_Resolution() - -//go:wasmimport wasi:clocks/monotonic-clock@0.2.0 subscribe-instant -//go:noescape -func wasmimport_SubscribeInstant(when0 uint64) - -//go:wasmimport wasi:clocks/monotonic-clock@0.2.0 subscribe-duration -//go:noescape -func wasmimport_SubscribeDuration(when0 uint64) diff --git a/examples/component/http-client/gen/wasi/clocks/wall-clock/empty.s b/examples/component/http-client/gen/wasi/clocks/wall-clock/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/clocks/wall-clock/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/clocks/wall-clock/wall-clock.wit.go b/examples/component/http-client/gen/wasi/clocks/wall-clock/wall-clock.wit.go deleted file mode 100755 index 308f0910..00000000 --- a/examples/component/http-client/gen/wasi/clocks/wall-clock/wall-clock.wit.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package wallclock represents the imported interface "wasi:clocks/wall-clock@0.2.0". -package wallclock - -import ( - "go.bytecodealliance.org/cm" -) - -// DateTime represents the record "wasi:clocks/wall-clock@0.2.0#datetime". -// -// record datetime { -// seconds: u64, -// nanoseconds: u32, -// } -type DateTime struct { - _ cm.HostLayout - Seconds uint64 - Nanoseconds uint32 -} - -// Now represents the imported function "now". -// -// now: func() -// -//go:nosplit -func Now() { - wasmimport_Now() - return -} - -// Resolution represents the imported function "resolution". -// -// resolution: func() -// -//go:nosplit -func Resolution() { - wasmimport_Resolution() - return -} diff --git a/examples/component/http-client/gen/wasi/clocks/wall-clock/wallclock.wasm.go b/examples/component/http-client/gen/wasi/clocks/wall-clock/wallclock.wasm.go deleted file mode 100755 index 4efbaf84..00000000 --- a/examples/component/http-client/gen/wasi/clocks/wall-clock/wallclock.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package wallclock - -// This file contains wasmimport and wasmexport declarations for "wasi:clocks@0.2.0". - -//go:wasmimport wasi:clocks/wall-clock@0.2.0 now -//go:noescape -func wasmimport_Now() - -//go:wasmimport wasi:clocks/wall-clock@0.2.0 resolution -//go:noescape -func wasmimport_Resolution() diff --git a/examples/component/http-client/gen/wasi/config/runtime/abi.go b/examples/component/http-client/gen/wasi/config/runtime/abi.go deleted file mode 100755 index 61412cbe..00000000 --- a/examples/component/http-client/gen/wasi/config/runtime/abi.go +++ /dev/null @@ -1,20 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package runtime - -import ( - "go.bytecodealliance.org/cm" - "unsafe" -) - -// OptionStringShape is used for storage in variant or result types. -type OptionStringShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Option[string]{})]byte -} - -// ConfigErrorShape is used for storage in variant or result types. -type ConfigErrorShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(ConfigError{})]byte -} diff --git a/examples/component/http-client/gen/wasi/config/runtime/empty.s b/examples/component/http-client/gen/wasi/config/runtime/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/config/runtime/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/config/runtime/runtime.wasm.go b/examples/component/http-client/gen/wasi/config/runtime/runtime.wasm.go deleted file mode 100755 index 4abfb286..00000000 --- a/examples/component/http-client/gen/wasi/config/runtime/runtime.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package runtime - -// This file contains wasmimport and wasmexport declarations for "wasi:config@0.2.0-draft". - -//go:wasmimport wasi:config/runtime@0.2.0-draft get -//go:noescape -func wasmimport_Get(key0 *uint8, key1 uint32) - -//go:wasmimport wasi:config/runtime@0.2.0-draft get-all -//go:noescape -func wasmimport_GetAll() diff --git a/examples/component/http-client/gen/wasi/config/runtime/runtime.wit.go b/examples/component/http-client/gen/wasi/config/runtime/runtime.wit.go deleted file mode 100755 index 204a5c0c..00000000 --- a/examples/component/http-client/gen/wasi/config/runtime/runtime.wit.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package runtime represents the imported interface "wasi:config/runtime@0.2.0-draft". -package runtime - -import ( - "go.bytecodealliance.org/cm" -) - -// ConfigError represents the variant "wasi:config/runtime@0.2.0-draft#config-error". -// -// variant config-error { -// upstream(string), -// io(string), -// } -type ConfigError cm.Variant[uint8, string, string] - -// ConfigErrorUpstream returns a [ConfigError] of case "upstream". -func ConfigErrorUpstream(data string) ConfigError { - return cm.New[ConfigError](0, data) -} - -// Upstream returns a non-nil *[string] if [ConfigError] represents the variant case "upstream". -func (self *ConfigError) Upstream() *string { - return cm.Case[string](self, 0) -} - -// ConfigErrorIO returns a [ConfigError] of case "io". -func ConfigErrorIO(data string) ConfigError { - return cm.New[ConfigError](1, data) -} - -// IO returns a non-nil *[string] if [ConfigError] represents the variant case "io". -func (self *ConfigError) IO() *string { - return cm.Case[string](self, 1) -} - -var stringsConfigError = [2]string{ - "upstream", - "io", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v ConfigError) String() string { - return stringsConfigError[v.Tag()] -} - -// Get represents the imported function "get". -// -// get: func(key: string) -// -//go:nosplit -func Get(key string) { - key0, key1 := cm.LowerString(key) - wasmimport_Get((*uint8)(key0), (uint32)(key1)) - return -} - -// GetAll represents the imported function "get-all". -// -// get-all: func() -// -//go:nosplit -func GetAll() { - wasmimport_GetAll() - return -} diff --git a/examples/component/http-client/gen/wasi/filesystem/preopens/empty.s b/examples/component/http-client/gen/wasi/filesystem/preopens/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/filesystem/preopens/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/filesystem/preopens/preopens.wasm.go b/examples/component/http-client/gen/wasi/filesystem/preopens/preopens.wasm.go deleted file mode 100755 index 50885ee0..00000000 --- a/examples/component/http-client/gen/wasi/filesystem/preopens/preopens.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package preopens - -// This file contains wasmimport and wasmexport declarations for "wasi:filesystem@0.2.0". - -//go:wasmimport wasi:filesystem/preopens@0.2.0 get-directories -//go:noescape -func wasmimport_GetDirectories() diff --git a/examples/component/http-client/gen/wasi/filesystem/preopens/preopens.wit.go b/examples/component/http-client/gen/wasi/filesystem/preopens/preopens.wit.go deleted file mode 100755 index edbff5a2..00000000 --- a/examples/component/http-client/gen/wasi/filesystem/preopens/preopens.wit.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package preopens represents the imported interface "wasi:filesystem/preopens@0.2.0". -package preopens - -import ( - "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/filesystem/types" -) - -// Descriptor represents the imported type alias "wasi:filesystem/preopens@0.2.0#descriptor". -// -// See [types.Descriptor] for more information. -type Descriptor = types.Descriptor - -// GetDirectories represents the imported function "get-directories". -// -// get-directories: func() -// -//go:nosplit -func GetDirectories() { - wasmimport_GetDirectories() - return -} diff --git a/examples/component/http-client/gen/wasi/filesystem/types/abi.go b/examples/component/http-client/gen/wasi/filesystem/types/abi.go deleted file mode 100755 index fd744592..00000000 --- a/examples/component/http-client/gen/wasi/filesystem/types/abi.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package types - -import ( - wallclock "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/clocks/wall-clock" - "go.bytecodealliance.org/cm" -) - -func lower_DateTime(v wallclock.DateTime) (f0 uint64, f1 uint32) { - f0 = (uint64)(v.Seconds) - f1 = (uint32)(v.Nanoseconds) - return -} - -func lower_NewTimestamp(v NewTimestamp) (f0 uint32, f1 uint64, f2 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 2: // timestamp - v1, v2 := lower_DateTime(*cm.Case[DateTime](&v, 2)) - f1 = (uint64)(v1) - f2 = (uint32)(v2) - } - return -} diff --git a/examples/component/http-client/gen/wasi/filesystem/types/empty.s b/examples/component/http-client/gen/wasi/filesystem/types/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/filesystem/types/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/filesystem/types/types.wasm.go b/examples/component/http-client/gen/wasi/filesystem/types/types.wasm.go deleted file mode 100755 index 7a2b9993..00000000 --- a/examples/component/http-client/gen/wasi/filesystem/types/types.wasm.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package types - -// This file contains wasmimport and wasmexport declarations for "wasi:filesystem@0.2.0". - -//go:wasmimport wasi:filesystem/types@0.2.0 [resource-drop]descriptor -//go:noescape -func wasmimport_DescriptorResourceDrop(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.advise -//go:noescape -func wasmimport_DescriptorAdvise(self0 uint32, offset0 uint64, length0 uint64, advice0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.append-via-stream -//go:noescape -func wasmimport_DescriptorAppendViaStream(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.create-directory-at -//go:noescape -func wasmimport_DescriptorCreateDirectoryAt(self0 uint32, path0 *uint8, path1 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.get-flags -//go:noescape -func wasmimport_DescriptorGetFlags(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.get-type -//go:noescape -func wasmimport_DescriptorGetType(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.is-same-object -//go:noescape -func wasmimport_DescriptorIsSameObject(self0 uint32, other0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.link-at -//go:noescape -func wasmimport_DescriptorLinkAt(self0 uint32, oldPathFlags0 uint32, oldPath0 *uint8, oldPath1 uint32, newDescriptor0 uint32, newPath0 *uint8, newPath1 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.metadata-hash -//go:noescape -func wasmimport_DescriptorMetadataHash(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.metadata-hash-at -//go:noescape -func wasmimport_DescriptorMetadataHashAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.open-at -//go:noescape -func wasmimport_DescriptorOpenAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, openFlags0 uint32, flags0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.read -//go:noescape -func wasmimport_DescriptorRead(self0 uint32, length0 uint64, offset0 uint64) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.read-directory -//go:noescape -func wasmimport_DescriptorReadDirectory(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.read-via-stream -//go:noescape -func wasmimport_DescriptorReadViaStream(self0 uint32, offset0 uint64) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.readlink-at -//go:noescape -func wasmimport_DescriptorReadLinkAt(self0 uint32, path0 *uint8, path1 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.remove-directory-at -//go:noescape -func wasmimport_DescriptorRemoveDirectoryAt(self0 uint32, path0 *uint8, path1 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.rename-at -//go:noescape -func wasmimport_DescriptorRenameAt(self0 uint32, oldPath0 *uint8, oldPath1 uint32, newDescriptor0 uint32, newPath0 *uint8, newPath1 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.set-size -//go:noescape -func wasmimport_DescriptorSetSize(self0 uint32, size0 uint64) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.set-times -//go:noescape -func wasmimport_DescriptorSetTimes(self0 uint32, dataAccessTimestamp0 uint32, dataAccessTimestamp1 uint64, dataAccessTimestamp2 uint32, dataModificationTimestamp0 uint32, dataModificationTimestamp1 uint64, dataModificationTimestamp2 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.set-times-at -//go:noescape -func wasmimport_DescriptorSetTimesAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, dataAccessTimestamp0 uint32, dataAccessTimestamp1 uint64, dataAccessTimestamp2 uint32, dataModificationTimestamp0 uint32, dataModificationTimestamp1 uint64, dataModificationTimestamp2 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.stat -//go:noescape -func wasmimport_DescriptorStat(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.stat-at -//go:noescape -func wasmimport_DescriptorStatAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.symlink-at -//go:noescape -func wasmimport_DescriptorSymlinkAt(self0 uint32, oldPath0 *uint8, oldPath1 uint32, newPath0 *uint8, newPath1 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.sync -//go:noescape -func wasmimport_DescriptorSync(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.sync-data -//go:noescape -func wasmimport_DescriptorSyncData(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.unlink-file-at -//go:noescape -func wasmimport_DescriptorUnlinkFileAt(self0 uint32, path0 *uint8, path1 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.write -//go:noescape -func wasmimport_DescriptorWrite(self0 uint32, buffer0 *uint8, buffer1 uint32, offset0 uint64) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.write-via-stream -//go:noescape -func wasmimport_DescriptorWriteViaStream(self0 uint32, offset0 uint64) - -//go:wasmimport wasi:filesystem/types@0.2.0 [resource-drop]directory-entry-stream -//go:noescape -func wasmimport_DirectoryEntryStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]directory-entry-stream.read-directory-entry -//go:noescape -func wasmimport_DirectoryEntryStreamReadDirectoryEntry(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 filesystem-error-code -//go:noescape -func wasmimport_FilesystemErrorCode(err0 uint32) diff --git a/examples/component/http-client/gen/wasi/filesystem/types/types.wit.go b/examples/component/http-client/gen/wasi/filesystem/types/types.wit.go deleted file mode 100755 index 7e4f8ee7..00000000 --- a/examples/component/http-client/gen/wasi/filesystem/types/types.wit.go +++ /dev/null @@ -1,783 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package types represents the imported interface "wasi:filesystem/types@0.2.0". -package types - -import ( - wallclock "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/clocks/wall-clock" - "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/io/streams" - "go.bytecodealliance.org/cm" -) - -// InputStream represents the imported type alias "wasi:filesystem/types@0.2.0#input-stream". -// -// See [streams.InputStream] for more information. -type InputStream = streams.InputStream - -// OutputStream represents the imported type alias "wasi:filesystem/types@0.2.0#output-stream". -// -// See [streams.OutputStream] for more information. -type OutputStream = streams.OutputStream - -// Error represents the imported type alias "wasi:filesystem/types@0.2.0#error". -// -// See [streams.Error] for more information. -type Error = streams.Error - -// DateTime represents the type alias "wasi:filesystem/types@0.2.0#datetime". -// -// See [wallclock.DateTime] for more information. -type DateTime = wallclock.DateTime - -// FileSize represents the u64 "wasi:filesystem/types@0.2.0#filesize". -// -// type filesize = u64 -type FileSize uint64 - -// DescriptorType represents the enum "wasi:filesystem/types@0.2.0#descriptor-type". -// -// enum descriptor-type { -// unknown, -// block-device, -// character-device, -// directory, -// fifo, -// symbolic-link, -// regular-file, -// socket -// } -type DescriptorType uint8 - -const ( - DescriptorTypeUnknown DescriptorType = iota - DescriptorTypeBlockDevice - DescriptorTypeCharacterDevice - DescriptorTypeDirectory - DescriptorTypeFIFO - DescriptorTypeSymbolicLink - DescriptorTypeRegularFile - DescriptorTypeSocket -) - -var stringsDescriptorType = [8]string{ - "unknown", - "block-device", - "character-device", - "directory", - "fifo", - "symbolic-link", - "regular-file", - "socket", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e DescriptorType) String() string { - return stringsDescriptorType[e] -} - -// DescriptorFlags represents the flags "wasi:filesystem/types@0.2.0#descriptor-flags". -// -// flags descriptor-flags { -// read, -// write, -// file-integrity-sync, -// data-integrity-sync, -// requested-write-sync, -// mutate-directory, -// } -type DescriptorFlags uint8 - -const ( - DescriptorFlagsRead DescriptorFlags = 1 << iota - DescriptorFlagsWrite - DescriptorFlagsFileIntegritySync - DescriptorFlagsDataIntegritySync - DescriptorFlagsRequestedWriteSync - DescriptorFlagsMutateDirectory -) - -// PathFlags represents the flags "wasi:filesystem/types@0.2.0#path-flags". -// -// flags path-flags { -// symlink-follow, -// } -type PathFlags uint8 - -const ( - PathFlagsSymlinkFollow PathFlags = 1 << iota -) - -// OpenFlags represents the flags "wasi:filesystem/types@0.2.0#open-flags". -// -// flags open-flags { -// create, -// directory, -// exclusive, -// truncate, -// } -type OpenFlags uint8 - -const ( - OpenFlagsCreate OpenFlags = 1 << iota - OpenFlagsDirectory - OpenFlagsExclusive - OpenFlagsTruncate -) - -// LinkCount represents the u64 "wasi:filesystem/types@0.2.0#link-count". -// -// type link-count = u64 -type LinkCount uint64 - -// DescriptorStat represents the record "wasi:filesystem/types@0.2.0#descriptor-stat". -// -// record descriptor-stat { -// %type: descriptor-type, -// link-count: link-count, -// size: filesize, -// data-access-timestamp: option, -// data-modification-timestamp: option, -// status-change-timestamp: option, -// } -type DescriptorStat struct { - _ cm.HostLayout - Type DescriptorType - LinkCount LinkCount - Size FileSize - DataAccessTimestamp cm.Option[DateTime] - DataModificationTimestamp cm.Option[DateTime] - StatusChangeTimestamp cm.Option[DateTime] -} - -// NewTimestamp represents the variant "wasi:filesystem/types@0.2.0#new-timestamp". -// -// variant new-timestamp { -// no-change, -// now, -// timestamp(datetime), -// } -type NewTimestamp cm.Variant[uint8, DateTime, DateTime] - -// NewTimestampNoChange returns a [NewTimestamp] of case "no-change". -func NewTimestampNoChange() NewTimestamp { - var data struct{} - return cm.New[NewTimestamp](0, data) -} - -// NoChange returns true if [NewTimestamp] represents the variant case "no-change". -func (self *NewTimestamp) NoChange() bool { - return self.Tag() == 0 -} - -// NewTimestampNow returns a [NewTimestamp] of case "now". -func NewTimestampNow() NewTimestamp { - var data struct{} - return cm.New[NewTimestamp](1, data) -} - -// Now returns true if [NewTimestamp] represents the variant case "now". -func (self *NewTimestamp) Now() bool { - return self.Tag() == 1 -} - -// NewTimestampTimestamp returns a [NewTimestamp] of case "timestamp". -func NewTimestampTimestamp(data DateTime) NewTimestamp { - return cm.New[NewTimestamp](2, data) -} - -// Timestamp returns a non-nil *[DateTime] if [NewTimestamp] represents the variant case "timestamp". -func (self *NewTimestamp) Timestamp() *DateTime { - return cm.Case[DateTime](self, 2) -} - -var stringsNewTimestamp = [3]string{ - "no-change", - "now", - "timestamp", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v NewTimestamp) String() string { - return stringsNewTimestamp[v.Tag()] -} - -// DirectoryEntry represents the record "wasi:filesystem/types@0.2.0#directory-entry". -// -// record directory-entry { -// %type: descriptor-type, -// name: string, -// } -type DirectoryEntry struct { - _ cm.HostLayout - Type DescriptorType - Name string -} - -// ErrorCode represents the enum "wasi:filesystem/types@0.2.0#error-code". -// -// enum error-code { -// access, -// would-block, -// already, -// bad-descriptor, -// busy, -// deadlock, -// quota, -// exist, -// file-too-large, -// illegal-byte-sequence, -// in-progress, -// interrupted, -// invalid, -// io, -// is-directory, -// loop, -// too-many-links, -// message-size, -// name-too-long, -// no-device, -// no-entry, -// no-lock, -// insufficient-memory, -// insufficient-space, -// not-directory, -// not-empty, -// not-recoverable, -// unsupported, -// no-tty, -// no-such-device, -// overflow, -// not-permitted, -// pipe, -// read-only, -// invalid-seek, -// text-file-busy, -// cross-device -// } -type ErrorCode uint8 - -const ( - ErrorCodeAccess ErrorCode = iota - ErrorCodeWouldBlock - ErrorCodeAlready - ErrorCodeBadDescriptor - ErrorCodeBusy - ErrorCodeDeadlock - ErrorCodeQuota - ErrorCodeExist - ErrorCodeFileTooLarge - ErrorCodeIllegalByteSequence - ErrorCodeInProgress - ErrorCodeInterrupted - ErrorCodeInvalid - ErrorCodeIO - ErrorCodeIsDirectory - ErrorCodeLoop - ErrorCodeTooManyLinks - ErrorCodeMessageSize - ErrorCodeNameTooLong - ErrorCodeNoDevice - ErrorCodeNoEntry - ErrorCodeNoLock - ErrorCodeInsufficientMemory - ErrorCodeInsufficientSpace - ErrorCodeNotDirectory - ErrorCodeNotEmpty - ErrorCodeNotRecoverable - ErrorCodeUnsupported - ErrorCodeNoTTY - ErrorCodeNoSuchDevice - ErrorCodeOverflow - ErrorCodeNotPermitted - ErrorCodePipe - ErrorCodeReadOnly - ErrorCodeInvalidSeek - ErrorCodeTextFileBusy - ErrorCodeCrossDevice -) - -var stringsErrorCode = [37]string{ - "access", - "would-block", - "already", - "bad-descriptor", - "busy", - "deadlock", - "quota", - "exist", - "file-too-large", - "illegal-byte-sequence", - "in-progress", - "interrupted", - "invalid", - "io", - "is-directory", - "loop", - "too-many-links", - "message-size", - "name-too-long", - "no-device", - "no-entry", - "no-lock", - "insufficient-memory", - "insufficient-space", - "not-directory", - "not-empty", - "not-recoverable", - "unsupported", - "no-tty", - "no-such-device", - "overflow", - "not-permitted", - "pipe", - "read-only", - "invalid-seek", - "text-file-busy", - "cross-device", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e ErrorCode) String() string { - return stringsErrorCode[e] -} - -// Advice represents the enum "wasi:filesystem/types@0.2.0#advice". -// -// enum advice { -// normal, -// sequential, -// random, -// will-need, -// dont-need, -// no-reuse -// } -type Advice uint8 - -const ( - AdviceNormal Advice = iota - AdviceSequential - AdviceRandom - AdviceWillNeed - AdviceDontNeed - AdviceNoReuse -) - -var stringsAdvice = [6]string{ - "normal", - "sequential", - "random", - "will-need", - "dont-need", - "no-reuse", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e Advice) String() string { - return stringsAdvice[e] -} - -// MetadataHashValue represents the record "wasi:filesystem/types@0.2.0#metadata-hash-value". -// -// record metadata-hash-value { -// lower: u64, -// upper: u64, -// } -type MetadataHashValue struct { - _ cm.HostLayout - Lower uint64 - Upper uint64 -} - -// Descriptor represents the imported resource "wasi:filesystem/types@0.2.0#descriptor". -// -// resource descriptor -type Descriptor cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "descriptor". -// -// Drops a resource handle. -// -//go:nosplit -func (self Descriptor) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorResourceDrop((uint32)(self0)) - return -} - -// Advise represents the imported method "advise". -// -// advise: func(offset: filesize, length: filesize, advice: advice) -// -//go:nosplit -func (self Descriptor) Advise(offset FileSize, length FileSize, advice Advice) { - self0 := cm.Reinterpret[uint32](self) - offset0 := (uint64)(offset) - length0 := (uint64)(length) - advice0 := (uint32)(advice) - wasmimport_DescriptorAdvise((uint32)(self0), (uint64)(offset0), (uint64)(length0), (uint32)(advice0)) - return -} - -// AppendViaStream represents the imported method "append-via-stream". -// -// append-via-stream: func() -// -//go:nosplit -func (self Descriptor) AppendViaStream() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorAppendViaStream((uint32)(self0)) - return -} - -// CreateDirectoryAt represents the imported method "create-directory-at". -// -// create-directory-at: func(path: string) -// -//go:nosplit -func (self Descriptor) CreateDirectoryAt(path string) { - self0 := cm.Reinterpret[uint32](self) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorCreateDirectoryAt((uint32)(self0), (*uint8)(path0), (uint32)(path1)) - return -} - -// GetFlags represents the imported method "get-flags". -// -// get-flags: func() -// -//go:nosplit -func (self Descriptor) GetFlags() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorGetFlags((uint32)(self0)) - return -} - -// GetType represents the imported method "get-type". -// -// get-type: func() -// -//go:nosplit -func (self Descriptor) GetType() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorGetType((uint32)(self0)) - return -} - -// IsSameObject represents the imported method "is-same-object". -// -// is-same-object: func(other: borrow) -// -//go:nosplit -func (self Descriptor) IsSameObject(other Descriptor) { - self0 := cm.Reinterpret[uint32](self) - other0 := cm.Reinterpret[uint32](other) - wasmimport_DescriptorIsSameObject((uint32)(self0), (uint32)(other0)) - return -} - -// LinkAt represents the imported method "link-at". -// -// link-at: func(old-path-flags: path-flags, old-path: string, new-descriptor: borrow, -// new-path: string) -// -//go:nosplit -func (self Descriptor) LinkAt(oldPathFlags PathFlags, oldPath string, newDescriptor Descriptor, newPath string) { - self0 := cm.Reinterpret[uint32](self) - oldPathFlags0 := (uint32)(oldPathFlags) - oldPath0, oldPath1 := cm.LowerString(oldPath) - newDescriptor0 := cm.Reinterpret[uint32](newDescriptor) - newPath0, newPath1 := cm.LowerString(newPath) - wasmimport_DescriptorLinkAt((uint32)(self0), (uint32)(oldPathFlags0), (*uint8)(oldPath0), (uint32)(oldPath1), (uint32)(newDescriptor0), (*uint8)(newPath0), (uint32)(newPath1)) - return -} - -// MetadataHash represents the imported method "metadata-hash". -// -// metadata-hash: func() -// -//go:nosplit -func (self Descriptor) MetadataHash() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorMetadataHash((uint32)(self0)) - return -} - -// MetadataHashAt represents the imported method "metadata-hash-at". -// -// metadata-hash-at: func(path-flags: path-flags, path: string) -// -//go:nosplit -func (self Descriptor) MetadataHashAt(pathFlags PathFlags, path string) { - self0 := cm.Reinterpret[uint32](self) - pathFlags0 := (uint32)(pathFlags) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorMetadataHashAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1)) - return -} - -// OpenAt represents the imported method "open-at". -// -// open-at: func(path-flags: path-flags, path: string, open-flags: open-flags, %flags: -// descriptor-flags) -// -//go:nosplit -func (self Descriptor) OpenAt(pathFlags PathFlags, path string, openFlags OpenFlags, flags DescriptorFlags) { - self0 := cm.Reinterpret[uint32](self) - pathFlags0 := (uint32)(pathFlags) - path0, path1 := cm.LowerString(path) - openFlags0 := (uint32)(openFlags) - flags0 := (uint32)(flags) - wasmimport_DescriptorOpenAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), (uint32)(openFlags0), (uint32)(flags0)) - return -} - -// Read represents the imported method "read". -// -// read: func(length: filesize, offset: filesize) -// -//go:nosplit -func (self Descriptor) Read(length FileSize, offset FileSize) { - self0 := cm.Reinterpret[uint32](self) - length0 := (uint64)(length) - offset0 := (uint64)(offset) - wasmimport_DescriptorRead((uint32)(self0), (uint64)(length0), (uint64)(offset0)) - return -} - -// ReadDirectory represents the imported method "read-directory". -// -// read-directory: func() -// -//go:nosplit -func (self Descriptor) ReadDirectory() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorReadDirectory((uint32)(self0)) - return -} - -// ReadViaStream represents the imported method "read-via-stream". -// -// read-via-stream: func(offset: filesize) -// -//go:nosplit -func (self Descriptor) ReadViaStream(offset FileSize) { - self0 := cm.Reinterpret[uint32](self) - offset0 := (uint64)(offset) - wasmimport_DescriptorReadViaStream((uint32)(self0), (uint64)(offset0)) - return -} - -// ReadLinkAt represents the imported method "readlink-at". -// -// readlink-at: func(path: string) -// -//go:nosplit -func (self Descriptor) ReadLinkAt(path string) { - self0 := cm.Reinterpret[uint32](self) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorReadLinkAt((uint32)(self0), (*uint8)(path0), (uint32)(path1)) - return -} - -// RemoveDirectoryAt represents the imported method "remove-directory-at". -// -// remove-directory-at: func(path: string) -// -//go:nosplit -func (self Descriptor) RemoveDirectoryAt(path string) { - self0 := cm.Reinterpret[uint32](self) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorRemoveDirectoryAt((uint32)(self0), (*uint8)(path0), (uint32)(path1)) - return -} - -// RenameAt represents the imported method "rename-at". -// -// rename-at: func(old-path: string, new-descriptor: borrow, new-path: -// string) -// -//go:nosplit -func (self Descriptor) RenameAt(oldPath string, newDescriptor Descriptor, newPath string) { - self0 := cm.Reinterpret[uint32](self) - oldPath0, oldPath1 := cm.LowerString(oldPath) - newDescriptor0 := cm.Reinterpret[uint32](newDescriptor) - newPath0, newPath1 := cm.LowerString(newPath) - wasmimport_DescriptorRenameAt((uint32)(self0), (*uint8)(oldPath0), (uint32)(oldPath1), (uint32)(newDescriptor0), (*uint8)(newPath0), (uint32)(newPath1)) - return -} - -// SetSize represents the imported method "set-size". -// -// set-size: func(size: filesize) -// -//go:nosplit -func (self Descriptor) SetSize(size FileSize) { - self0 := cm.Reinterpret[uint32](self) - size0 := (uint64)(size) - wasmimport_DescriptorSetSize((uint32)(self0), (uint64)(size0)) - return -} - -// SetTimes represents the imported method "set-times". -// -// set-times: func(data-access-timestamp: new-timestamp, data-modification-timestamp: -// new-timestamp) -// -//go:nosplit -func (self Descriptor) SetTimes(dataAccessTimestamp NewTimestamp, dataModificationTimestamp NewTimestamp) { - self0 := cm.Reinterpret[uint32](self) - dataAccessTimestamp0, dataAccessTimestamp1, dataAccessTimestamp2 := lower_NewTimestamp(dataAccessTimestamp) - dataModificationTimestamp0, dataModificationTimestamp1, dataModificationTimestamp2 := lower_NewTimestamp(dataModificationTimestamp) - wasmimport_DescriptorSetTimes((uint32)(self0), (uint32)(dataAccessTimestamp0), (uint64)(dataAccessTimestamp1), (uint32)(dataAccessTimestamp2), (uint32)(dataModificationTimestamp0), (uint64)(dataModificationTimestamp1), (uint32)(dataModificationTimestamp2)) - return -} - -// SetTimesAt represents the imported method "set-times-at". -// -// set-times-at: func(path-flags: path-flags, path: string, data-access-timestamp: -// new-timestamp, data-modification-timestamp: new-timestamp) -// -//go:nosplit -func (self Descriptor) SetTimesAt(pathFlags PathFlags, path string, dataAccessTimestamp NewTimestamp, dataModificationTimestamp NewTimestamp) { - self0 := cm.Reinterpret[uint32](self) - pathFlags0 := (uint32)(pathFlags) - path0, path1 := cm.LowerString(path) - dataAccessTimestamp0, dataAccessTimestamp1, dataAccessTimestamp2 := lower_NewTimestamp(dataAccessTimestamp) - dataModificationTimestamp0, dataModificationTimestamp1, dataModificationTimestamp2 := lower_NewTimestamp(dataModificationTimestamp) - wasmimport_DescriptorSetTimesAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), (uint32)(dataAccessTimestamp0), (uint64)(dataAccessTimestamp1), (uint32)(dataAccessTimestamp2), (uint32)(dataModificationTimestamp0), (uint64)(dataModificationTimestamp1), (uint32)(dataModificationTimestamp2)) - return -} - -// Stat represents the imported method "stat". -// -// stat: func() -// -//go:nosplit -func (self Descriptor) Stat() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorStat((uint32)(self0)) - return -} - -// StatAt represents the imported method "stat-at". -// -// stat-at: func(path-flags: path-flags, path: string) -// -//go:nosplit -func (self Descriptor) StatAt(pathFlags PathFlags, path string) { - self0 := cm.Reinterpret[uint32](self) - pathFlags0 := (uint32)(pathFlags) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorStatAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1)) - return -} - -// SymlinkAt represents the imported method "symlink-at". -// -// symlink-at: func(old-path: string, new-path: string) -// -//go:nosplit -func (self Descriptor) SymlinkAt(oldPath string, newPath string) { - self0 := cm.Reinterpret[uint32](self) - oldPath0, oldPath1 := cm.LowerString(oldPath) - newPath0, newPath1 := cm.LowerString(newPath) - wasmimport_DescriptorSymlinkAt((uint32)(self0), (*uint8)(oldPath0), (uint32)(oldPath1), (*uint8)(newPath0), (uint32)(newPath1)) - return -} - -// Sync represents the imported method "sync". -// -// sync: func() -// -//go:nosplit -func (self Descriptor) Sync() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorSync((uint32)(self0)) - return -} - -// SyncData represents the imported method "sync-data". -// -// sync-data: func() -// -//go:nosplit -func (self Descriptor) SyncData() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorSyncData((uint32)(self0)) - return -} - -// UnlinkFileAt represents the imported method "unlink-file-at". -// -// unlink-file-at: func(path: string) -// -//go:nosplit -func (self Descriptor) UnlinkFileAt(path string) { - self0 := cm.Reinterpret[uint32](self) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorUnlinkFileAt((uint32)(self0), (*uint8)(path0), (uint32)(path1)) - return -} - -// Write represents the imported method "write". -// -// write: func(buffer: list, offset: filesize) -// -//go:nosplit -func (self Descriptor) Write(buffer cm.List[uint8], offset FileSize) { - self0 := cm.Reinterpret[uint32](self) - buffer0, buffer1 := cm.LowerList(buffer) - offset0 := (uint64)(offset) - wasmimport_DescriptorWrite((uint32)(self0), (*uint8)(buffer0), (uint32)(buffer1), (uint64)(offset0)) - return -} - -// WriteViaStream represents the imported method "write-via-stream". -// -// write-via-stream: func(offset: filesize) -// -//go:nosplit -func (self Descriptor) WriteViaStream(offset FileSize) { - self0 := cm.Reinterpret[uint32](self) - offset0 := (uint64)(offset) - wasmimport_DescriptorWriteViaStream((uint32)(self0), (uint64)(offset0)) - return -} - -// DirectoryEntryStream represents the imported resource "wasi:filesystem/types@0.2.0#directory-entry-stream". -// -// resource directory-entry-stream -type DirectoryEntryStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "directory-entry-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self DirectoryEntryStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DirectoryEntryStreamResourceDrop((uint32)(self0)) - return -} - -// ReadDirectoryEntry represents the imported method "read-directory-entry". -// -// read-directory-entry: func() -// -//go:nosplit -func (self DirectoryEntryStream) ReadDirectoryEntry() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DirectoryEntryStreamReadDirectoryEntry((uint32)(self0)) - return -} - -// FilesystemErrorCode represents the imported function "filesystem-error-code". -// -// filesystem-error-code: func(err: borrow) -// -//go:nosplit -func FilesystemErrorCode(err Error) { - err0 := cm.Reinterpret[uint32](err) - wasmimport_FilesystemErrorCode((uint32)(err0)) - return -} diff --git a/examples/component/http-client/gen/wasi/http/incoming-handler/empty.s b/examples/component/http-client/gen/wasi/http/incoming-handler/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/http/incoming-handler/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/http/incoming-handler/incoming-handler.exports.go b/examples/component/http-client/gen/wasi/http/incoming-handler/incoming-handler.exports.go deleted file mode 100755 index 673ccb48..00000000 --- a/examples/component/http-client/gen/wasi/http/incoming-handler/incoming-handler.exports.go +++ /dev/null @@ -1,22 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package incominghandler - -// Exports represents the caller-defined exports from "wasi:http/incoming-handler@0.2.0". -var Exports struct { - // Handle represents the caller-defined, exported function "handle". - // - // This function is invoked with an incoming HTTP Request, and a resource - // `response-outparam` which provides the capability to reply with an HTTP - // Response. The response is sent by calling the `response-outparam.set` - // method, which allows execution to continue after the response has been - // sent. This enables both streaming to the response body, and performing other - // work. - // - // The implementor of this function must write a response to the - // `response-outparam` before returning, or else the caller will respond - // with an error on its behalf. - // - // handle: func(request: incoming-request, response-out: response-outparam) - Handle func(request IncomingRequest, responseOut ResponseOutparam) -} diff --git a/examples/component/http-client/gen/wasi/http/incoming-handler/incoming-handler.wit.go b/examples/component/http-client/gen/wasi/http/incoming-handler/incoming-handler.wit.go deleted file mode 100755 index 7491198f..00000000 --- a/examples/component/http-client/gen/wasi/http/incoming-handler/incoming-handler.wit.go +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package incominghandler represents the exported interface "wasi:http/incoming-handler@0.2.0". -// -// This interface defines a handler of incoming HTTP Requests. It should -// be exported by components which can respond to HTTP Requests. -package incominghandler - -import ( - "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/http/types" -) - -// IncomingRequest represents the exported type alias "wasi:http/incoming-handler@0.2.0#incoming-request". -// -// See [types.IncomingRequest] for more information. -type IncomingRequest = types.IncomingRequest - -// ResponseOutparam represents the exported type alias "wasi:http/incoming-handler@0.2.0#response-outparam". -// -// See [types.ResponseOutparam] for more information. -type ResponseOutparam = types.ResponseOutparam diff --git a/examples/component/http-client/gen/wasi/http/incoming-handler/incominghandler.wasm.go b/examples/component/http-client/gen/wasi/http/incoming-handler/incominghandler.wasm.go deleted file mode 100755 index eae429f3..00000000 --- a/examples/component/http-client/gen/wasi/http/incoming-handler/incominghandler.wasm.go +++ /dev/null @@ -1,18 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package incominghandler - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:http@0.2.0". - -//go:wasmexport wasi:http/incoming-handler@0.2.0#handle -//export wasi:http/incoming-handler@0.2.0#handle -func wasmexport_Handle(request0 uint32, responseOut0 uint32) { - request := cm.Reinterpret[IncomingRequest]((uint32)(request0)) - responseOut := cm.Reinterpret[ResponseOutparam]((uint32)(responseOut0)) - Exports.Handle(request, responseOut) - return -} diff --git a/examples/component/http-client/gen/wasi/http/outgoing-handler/abi.go b/examples/component/http-client/gen/wasi/http/outgoing-handler/abi.go deleted file mode 100755 index 5c6a7b48..00000000 --- a/examples/component/http-client/gen/wasi/http/outgoing-handler/abi.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package outgoinghandler - -import ( - "go.bytecodealliance.org/cm" -) - -func lower_OptionRequestOptions(v cm.Option[RequestOptions]) (f0 uint32, f1 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := cm.Reinterpret[uint32](*some) - f1 = (uint32)(v1) - } - return -} diff --git a/examples/component/http-client/gen/wasi/http/outgoing-handler/empty.s b/examples/component/http-client/gen/wasi/http/outgoing-handler/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/http/outgoing-handler/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go b/examples/component/http-client/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go deleted file mode 100755 index de0882f0..00000000 --- a/examples/component/http-client/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package outgoinghandler represents the imported interface "wasi:http/outgoing-handler@0.2.0". -// -// This interface defines a handler of outgoing HTTP Requests. It should be -// imported by components which wish to make HTTP Requests. -package outgoinghandler - -import ( - "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/http/types" - "go.bytecodealliance.org/cm" -) - -// OutgoingRequest represents the imported type alias "wasi:http/outgoing-handler@0.2.0#outgoing-request". -// -// See [types.OutgoingRequest] for more information. -type OutgoingRequest = types.OutgoingRequest - -// RequestOptions represents the imported type alias "wasi:http/outgoing-handler@0.2.0#request-options". -// -// See [types.RequestOptions] for more information. -type RequestOptions = types.RequestOptions - -// FutureIncomingResponse represents the imported type alias "wasi:http/outgoing-handler@0.2.0#future-incoming-response". -// -// See [types.FutureIncomingResponse] for more information. -type FutureIncomingResponse = types.FutureIncomingResponse - -// ErrorCode represents the type alias "wasi:http/outgoing-handler@0.2.0#error-code". -// -// See [types.ErrorCode] for more information. -type ErrorCode = types.ErrorCode - -// Handle represents the imported function "handle". -// -// This function is invoked with an outgoing HTTP Request, and it returns -// a resource `future-incoming-response` which represents an HTTP Response -// which may arrive in the future. -// -// The `options` argument accepts optional parameters for the HTTP -// protocol's transport layer. -// -// This function may return an error if the `outgoing-request` is invalid -// or not allowed to be made. Otherwise, protocol errors are reported -// through the `future-incoming-response`. -// -// handle: func(request: outgoing-request, options: option) -// -//go:nosplit -func Handle(request OutgoingRequest, options cm.Option[RequestOptions]) { - request0 := cm.Reinterpret[uint32](request) - options0, options1 := lower_OptionRequestOptions(options) - wasmimport_Handle((uint32)(request0), (uint32)(options0), (uint32)(options1)) - return -} diff --git a/examples/component/http-client/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go b/examples/component/http-client/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go deleted file mode 100755 index 1f362c2a..00000000 --- a/examples/component/http-client/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package outgoinghandler - -// This file contains wasmimport and wasmexport declarations for "wasi:http@0.2.0". - -//go:wasmimport wasi:http/outgoing-handler@0.2.0 handle -//go:noescape -func wasmimport_Handle(request0 uint32, options0 uint32, options1 uint32) diff --git a/examples/component/http-client/gen/wasi/http/types/abi.go b/examples/component/http-client/gen/wasi/http/types/abi.go deleted file mode 100755 index 6ffb1fdd..00000000 --- a/examples/component/http-client/gen/wasi/http/types/abi.go +++ /dev/null @@ -1,264 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package types - -import ( - "go.bytecodealliance.org/cm" - "unsafe" -) - -// OptionFieldSizePayloadShape is used for storage in variant or result types. -type OptionFieldSizePayloadShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Option[FieldSizePayload]{})]byte -} - -func lower_OptionString(v cm.Option[string]) (f0 uint32, f1 *uint8, f2 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1, v2 := cm.LowerString(*some) - f1 = (*uint8)(v1) - f2 = (uint32)(v2) - } - return -} - -func lower_Method(v Method) (f0 uint32, f1 *uint8, f2 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 9: // other - v1, v2 := cm.LowerString(*cm.Case[string](&v, 9)) - f1 = (*uint8)(v1) - f2 = (uint32)(v2) - } - return -} - -func lower_Scheme(v Scheme) (f0 uint32, f1 *uint8, f2 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 2: // other - v1, v2 := cm.LowerString(*cm.Case[string](&v, 2)) - f1 = (*uint8)(v1) - f2 = (uint32)(v2) - } - return -} - -func lower_OptionScheme(v cm.Option[Scheme]) (f0 uint32, f1 uint32, f2 *uint8, f3 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1, v2, v3 := lower_Scheme(*some) - f1 = (uint32)(v1) - f2 = (*uint8)(v2) - f3 = (uint32)(v3) - } - return -} - -func lower_OptionDuration(v cm.Option[Duration]) (f0 uint32, f1 uint64) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := (uint64)(*some) - f1 = (uint64)(v1) - } - return -} - -// ErrorCodeShape is used for storage in variant or result types. -type ErrorCodeShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(ErrorCode{})]byte -} - -func lower_OptionU16(v cm.Option[uint16]) (f0 uint32, f1 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := (uint32)(*some) - f1 = (uint32)(v1) - } - return -} - -func lower_DNSErrorPayload(v DNSErrorPayload) (f0 uint32, f1 *uint8, f2 uint32, f3 uint32, f4 uint32) { - f0, f1, f2 = lower_OptionString(v.Rcode) - f3, f4 = lower_OptionU16(v.InfoCode) - return -} - -func lower_OptionU8(v cm.Option[uint8]) (f0 uint32, f1 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := (uint32)(*some) - f1 = (uint32)(v1) - } - return -} - -func lower_TLSAlertReceivedPayload(v TLSAlertReceivedPayload) (f0 uint32, f1 uint32, f2 uint32, f3 *uint8, f4 uint32) { - f0, f1 = lower_OptionU8(v.AlertID) - f2, f3, f4 = lower_OptionString(v.AlertMessage) - return -} - -func lower_OptionU64(v cm.Option[uint64]) (f0 uint32, f1 uint64) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := (uint64)(*some) - f1 = (uint64)(v1) - } - return -} - -func lower_OptionU32(v cm.Option[uint32]) (f0 uint32, f1 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := (uint32)(*some) - f1 = (uint32)(v1) - } - return -} - -func lower_FieldSizePayload(v FieldSizePayload) (f0 uint32, f1 *uint8, f2 uint32, f3 uint32, f4 uint32) { - f0, f1, f2 = lower_OptionString(v.FieldName) - f3, f4 = lower_OptionU32(v.FieldSize) - return -} - -func lower_OptionFieldSizePayload(v cm.Option[FieldSizePayload]) (f0 uint32, f1 uint32, f2 *uint8, f3 uint32, f4 uint32, f5 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1, v2, v3, v4, v5 := lower_FieldSizePayload(*some) - f1 = (uint32)(v1) - f2 = (*uint8)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - } - return -} - -func lower_ErrorCode(v ErrorCode) (f0 uint32, f1 uint32, f2 uint64, f3 uint32, f4 uint32, f5 uint32, f6 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 1: // DNS-error - v1, v2, v3, v4, v5 := lower_DNSErrorPayload(*cm.Case[DNSErrorPayload](&v, 1)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 14: // TLS-alert-received - v1, v2, v3, v4, v5 := lower_TLSAlertReceivedPayload(*cm.Case[TLSAlertReceivedPayload](&v, 14)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(cm.PointerToU32(v4)) - f5 = (uint32)(v5) - case 17: // HTTP-request-body-size - v1, v2 := lower_OptionU64(*cm.Case[cm.Option[uint64]](&v, 17)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 21: // HTTP-request-header-section-size - v1, v2 := lower_OptionU32(*cm.Case[cm.Option[uint32]](&v, 21)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 22: // HTTP-request-header-size - v1, v2, v3, v4, v5, v6 := lower_OptionFieldSizePayload(*cm.Case[cm.Option[FieldSizePayload]](&v, 22)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - f3 = (uint32)(cm.PointerToU32(v3)) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - f6 = (uint32)(v6) - case 23: // HTTP-request-trailer-section-size - v1, v2 := lower_OptionU32(*cm.Case[cm.Option[uint32]](&v, 23)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 24: // HTTP-request-trailer-size - v1, v2, v3, v4, v5 := lower_FieldSizePayload(*cm.Case[FieldSizePayload](&v, 24)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 26: // HTTP-response-header-section-size - v1, v2 := lower_OptionU32(*cm.Case[cm.Option[uint32]](&v, 26)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 27: // HTTP-response-header-size - v1, v2, v3, v4, v5 := lower_FieldSizePayload(*cm.Case[FieldSizePayload](&v, 27)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 28: // HTTP-response-body-size - v1, v2 := lower_OptionU64(*cm.Case[cm.Option[uint64]](&v, 28)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 29: // HTTP-response-trailer-section-size - v1, v2 := lower_OptionU32(*cm.Case[cm.Option[uint32]](&v, 29)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 30: // HTTP-response-trailer-size - v1, v2, v3, v4, v5 := lower_FieldSizePayload(*cm.Case[FieldSizePayload](&v, 30)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 31: // HTTP-response-transfer-coding - v1, v2, v3 := lower_OptionString(*cm.Case[cm.Option[string]](&v, 31)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - case 32: // HTTP-response-content-coding - v1, v2, v3 := lower_OptionString(*cm.Case[cm.Option[string]](&v, 32)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - case 38: // internal-error - v1, v2, v3 := lower_OptionString(*cm.Case[cm.Option[string]](&v, 38)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - } - return -} - -func lower_ResultOutgoingResponseErrorCode(v cm.Result[ErrorCodeShape, OutgoingResponse, ErrorCode]) (f0 uint32, f1 uint32, f2 uint32, f3 uint64, f4 uint32, f5 uint32, f6 uint32, f7 uint32) { - if v.IsOK() { - v1 := cm.Reinterpret[uint32](*v.OK()) - f1 = (uint32)(v1) - } else { - f0 = 1 - v1, v2, v3, v4, v5, v6, v7 := lower_ErrorCode(*v.Err()) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint64)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - f6 = (uint32)(v6) - f7 = (uint32)(v7) - } - return -} - -func lower_OptionTrailers(v cm.Option[Trailers]) (f0 uint32, f1 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := cm.Reinterpret[uint32](*some) - f1 = (uint32)(v1) - } - return -} diff --git a/examples/component/http-client/gen/wasi/http/types/empty.s b/examples/component/http-client/gen/wasi/http/types/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/http/types/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/http/types/types.wasm.go b/examples/component/http-client/gen/wasi/http/types/types.wasm.go deleted file mode 100755 index 584e55ae..00000000 --- a/examples/component/http-client/gen/wasi/http/types/types.wasm.go +++ /dev/null @@ -1,257 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package types - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:http@0.2.0". - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]fields -//go:noescape -func wasmimport_FieldsResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [constructor]fields -//go:noescape -func wasmimport_NewFields() - -//go:wasmimport wasi:http/types@0.2.0 [static]fields.from-list -//go:noescape -func wasmimport_FieldsFromList(entries0 *cm.Tuple[FieldKey, FieldValue], entries1 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.append -//go:noescape -func wasmimport_FieldsAppend(self0 uint32, name0 *uint8, name1 uint32, value0 *uint8, value1 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.clone -//go:noescape -func wasmimport_FieldsClone(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.delete -//go:noescape -func wasmimport_FieldsDelete(self0 uint32, name0 *uint8, name1 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.entries -//go:noescape -func wasmimport_FieldsEntries(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.get -//go:noescape -func wasmimport_FieldsGet(self0 uint32, name0 *uint8, name1 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.has -//go:noescape -func wasmimport_FieldsHas(self0 uint32, name0 *uint8, name1 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.set -//go:noescape -func wasmimport_FieldsSet(self0 uint32, name0 *uint8, name1 uint32, value0 *FieldValue, value1 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]incoming-request -//go:noescape -func wasmimport_IncomingRequestResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.authority -//go:noescape -func wasmimport_IncomingRequestAuthority(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.consume -//go:noescape -func wasmimport_IncomingRequestConsume(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.headers -//go:noescape -func wasmimport_IncomingRequestHeaders(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.method -//go:noescape -func wasmimport_IncomingRequestMethod(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.path-with-query -//go:noescape -func wasmimport_IncomingRequestPathWithQuery(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.scheme -//go:noescape -func wasmimport_IncomingRequestScheme(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]outgoing-request -//go:noescape -func wasmimport_OutgoingRequestResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [constructor]outgoing-request -//go:noescape -func wasmimport_NewOutgoingRequest(headers0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.authority -//go:noescape -func wasmimport_OutgoingRequestAuthority(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.body -//go:noescape -func wasmimport_OutgoingRequestBody(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.headers -//go:noescape -func wasmimport_OutgoingRequestHeaders(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.method -//go:noescape -func wasmimport_OutgoingRequestMethod(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.path-with-query -//go:noescape -func wasmimport_OutgoingRequestPathWithQuery(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.scheme -//go:noescape -func wasmimport_OutgoingRequestScheme(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-authority -//go:noescape -func wasmimport_OutgoingRequestSetAuthority(self0 uint32, authority0 uint32, authority1 *uint8, authority2 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-method -//go:noescape -func wasmimport_OutgoingRequestSetMethod(self0 uint32, method0 uint32, method1 *uint8, method2 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-path-with-query -//go:noescape -func wasmimport_OutgoingRequestSetPathWithQuery(self0 uint32, pathWithQuery0 uint32, pathWithQuery1 *uint8, pathWithQuery2 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-scheme -//go:noescape -func wasmimport_OutgoingRequestSetScheme(self0 uint32, scheme0 uint32, scheme1 uint32, scheme2 *uint8, scheme3 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]request-options -//go:noescape -func wasmimport_RequestOptionsResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [constructor]request-options -//go:noescape -func wasmimport_NewRequestOptions() - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.between-bytes-timeout -//go:noescape -func wasmimport_RequestOptionsBetweenBytesTimeout(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.connect-timeout -//go:noescape -func wasmimport_RequestOptionsConnectTimeout(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.first-byte-timeout -//go:noescape -func wasmimport_RequestOptionsFirstByteTimeout(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.set-between-bytes-timeout -//go:noescape -func wasmimport_RequestOptionsSetBetweenBytesTimeout(self0 uint32, duration0 uint32, duration1 uint64) - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.set-connect-timeout -//go:noescape -func wasmimport_RequestOptionsSetConnectTimeout(self0 uint32, duration0 uint32, duration1 uint64) - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.set-first-byte-timeout -//go:noescape -func wasmimport_RequestOptionsSetFirstByteTimeout(self0 uint32, duration0 uint32, duration1 uint64) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]response-outparam -//go:noescape -func wasmimport_ResponseOutparamResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [static]response-outparam.set -//go:noescape -func wasmimport_ResponseOutparamSet(param0 uint32, response0 uint32, response1 uint32, response2 uint32, response3 uint64, response4 uint32, response5 uint32, response6 uint32, response7 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]incoming-response -//go:noescape -func wasmimport_IncomingResponseResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-response.consume -//go:noescape -func wasmimport_IncomingResponseConsume(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-response.headers -//go:noescape -func wasmimport_IncomingResponseHeaders(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-response.status -//go:noescape -func wasmimport_IncomingResponseStatus(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]incoming-body -//go:noescape -func wasmimport_IncomingBodyResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [static]incoming-body.finish -//go:noescape -func wasmimport_IncomingBodyFinish(this0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-body.stream -//go:noescape -func wasmimport_IncomingBodyStream(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]future-trailers -//go:noescape -func wasmimport_FutureTrailersResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]future-trailers.get -//go:noescape -func wasmimport_FutureTrailersGet(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]future-trailers.subscribe -//go:noescape -func wasmimport_FutureTrailersSubscribe(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]outgoing-response -//go:noescape -func wasmimport_OutgoingResponseResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [constructor]outgoing-response -//go:noescape -func wasmimport_NewOutgoingResponse(headers0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.body -//go:noescape -func wasmimport_OutgoingResponseBody(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.headers -//go:noescape -func wasmimport_OutgoingResponseHeaders(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.set-status-code -//go:noescape -func wasmimport_OutgoingResponseSetStatusCode(self0 uint32, statusCode0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.status-code -//go:noescape -func wasmimport_OutgoingResponseStatusCode(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]outgoing-body -//go:noescape -func wasmimport_OutgoingBodyResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [static]outgoing-body.finish -//go:noescape -func wasmimport_OutgoingBodyFinish(this0 uint32, trailers0 uint32, trailers1 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-body.write -//go:noescape -func wasmimport_OutgoingBodyWrite(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]future-incoming-response -//go:noescape -func wasmimport_FutureIncomingResponseResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]future-incoming-response.get -//go:noescape -func wasmimport_FutureIncomingResponseGet(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]future-incoming-response.subscribe -//go:noescape -func wasmimport_FutureIncomingResponseSubscribe(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 http-error-code -//go:noescape -func wasmimport_HTTPErrorCode(err0 uint32) diff --git a/examples/component/http-client/gen/wasi/http/types/types.wit.go b/examples/component/http-client/gen/wasi/http/types/types.wit.go deleted file mode 100755 index 72670385..00000000 --- a/examples/component/http-client/gen/wasi/http/types/types.wit.go +++ /dev/null @@ -1,1982 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package types represents the imported interface "wasi:http/types@0.2.0". -// -// This interface defines all of the types and methods for implementing -// HTTP Requests and Responses, both incoming and outgoing, as well as -// their headers, trailers, and bodies. -package types - -import ( - monotonicclock "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/clocks/monotonic-clock" - ioerror "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/io/error" - "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/io/poll" - "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/io/streams" - "go.bytecodealliance.org/cm" -) - -// Duration represents the type alias "wasi:http/types@0.2.0#duration". -// -// See [monotonicclock.Duration] for more information. -type Duration = monotonicclock.Duration - -// InputStream represents the imported type alias "wasi:http/types@0.2.0#input-stream". -// -// See [streams.InputStream] for more information. -type InputStream = streams.InputStream - -// OutputStream represents the imported type alias "wasi:http/types@0.2.0#output-stream". -// -// See [streams.OutputStream] for more information. -type OutputStream = streams.OutputStream - -// IOError represents the imported type alias "wasi:http/types@0.2.0#io-error". -// -// See [ioerror.Error] for more information. -type IOError = ioerror.Error - -// Pollable represents the imported type alias "wasi:http/types@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// Method represents the variant "wasi:http/types@0.2.0#method". -// -// This type corresponds to HTTP standard Methods. -// -// variant method { -// get, -// head, -// post, -// put, -// delete, -// connect, -// options, -// trace, -// patch, -// other(string), -// } -type Method cm.Variant[uint8, string, string] - -// MethodGet returns a [Method] of case "get". -func MethodGet() Method { - var data struct{} - return cm.New[Method](0, data) -} - -// Get returns true if [Method] represents the variant case "get". -func (self *Method) Get() bool { - return self.Tag() == 0 -} - -// MethodHead returns a [Method] of case "head". -func MethodHead() Method { - var data struct{} - return cm.New[Method](1, data) -} - -// Head returns true if [Method] represents the variant case "head". -func (self *Method) Head() bool { - return self.Tag() == 1 -} - -// MethodPost returns a [Method] of case "post". -func MethodPost() Method { - var data struct{} - return cm.New[Method](2, data) -} - -// Post returns true if [Method] represents the variant case "post". -func (self *Method) Post() bool { - return self.Tag() == 2 -} - -// MethodPut returns a [Method] of case "put". -func MethodPut() Method { - var data struct{} - return cm.New[Method](3, data) -} - -// Put returns true if [Method] represents the variant case "put". -func (self *Method) Put() bool { - return self.Tag() == 3 -} - -// MethodDelete returns a [Method] of case "delete". -func MethodDelete() Method { - var data struct{} - return cm.New[Method](4, data) -} - -// Delete returns true if [Method] represents the variant case "delete". -func (self *Method) Delete() bool { - return self.Tag() == 4 -} - -// MethodConnect returns a [Method] of case "connect". -func MethodConnect() Method { - var data struct{} - return cm.New[Method](5, data) -} - -// Connect returns true if [Method] represents the variant case "connect". -func (self *Method) Connect() bool { - return self.Tag() == 5 -} - -// MethodOptions returns a [Method] of case "options". -func MethodOptions() Method { - var data struct{} - return cm.New[Method](6, data) -} - -// Options returns true if [Method] represents the variant case "options". -func (self *Method) Options() bool { - return self.Tag() == 6 -} - -// MethodTrace returns a [Method] of case "trace". -func MethodTrace() Method { - var data struct{} - return cm.New[Method](7, data) -} - -// Trace returns true if [Method] represents the variant case "trace". -func (self *Method) Trace() bool { - return self.Tag() == 7 -} - -// MethodPatch returns a [Method] of case "patch". -func MethodPatch() Method { - var data struct{} - return cm.New[Method](8, data) -} - -// Patch returns true if [Method] represents the variant case "patch". -func (self *Method) Patch() bool { - return self.Tag() == 8 -} - -// MethodOther returns a [Method] of case "other". -func MethodOther(data string) Method { - return cm.New[Method](9, data) -} - -// Other returns a non-nil *[string] if [Method] represents the variant case "other". -func (self *Method) Other() *string { - return cm.Case[string](self, 9) -} - -var stringsMethod = [10]string{ - "get", - "head", - "post", - "put", - "delete", - "connect", - "options", - "trace", - "patch", - "other", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v Method) String() string { - return stringsMethod[v.Tag()] -} - -// Scheme represents the variant "wasi:http/types@0.2.0#scheme". -// -// This type corresponds to HTTP standard Related Schemes. -// -// variant scheme { -// HTTP, -// HTTPS, -// other(string), -// } -type Scheme cm.Variant[uint8, string, string] - -// SchemeHTTP returns a [Scheme] of case "HTTP". -func SchemeHTTP() Scheme { - var data struct{} - return cm.New[Scheme](0, data) -} - -// HTTP returns true if [Scheme] represents the variant case "HTTP". -func (self *Scheme) HTTP() bool { - return self.Tag() == 0 -} - -// SchemeHTTPS returns a [Scheme] of case "HTTPS". -func SchemeHTTPS() Scheme { - var data struct{} - return cm.New[Scheme](1, data) -} - -// HTTPS returns true if [Scheme] represents the variant case "HTTPS". -func (self *Scheme) HTTPS() bool { - return self.Tag() == 1 -} - -// SchemeOther returns a [Scheme] of case "other". -func SchemeOther(data string) Scheme { - return cm.New[Scheme](2, data) -} - -// Other returns a non-nil *[string] if [Scheme] represents the variant case "other". -func (self *Scheme) Other() *string { - return cm.Case[string](self, 2) -} - -var stringsScheme = [3]string{ - "HTTP", - "HTTPS", - "other", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v Scheme) String() string { - return stringsScheme[v.Tag()] -} - -// DNSErrorPayload represents the record "wasi:http/types@0.2.0#DNS-error-payload". -// -// Defines the case payload type for `DNS-error` above: -// -// record DNS-error-payload { -// rcode: option, -// info-code: option, -// } -type DNSErrorPayload struct { - _ cm.HostLayout - Rcode cm.Option[string] - InfoCode cm.Option[uint16] -} - -// TLSAlertReceivedPayload represents the record "wasi:http/types@0.2.0#TLS-alert-received-payload". -// -// Defines the case payload type for `TLS-alert-received` above: -// -// record TLS-alert-received-payload { -// alert-id: option, -// alert-message: option, -// } -type TLSAlertReceivedPayload struct { - _ cm.HostLayout - AlertID cm.Option[uint8] - AlertMessage cm.Option[string] -} - -// FieldSizePayload represents the record "wasi:http/types@0.2.0#field-size-payload". -// -// Defines the case payload type for `HTTP-response-{header,trailer}-size` above: -// -// record field-size-payload { -// field-name: option, -// field-size: option, -// } -type FieldSizePayload struct { - _ cm.HostLayout - FieldName cm.Option[string] - FieldSize cm.Option[uint32] -} - -// ErrorCode represents the variant "wasi:http/types@0.2.0#error-code". -// -// These cases are inspired by the IANA HTTP Proxy Error Types: -// https://www.iana.org/assignments/http-proxy-status/http-proxy-status.xhtml#table-http-proxy-error-types -// -// variant error-code { -// DNS-timeout, -// DNS-error(DNS-error-payload), -// destination-not-found, -// destination-unavailable, -// destination-IP-prohibited, -// destination-IP-unroutable, -// connection-refused, -// connection-terminated, -// connection-timeout, -// connection-read-timeout, -// connection-write-timeout, -// connection-limit-reached, -// TLS-protocol-error, -// TLS-certificate-error, -// TLS-alert-received(TLS-alert-received-payload), -// HTTP-request-denied, -// HTTP-request-length-required, -// HTTP-request-body-size(option), -// HTTP-request-method-invalid, -// HTTP-request-URI-invalid, -// HTTP-request-URI-too-long, -// HTTP-request-header-section-size(option), -// HTTP-request-header-size(option), -// HTTP-request-trailer-section-size(option), -// HTTP-request-trailer-size(field-size-payload), -// HTTP-response-incomplete, -// HTTP-response-header-section-size(option), -// HTTP-response-header-size(field-size-payload), -// HTTP-response-body-size(option), -// HTTP-response-trailer-section-size(option), -// HTTP-response-trailer-size(field-size-payload), -// HTTP-response-transfer-coding(option), -// HTTP-response-content-coding(option), -// HTTP-response-timeout, -// HTTP-upgrade-failed, -// HTTP-protocol-error, -// loop-detected, -// configuration-error, -// internal-error(option), -// } -type ErrorCode cm.Variant[uint8, OptionFieldSizePayloadShape, cm.Option[uint64]] - -// ErrorCodeDNSTimeout returns a [ErrorCode] of case "DNS-timeout". -func ErrorCodeDNSTimeout() ErrorCode { - var data struct{} - return cm.New[ErrorCode](0, data) -} - -// DNSTimeout returns true if [ErrorCode] represents the variant case "DNS-timeout". -func (self *ErrorCode) DNSTimeout() bool { - return self.Tag() == 0 -} - -// ErrorCodeDNSError returns a [ErrorCode] of case "DNS-error". -func ErrorCodeDNSError(data DNSErrorPayload) ErrorCode { - return cm.New[ErrorCode](1, data) -} - -// DNSError returns a non-nil *[DNSErrorPayload] if [ErrorCode] represents the variant case "DNS-error". -func (self *ErrorCode) DNSError() *DNSErrorPayload { - return cm.Case[DNSErrorPayload](self, 1) -} - -// ErrorCodeDestinationNotFound returns a [ErrorCode] of case "destination-not-found". -func ErrorCodeDestinationNotFound() ErrorCode { - var data struct{} - return cm.New[ErrorCode](2, data) -} - -// DestinationNotFound returns true if [ErrorCode] represents the variant case "destination-not-found". -func (self *ErrorCode) DestinationNotFound() bool { - return self.Tag() == 2 -} - -// ErrorCodeDestinationUnavailable returns a [ErrorCode] of case "destination-unavailable". -func ErrorCodeDestinationUnavailable() ErrorCode { - var data struct{} - return cm.New[ErrorCode](3, data) -} - -// DestinationUnavailable returns true if [ErrorCode] represents the variant case "destination-unavailable". -func (self *ErrorCode) DestinationUnavailable() bool { - return self.Tag() == 3 -} - -// ErrorCodeDestinationIPProhibited returns a [ErrorCode] of case "destination-IP-prohibited". -func ErrorCodeDestinationIPProhibited() ErrorCode { - var data struct{} - return cm.New[ErrorCode](4, data) -} - -// DestinationIPProhibited returns true if [ErrorCode] represents the variant case "destination-IP-prohibited". -func (self *ErrorCode) DestinationIPProhibited() bool { - return self.Tag() == 4 -} - -// ErrorCodeDestinationIPUnroutable returns a [ErrorCode] of case "destination-IP-unroutable". -func ErrorCodeDestinationIPUnroutable() ErrorCode { - var data struct{} - return cm.New[ErrorCode](5, data) -} - -// DestinationIPUnroutable returns true if [ErrorCode] represents the variant case "destination-IP-unroutable". -func (self *ErrorCode) DestinationIPUnroutable() bool { - return self.Tag() == 5 -} - -// ErrorCodeConnectionRefused returns a [ErrorCode] of case "connection-refused". -func ErrorCodeConnectionRefused() ErrorCode { - var data struct{} - return cm.New[ErrorCode](6, data) -} - -// ConnectionRefused returns true if [ErrorCode] represents the variant case "connection-refused". -func (self *ErrorCode) ConnectionRefused() bool { - return self.Tag() == 6 -} - -// ErrorCodeConnectionTerminated returns a [ErrorCode] of case "connection-terminated". -func ErrorCodeConnectionTerminated() ErrorCode { - var data struct{} - return cm.New[ErrorCode](7, data) -} - -// ConnectionTerminated returns true if [ErrorCode] represents the variant case "connection-terminated". -func (self *ErrorCode) ConnectionTerminated() bool { - return self.Tag() == 7 -} - -// ErrorCodeConnectionTimeout returns a [ErrorCode] of case "connection-timeout". -func ErrorCodeConnectionTimeout() ErrorCode { - var data struct{} - return cm.New[ErrorCode](8, data) -} - -// ConnectionTimeout returns true if [ErrorCode] represents the variant case "connection-timeout". -func (self *ErrorCode) ConnectionTimeout() bool { - return self.Tag() == 8 -} - -// ErrorCodeConnectionReadTimeout returns a [ErrorCode] of case "connection-read-timeout". -func ErrorCodeConnectionReadTimeout() ErrorCode { - var data struct{} - return cm.New[ErrorCode](9, data) -} - -// ConnectionReadTimeout returns true if [ErrorCode] represents the variant case "connection-read-timeout". -func (self *ErrorCode) ConnectionReadTimeout() bool { - return self.Tag() == 9 -} - -// ErrorCodeConnectionWriteTimeout returns a [ErrorCode] of case "connection-write-timeout". -func ErrorCodeConnectionWriteTimeout() ErrorCode { - var data struct{} - return cm.New[ErrorCode](10, data) -} - -// ConnectionWriteTimeout returns true if [ErrorCode] represents the variant case "connection-write-timeout". -func (self *ErrorCode) ConnectionWriteTimeout() bool { - return self.Tag() == 10 -} - -// ErrorCodeConnectionLimitReached returns a [ErrorCode] of case "connection-limit-reached". -func ErrorCodeConnectionLimitReached() ErrorCode { - var data struct{} - return cm.New[ErrorCode](11, data) -} - -// ConnectionLimitReached returns true if [ErrorCode] represents the variant case "connection-limit-reached". -func (self *ErrorCode) ConnectionLimitReached() bool { - return self.Tag() == 11 -} - -// ErrorCodeTLSProtocolError returns a [ErrorCode] of case "TLS-protocol-error". -func ErrorCodeTLSProtocolError() ErrorCode { - var data struct{} - return cm.New[ErrorCode](12, data) -} - -// TLSProtocolError returns true if [ErrorCode] represents the variant case "TLS-protocol-error". -func (self *ErrorCode) TLSProtocolError() bool { - return self.Tag() == 12 -} - -// ErrorCodeTLSCertificateError returns a [ErrorCode] of case "TLS-certificate-error". -func ErrorCodeTLSCertificateError() ErrorCode { - var data struct{} - return cm.New[ErrorCode](13, data) -} - -// TLSCertificateError returns true if [ErrorCode] represents the variant case "TLS-certificate-error". -func (self *ErrorCode) TLSCertificateError() bool { - return self.Tag() == 13 -} - -// ErrorCodeTLSAlertReceived returns a [ErrorCode] of case "TLS-alert-received". -func ErrorCodeTLSAlertReceived(data TLSAlertReceivedPayload) ErrorCode { - return cm.New[ErrorCode](14, data) -} - -// TLSAlertReceived returns a non-nil *[TLSAlertReceivedPayload] if [ErrorCode] represents the variant case "TLS-alert-received". -func (self *ErrorCode) TLSAlertReceived() *TLSAlertReceivedPayload { - return cm.Case[TLSAlertReceivedPayload](self, 14) -} - -// ErrorCodeHTTPRequestDenied returns a [ErrorCode] of case "HTTP-request-denied". -func ErrorCodeHTTPRequestDenied() ErrorCode { - var data struct{} - return cm.New[ErrorCode](15, data) -} - -// HTTPRequestDenied returns true if [ErrorCode] represents the variant case "HTTP-request-denied". -func (self *ErrorCode) HTTPRequestDenied() bool { - return self.Tag() == 15 -} - -// ErrorCodeHTTPRequestLengthRequired returns a [ErrorCode] of case "HTTP-request-length-required". -func ErrorCodeHTTPRequestLengthRequired() ErrorCode { - var data struct{} - return cm.New[ErrorCode](16, data) -} - -// HTTPRequestLengthRequired returns true if [ErrorCode] represents the variant case "HTTP-request-length-required". -func (self *ErrorCode) HTTPRequestLengthRequired() bool { - return self.Tag() == 16 -} - -// ErrorCodeHTTPRequestBodySize returns a [ErrorCode] of case "HTTP-request-body-size". -func ErrorCodeHTTPRequestBodySize(data cm.Option[uint64]) ErrorCode { - return cm.New[ErrorCode](17, data) -} - -// HTTPRequestBodySize returns a non-nil *[cm.Option[uint64]] if [ErrorCode] represents the variant case "HTTP-request-body-size". -func (self *ErrorCode) HTTPRequestBodySize() *cm.Option[uint64] { - return cm.Case[cm.Option[uint64]](self, 17) -} - -// ErrorCodeHTTPRequestMethodInvalid returns a [ErrorCode] of case "HTTP-request-method-invalid". -func ErrorCodeHTTPRequestMethodInvalid() ErrorCode { - var data struct{} - return cm.New[ErrorCode](18, data) -} - -// HTTPRequestMethodInvalid returns true if [ErrorCode] represents the variant case "HTTP-request-method-invalid". -func (self *ErrorCode) HTTPRequestMethodInvalid() bool { - return self.Tag() == 18 -} - -// ErrorCodeHTTPRequestURIInvalid returns a [ErrorCode] of case "HTTP-request-URI-invalid". -func ErrorCodeHTTPRequestURIInvalid() ErrorCode { - var data struct{} - return cm.New[ErrorCode](19, data) -} - -// HTTPRequestURIInvalid returns true if [ErrorCode] represents the variant case "HTTP-request-URI-invalid". -func (self *ErrorCode) HTTPRequestURIInvalid() bool { - return self.Tag() == 19 -} - -// ErrorCodeHTTPRequestURITooLong returns a [ErrorCode] of case "HTTP-request-URI-too-long". -func ErrorCodeHTTPRequestURITooLong() ErrorCode { - var data struct{} - return cm.New[ErrorCode](20, data) -} - -// HTTPRequestURITooLong returns true if [ErrorCode] represents the variant case "HTTP-request-URI-too-long". -func (self *ErrorCode) HTTPRequestURITooLong() bool { - return self.Tag() == 20 -} - -// ErrorCodeHTTPRequestHeaderSectionSize returns a [ErrorCode] of case "HTTP-request-header-section-size". -func ErrorCodeHTTPRequestHeaderSectionSize(data cm.Option[uint32]) ErrorCode { - return cm.New[ErrorCode](21, data) -} - -// HTTPRequestHeaderSectionSize returns a non-nil *[cm.Option[uint32]] if [ErrorCode] represents the variant case "HTTP-request-header-section-size". -func (self *ErrorCode) HTTPRequestHeaderSectionSize() *cm.Option[uint32] { - return cm.Case[cm.Option[uint32]](self, 21) -} - -// ErrorCodeHTTPRequestHeaderSize returns a [ErrorCode] of case "HTTP-request-header-size". -func ErrorCodeHTTPRequestHeaderSize(data cm.Option[FieldSizePayload]) ErrorCode { - return cm.New[ErrorCode](22, data) -} - -// HTTPRequestHeaderSize returns a non-nil *[cm.Option[FieldSizePayload]] if [ErrorCode] represents the variant case "HTTP-request-header-size". -func (self *ErrorCode) HTTPRequestHeaderSize() *cm.Option[FieldSizePayload] { - return cm.Case[cm.Option[FieldSizePayload]](self, 22) -} - -// ErrorCodeHTTPRequestTrailerSectionSize returns a [ErrorCode] of case "HTTP-request-trailer-section-size". -func ErrorCodeHTTPRequestTrailerSectionSize(data cm.Option[uint32]) ErrorCode { - return cm.New[ErrorCode](23, data) -} - -// HTTPRequestTrailerSectionSize returns a non-nil *[cm.Option[uint32]] if [ErrorCode] represents the variant case "HTTP-request-trailer-section-size". -func (self *ErrorCode) HTTPRequestTrailerSectionSize() *cm.Option[uint32] { - return cm.Case[cm.Option[uint32]](self, 23) -} - -// ErrorCodeHTTPRequestTrailerSize returns a [ErrorCode] of case "HTTP-request-trailer-size". -func ErrorCodeHTTPRequestTrailerSize(data FieldSizePayload) ErrorCode { - return cm.New[ErrorCode](24, data) -} - -// HTTPRequestTrailerSize returns a non-nil *[FieldSizePayload] if [ErrorCode] represents the variant case "HTTP-request-trailer-size". -func (self *ErrorCode) HTTPRequestTrailerSize() *FieldSizePayload { - return cm.Case[FieldSizePayload](self, 24) -} - -// ErrorCodeHTTPResponseIncomplete returns a [ErrorCode] of case "HTTP-response-incomplete". -func ErrorCodeHTTPResponseIncomplete() ErrorCode { - var data struct{} - return cm.New[ErrorCode](25, data) -} - -// HTTPResponseIncomplete returns true if [ErrorCode] represents the variant case "HTTP-response-incomplete". -func (self *ErrorCode) HTTPResponseIncomplete() bool { - return self.Tag() == 25 -} - -// ErrorCodeHTTPResponseHeaderSectionSize returns a [ErrorCode] of case "HTTP-response-header-section-size". -func ErrorCodeHTTPResponseHeaderSectionSize(data cm.Option[uint32]) ErrorCode { - return cm.New[ErrorCode](26, data) -} - -// HTTPResponseHeaderSectionSize returns a non-nil *[cm.Option[uint32]] if [ErrorCode] represents the variant case "HTTP-response-header-section-size". -func (self *ErrorCode) HTTPResponseHeaderSectionSize() *cm.Option[uint32] { - return cm.Case[cm.Option[uint32]](self, 26) -} - -// ErrorCodeHTTPResponseHeaderSize returns a [ErrorCode] of case "HTTP-response-header-size". -func ErrorCodeHTTPResponseHeaderSize(data FieldSizePayload) ErrorCode { - return cm.New[ErrorCode](27, data) -} - -// HTTPResponseHeaderSize returns a non-nil *[FieldSizePayload] if [ErrorCode] represents the variant case "HTTP-response-header-size". -func (self *ErrorCode) HTTPResponseHeaderSize() *FieldSizePayload { - return cm.Case[FieldSizePayload](self, 27) -} - -// ErrorCodeHTTPResponseBodySize returns a [ErrorCode] of case "HTTP-response-body-size". -func ErrorCodeHTTPResponseBodySize(data cm.Option[uint64]) ErrorCode { - return cm.New[ErrorCode](28, data) -} - -// HTTPResponseBodySize returns a non-nil *[cm.Option[uint64]] if [ErrorCode] represents the variant case "HTTP-response-body-size". -func (self *ErrorCode) HTTPResponseBodySize() *cm.Option[uint64] { - return cm.Case[cm.Option[uint64]](self, 28) -} - -// ErrorCodeHTTPResponseTrailerSectionSize returns a [ErrorCode] of case "HTTP-response-trailer-section-size". -func ErrorCodeHTTPResponseTrailerSectionSize(data cm.Option[uint32]) ErrorCode { - return cm.New[ErrorCode](29, data) -} - -// HTTPResponseTrailerSectionSize returns a non-nil *[cm.Option[uint32]] if [ErrorCode] represents the variant case "HTTP-response-trailer-section-size". -func (self *ErrorCode) HTTPResponseTrailerSectionSize() *cm.Option[uint32] { - return cm.Case[cm.Option[uint32]](self, 29) -} - -// ErrorCodeHTTPResponseTrailerSize returns a [ErrorCode] of case "HTTP-response-trailer-size". -func ErrorCodeHTTPResponseTrailerSize(data FieldSizePayload) ErrorCode { - return cm.New[ErrorCode](30, data) -} - -// HTTPResponseTrailerSize returns a non-nil *[FieldSizePayload] if [ErrorCode] represents the variant case "HTTP-response-trailer-size". -func (self *ErrorCode) HTTPResponseTrailerSize() *FieldSizePayload { - return cm.Case[FieldSizePayload](self, 30) -} - -// ErrorCodeHTTPResponseTransferCoding returns a [ErrorCode] of case "HTTP-response-transfer-coding". -func ErrorCodeHTTPResponseTransferCoding(data cm.Option[string]) ErrorCode { - return cm.New[ErrorCode](31, data) -} - -// HTTPResponseTransferCoding returns a non-nil *[cm.Option[string]] if [ErrorCode] represents the variant case "HTTP-response-transfer-coding". -func (self *ErrorCode) HTTPResponseTransferCoding() *cm.Option[string] { - return cm.Case[cm.Option[string]](self, 31) -} - -// ErrorCodeHTTPResponseContentCoding returns a [ErrorCode] of case "HTTP-response-content-coding". -func ErrorCodeHTTPResponseContentCoding(data cm.Option[string]) ErrorCode { - return cm.New[ErrorCode](32, data) -} - -// HTTPResponseContentCoding returns a non-nil *[cm.Option[string]] if [ErrorCode] represents the variant case "HTTP-response-content-coding". -func (self *ErrorCode) HTTPResponseContentCoding() *cm.Option[string] { - return cm.Case[cm.Option[string]](self, 32) -} - -// ErrorCodeHTTPResponseTimeout returns a [ErrorCode] of case "HTTP-response-timeout". -func ErrorCodeHTTPResponseTimeout() ErrorCode { - var data struct{} - return cm.New[ErrorCode](33, data) -} - -// HTTPResponseTimeout returns true if [ErrorCode] represents the variant case "HTTP-response-timeout". -func (self *ErrorCode) HTTPResponseTimeout() bool { - return self.Tag() == 33 -} - -// ErrorCodeHTTPUpgradeFailed returns a [ErrorCode] of case "HTTP-upgrade-failed". -func ErrorCodeHTTPUpgradeFailed() ErrorCode { - var data struct{} - return cm.New[ErrorCode](34, data) -} - -// HTTPUpgradeFailed returns true if [ErrorCode] represents the variant case "HTTP-upgrade-failed". -func (self *ErrorCode) HTTPUpgradeFailed() bool { - return self.Tag() == 34 -} - -// ErrorCodeHTTPProtocolError returns a [ErrorCode] of case "HTTP-protocol-error". -func ErrorCodeHTTPProtocolError() ErrorCode { - var data struct{} - return cm.New[ErrorCode](35, data) -} - -// HTTPProtocolError returns true if [ErrorCode] represents the variant case "HTTP-protocol-error". -func (self *ErrorCode) HTTPProtocolError() bool { - return self.Tag() == 35 -} - -// ErrorCodeLoopDetected returns a [ErrorCode] of case "loop-detected". -func ErrorCodeLoopDetected() ErrorCode { - var data struct{} - return cm.New[ErrorCode](36, data) -} - -// LoopDetected returns true if [ErrorCode] represents the variant case "loop-detected". -func (self *ErrorCode) LoopDetected() bool { - return self.Tag() == 36 -} - -// ErrorCodeConfigurationError returns a [ErrorCode] of case "configuration-error". -func ErrorCodeConfigurationError() ErrorCode { - var data struct{} - return cm.New[ErrorCode](37, data) -} - -// ConfigurationError returns true if [ErrorCode] represents the variant case "configuration-error". -func (self *ErrorCode) ConfigurationError() bool { - return self.Tag() == 37 -} - -// ErrorCodeInternalError returns a [ErrorCode] of case "internal-error". -// -// This is a catch-all error for anything that doesn't fit cleanly into a -// more specific case. It also includes an optional string for an -// unstructured description of the error. Users should not depend on the -// string for diagnosing errors, as it's not required to be consistent -// between implementations. -func ErrorCodeInternalError(data cm.Option[string]) ErrorCode { - return cm.New[ErrorCode](38, data) -} - -// InternalError returns a non-nil *[cm.Option[string]] if [ErrorCode] represents the variant case "internal-error". -func (self *ErrorCode) InternalError() *cm.Option[string] { - return cm.Case[cm.Option[string]](self, 38) -} - -var stringsErrorCode = [39]string{ - "DNS-timeout", - "DNS-error", - "destination-not-found", - "destination-unavailable", - "destination-IP-prohibited", - "destination-IP-unroutable", - "connection-refused", - "connection-terminated", - "connection-timeout", - "connection-read-timeout", - "connection-write-timeout", - "connection-limit-reached", - "TLS-protocol-error", - "TLS-certificate-error", - "TLS-alert-received", - "HTTP-request-denied", - "HTTP-request-length-required", - "HTTP-request-body-size", - "HTTP-request-method-invalid", - "HTTP-request-URI-invalid", - "HTTP-request-URI-too-long", - "HTTP-request-header-section-size", - "HTTP-request-header-size", - "HTTP-request-trailer-section-size", - "HTTP-request-trailer-size", - "HTTP-response-incomplete", - "HTTP-response-header-section-size", - "HTTP-response-header-size", - "HTTP-response-body-size", - "HTTP-response-trailer-section-size", - "HTTP-response-trailer-size", - "HTTP-response-transfer-coding", - "HTTP-response-content-coding", - "HTTP-response-timeout", - "HTTP-upgrade-failed", - "HTTP-protocol-error", - "loop-detected", - "configuration-error", - "internal-error", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v ErrorCode) String() string { - return stringsErrorCode[v.Tag()] -} - -// HeaderError represents the variant "wasi:http/types@0.2.0#header-error". -// -// This type enumerates the different kinds of errors that may occur when -// setting or appending to a `fields` resource. -// -// variant header-error { -// invalid-syntax, -// forbidden, -// immutable, -// } -type HeaderError uint8 - -const ( - // This error indicates that a `field-key` or `field-value` was - // syntactically invalid when used with an operation that sets headers in a - // `fields`. - HeaderErrorInvalidSyntax HeaderError = iota - - // This error indicates that a forbidden `field-key` was used when trying - // to set a header in a `fields`. - HeaderErrorForbidden - - // This error indicates that the operation on the `fields` was not - // permitted because the fields are immutable. - HeaderErrorImmutable -) - -var stringsHeaderError = [3]string{ - "invalid-syntax", - "forbidden", - "immutable", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e HeaderError) String() string { - return stringsHeaderError[e] -} - -// FieldKey represents the string "wasi:http/types@0.2.0#field-key". -// -// Field keys are always strings. -// -// type field-key = string -type FieldKey string - -// FieldValue represents the list "wasi:http/types@0.2.0#field-value". -// -// Field values should always be ASCII strings. However, in -// reality, HTTP implementations often have to interpret malformed values, -// so they are provided as a list of bytes. -// -// type field-value = list -type FieldValue cm.List[uint8] - -// Fields represents the imported resource "wasi:http/types@0.2.0#fields". -// -// This following block defines the `fields` resource which corresponds to -// HTTP standard Fields. Fields are a common representation used for both -// Headers and Trailers. -// -// A `fields` may be mutable or immutable. A `fields` created using the -// constructor, `from-list`, or `clone` will be mutable, but a `fields` -// resource given by other means (including, but not limited to, -// `incoming-request.headers`, `outgoing-request.headers`) might be be -// immutable. In an immutable fields, the `set`, `append`, and `delete` -// operations will fail with `header-error.immutable`. -// -// resource fields -type Fields cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "fields". -// -// Drops a resource handle. -// -//go:nosplit -func (self Fields) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FieldsResourceDrop((uint32)(self0)) - return -} - -// NewFields represents the imported constructor for resource "fields". -// -// Construct an empty HTTP Fields. -// -// The resulting `fields` is mutable. -// -// constructor() -// -//go:nosplit -func NewFields() { - wasmimport_NewFields() - return -} - -// FieldsFromList represents the imported static function "from-list". -// -// Construct an HTTP Fields. -// -// The resulting `fields` is mutable. -// -// The list represents each key-value pair in the Fields. Keys -// which have multiple values are represented by multiple entries in this -// list with the same key. -// -// The tuple is a pair of the field key, represented as a string, and -// Value, represented as a list of bytes. In a valid Fields, all keys -// and values are valid UTF-8 strings. However, values are not always -// well-formed, so they are represented as a raw list of bytes. -// -// An error result will be returned if any header or value was -// syntactically invalid, or if a header was forbidden. -// -// from-list: static func(entries: list>) -// -//go:nosplit -func FieldsFromList(entries cm.List[cm.Tuple[FieldKey, FieldValue]]) { - entries0, entries1 := cm.LowerList(entries) - wasmimport_FieldsFromList((*cm.Tuple[FieldKey, FieldValue])(entries0), (uint32)(entries1)) - return -} - -// Append represents the imported method "append". -// -// Append a value for a key. Does not change or delete any existing -// values for that key. -// -// Fails with `header-error.immutable` if the `fields` are immutable. -// -// append: func(name: field-key, value: field-value) -// -//go:nosplit -func (self Fields) Append(name FieldKey, value FieldValue) { - self0 := cm.Reinterpret[uint32](self) - name0, name1 := cm.LowerString(name) - value0, value1 := cm.LowerList(value) - wasmimport_FieldsAppend((uint32)(self0), (*uint8)(name0), (uint32)(name1), (*uint8)(value0), (uint32)(value1)) - return -} - -// Clone represents the imported method "clone". -// -// Make a deep copy of the Fields. Equivelant in behavior to calling the -// `fields` constructor on the return value of `entries`. The resulting -// `fields` is mutable. -// -// clone: func() -// -//go:nosplit -func (self Fields) Clone() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FieldsClone((uint32)(self0)) - return -} - -// Delete represents the imported method "delete". -// -// Delete all values for a key. Does nothing if no values for the key -// exist. -// -// Fails with `header-error.immutable` if the `fields` are immutable. -// -// delete: func(name: field-key) -// -//go:nosplit -func (self Fields) Delete(name FieldKey) { - self0 := cm.Reinterpret[uint32](self) - name0, name1 := cm.LowerString(name) - wasmimport_FieldsDelete((uint32)(self0), (*uint8)(name0), (uint32)(name1)) - return -} - -// Entries represents the imported method "entries". -// -// Retrieve the full set of keys and values in the Fields. Like the -// constructor, the list represents each key-value pair. -// -// The outer list represents each key-value pair in the Fields. Keys -// which have multiple values are represented by multiple entries in this -// list with the same key. -// -// entries: func() -// -//go:nosplit -func (self Fields) Entries() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FieldsEntries((uint32)(self0)) - return -} - -// Get represents the imported method "get". -// -// Get all of the values corresponding to a key. If the key is not present -// in this `fields`, an empty list is returned. However, if the key is -// present but empty, this is represented by a list with one or more -// empty field-values present. -// -// get: func(name: field-key) -// -//go:nosplit -func (self Fields) Get(name FieldKey) { - self0 := cm.Reinterpret[uint32](self) - name0, name1 := cm.LowerString(name) - wasmimport_FieldsGet((uint32)(self0), (*uint8)(name0), (uint32)(name1)) - return -} - -// Has represents the imported method "has". -// -// Returns `true` when the key is present in this `fields`. If the key is -// syntactically invalid, `false` is returned. -// -// has: func(name: field-key) -// -//go:nosplit -func (self Fields) Has(name FieldKey) { - self0 := cm.Reinterpret[uint32](self) - name0, name1 := cm.LowerString(name) - wasmimport_FieldsHas((uint32)(self0), (*uint8)(name0), (uint32)(name1)) - return -} - -// Set represents the imported method "set". -// -// Set all of the values for a key. Clears any existing values for that -// key, if they have been set. -// -// Fails with `header-error.immutable` if the `fields` are immutable. -// -// set: func(name: field-key, value: list) -// -//go:nosplit -func (self Fields) Set(name FieldKey, value cm.List[FieldValue]) { - self0 := cm.Reinterpret[uint32](self) - name0, name1 := cm.LowerString(name) - value0, value1 := cm.LowerList(value) - wasmimport_FieldsSet((uint32)(self0), (*uint8)(name0), (uint32)(name1), (*FieldValue)(value0), (uint32)(value1)) - return -} - -// Headers represents the imported type alias "wasi:http/types@0.2.0#headers". -// -// See [Fields] for more information. -type Headers = Fields - -// Trailers represents the imported type alias "wasi:http/types@0.2.0#trailers". -// -// See [Fields] for more information. -type Trailers = Fields - -// IncomingRequest represents the imported resource "wasi:http/types@0.2.0#incoming-request". -// -// Represents an incoming HTTP Request. -// -// resource incoming-request -type IncomingRequest cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "incoming-request". -// -// Drops a resource handle. -// -//go:nosplit -func (self IncomingRequest) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestResourceDrop((uint32)(self0)) - return -} - -// Authority represents the imported method "authority". -// -// Returns the authority from the request, if it was present. -// -// authority: func() -// -//go:nosplit -func (self IncomingRequest) Authority() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestAuthority((uint32)(self0)) - return -} - -// Consume represents the imported method "consume". -// -// Gives the `incoming-body` associated with this request. Will only -// return success at most once, and subsequent calls will return error. -// -// consume: func() -// -//go:nosplit -func (self IncomingRequest) Consume() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestConsume((uint32)(self0)) - return -} - -// Headers represents the imported method "headers". -// -// Get the `headers` associated with the request. -// -// The returned `headers` resource is immutable: `set`, `append`, and -// `delete` operations will fail with `header-error.immutable`. -// -// The `headers` returned are a child resource: it must be dropped before -// the parent `incoming-request` is dropped. Dropping this -// `incoming-request` before all children are dropped will trap. -// -// headers: func() -// -//go:nosplit -func (self IncomingRequest) Headers() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestHeaders((uint32)(self0)) - return -} - -// Method represents the imported method "method". -// -// Returns the method of the incoming request. -// -// method: func() -// -//go:nosplit -func (self IncomingRequest) Method() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestMethod((uint32)(self0)) - return -} - -// PathWithQuery represents the imported method "path-with-query". -// -// Returns the path with query parameters from the request, as a string. -// -// path-with-query: func() -// -//go:nosplit -func (self IncomingRequest) PathWithQuery() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestPathWithQuery((uint32)(self0)) - return -} - -// Scheme represents the imported method "scheme". -// -// Returns the protocol scheme from the request. -// -// scheme: func() -// -//go:nosplit -func (self IncomingRequest) Scheme() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestScheme((uint32)(self0)) - return -} - -// OutgoingRequest represents the imported resource "wasi:http/types@0.2.0#outgoing-request". -// -// Represents an outgoing HTTP Request. -// -// resource outgoing-request -type OutgoingRequest cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "outgoing-request". -// -// Drops a resource handle. -// -//go:nosplit -func (self OutgoingRequest) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestResourceDrop((uint32)(self0)) - return -} - -// NewOutgoingRequest represents the imported constructor for resource "outgoing-request". -// -// Construct a new `outgoing-request` with a default `method` of `GET`, and -// `none` values for `path-with-query`, `scheme`, and `authority`. -// -// * `headers` is the HTTP Headers for the Request. -// -// It is possible to construct, or manipulate with the accessor functions -// below, an `outgoing-request` with an invalid combination of `scheme` -// and `authority`, or `headers` which are not permitted to be sent. -// It is the obligation of the `outgoing-handler.handle` implementation -// to reject invalid constructions of `outgoing-request`. -// -// constructor(headers: headers) -// -//go:nosplit -func NewOutgoingRequest(headers Headers) { - headers0 := cm.Reinterpret[uint32](headers) - wasmimport_NewOutgoingRequest((uint32)(headers0)) - return -} - -// Authority represents the imported method "authority". -// -// Get the HTTP Authority for the Request. A value of `none` may be used -// with Related Schemes which do not require an Authority. The HTTP and -// HTTPS schemes always require an authority. -// -// authority: func() -// -//go:nosplit -func (self OutgoingRequest) Authority() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestAuthority((uint32)(self0)) - return -} - -// Body represents the imported method "body". -// -// Returns the resource corresponding to the outgoing Body for this -// Request. -// -// Returns success on the first call: the `outgoing-body` resource for -// this `outgoing-request` can be retrieved at most once. Subsequent -// calls will return error. -// -// body: func() -// -//go:nosplit -func (self OutgoingRequest) Body() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestBody((uint32)(self0)) - return -} - -// Headers represents the imported method "headers". -// -// Get the headers associated with the Request. -// -// The returned `headers` resource is immutable: `set`, `append`, and -// `delete` operations will fail with `header-error.immutable`. -// -// This headers resource is a child: it must be dropped before the parent -// `outgoing-request` is dropped, or its ownership is transfered to -// another component by e.g. `outgoing-handler.handle`. -// -// headers: func() -// -//go:nosplit -func (self OutgoingRequest) Headers() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestHeaders((uint32)(self0)) - return -} - -// Method represents the imported method "method". -// -// Get the Method for the Request. -// -// method: func() -// -//go:nosplit -func (self OutgoingRequest) Method() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestMethod((uint32)(self0)) - return -} - -// PathWithQuery represents the imported method "path-with-query". -// -// Get the combination of the HTTP Path and Query for the Request. -// When `none`, this represents an empty Path and empty Query. -// -// path-with-query: func() -// -//go:nosplit -func (self OutgoingRequest) PathWithQuery() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestPathWithQuery((uint32)(self0)) - return -} - -// Scheme represents the imported method "scheme". -// -// Get the HTTP Related Scheme for the Request. When `none`, the -// implementation may choose an appropriate default scheme. -// -// scheme: func() -// -//go:nosplit -func (self OutgoingRequest) Scheme() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestScheme((uint32)(self0)) - return -} - -// SetAuthority represents the imported method "set-authority". -// -// Set the HTTP Authority for the Request. A value of `none` may be used -// with Related Schemes which do not require an Authority. The HTTP and -// HTTPS schemes always require an authority. Fails if the string given is -// not a syntactically valid uri authority. -// -// set-authority: func(authority: option) -// -//go:nosplit -func (self OutgoingRequest) SetAuthority(authority cm.Option[string]) { - self0 := cm.Reinterpret[uint32](self) - authority0, authority1, authority2 := lower_OptionString(authority) - wasmimport_OutgoingRequestSetAuthority((uint32)(self0), (uint32)(authority0), (*uint8)(authority1), (uint32)(authority2)) - return -} - -// SetMethod represents the imported method "set-method". -// -// Set the Method for the Request. Fails if the string present in a -// `method.other` argument is not a syntactically valid method. -// -// set-method: func(method: method) -// -//go:nosplit -func (self OutgoingRequest) SetMethod(method Method) { - self0 := cm.Reinterpret[uint32](self) - method0, method1, method2 := lower_Method(method) - wasmimport_OutgoingRequestSetMethod((uint32)(self0), (uint32)(method0), (*uint8)(method1), (uint32)(method2)) - return -} - -// SetPathWithQuery represents the imported method "set-path-with-query". -// -// Set the combination of the HTTP Path and Query for the Request. -// When `none`, this represents an empty Path and empty Query. Fails is the -// string given is not a syntactically valid path and query uri component. -// -// set-path-with-query: func(path-with-query: option) -// -//go:nosplit -func (self OutgoingRequest) SetPathWithQuery(pathWithQuery cm.Option[string]) { - self0 := cm.Reinterpret[uint32](self) - pathWithQuery0, pathWithQuery1, pathWithQuery2 := lower_OptionString(pathWithQuery) - wasmimport_OutgoingRequestSetPathWithQuery((uint32)(self0), (uint32)(pathWithQuery0), (*uint8)(pathWithQuery1), (uint32)(pathWithQuery2)) - return -} - -// SetScheme represents the imported method "set-scheme". -// -// Set the HTTP Related Scheme for the Request. When `none`, the -// implementation may choose an appropriate default scheme. Fails if the -// string given is not a syntactically valid uri scheme. -// -// set-scheme: func(scheme: option) -// -//go:nosplit -func (self OutgoingRequest) SetScheme(scheme cm.Option[Scheme]) { - self0 := cm.Reinterpret[uint32](self) - scheme0, scheme1, scheme2, scheme3 := lower_OptionScheme(scheme) - wasmimport_OutgoingRequestSetScheme((uint32)(self0), (uint32)(scheme0), (uint32)(scheme1), (*uint8)(scheme2), (uint32)(scheme3)) - return -} - -// RequestOptions represents the imported resource "wasi:http/types@0.2.0#request-options". -// -// Parameters for making an HTTP Request. Each of these parameters is -// currently an optional timeout applicable to the transport layer of the -// HTTP protocol. -// -// These timeouts are separate from any the user may use to bound a -// blocking call to `wasi:io/poll.poll`. -// -// resource request-options -type RequestOptions cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "request-options". -// -// Drops a resource handle. -// -//go:nosplit -func (self RequestOptions) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsResourceDrop((uint32)(self0)) - return -} - -// NewRequestOptions represents the imported constructor for resource "request-options". -// -// Construct a default `request-options` value. -// -// constructor() -// -//go:nosplit -func NewRequestOptions() { - wasmimport_NewRequestOptions() - return -} - -// BetweenBytesTimeout represents the imported method "between-bytes-timeout". -// -// The timeout for receiving subsequent chunks of bytes in the Response -// body stream. -// -// between-bytes-timeout: func() -// -//go:nosplit -func (self RequestOptions) BetweenBytesTimeout() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsBetweenBytesTimeout((uint32)(self0)) - return -} - -// ConnectTimeout represents the imported method "connect-timeout". -// -// The timeout for the initial connect to the HTTP Server. -// -// connect-timeout: func() -// -//go:nosplit -func (self RequestOptions) ConnectTimeout() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsConnectTimeout((uint32)(self0)) - return -} - -// FirstByteTimeout represents the imported method "first-byte-timeout". -// -// The timeout for receiving the first byte of the Response body. -// -// first-byte-timeout: func() -// -//go:nosplit -func (self RequestOptions) FirstByteTimeout() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsFirstByteTimeout((uint32)(self0)) - return -} - -// SetBetweenBytesTimeout represents the imported method "set-between-bytes-timeout". -// -// Set the timeout for receiving subsequent chunks of bytes in the Response -// body stream. An error return value indicates that this timeout is not -// supported. -// -// set-between-bytes-timeout: func(duration: option) -// -//go:nosplit -func (self RequestOptions) SetBetweenBytesTimeout(duration cm.Option[Duration]) { - self0 := cm.Reinterpret[uint32](self) - duration0, duration1 := lower_OptionDuration(duration) - wasmimport_RequestOptionsSetBetweenBytesTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) - return -} - -// SetConnectTimeout represents the imported method "set-connect-timeout". -// -// Set the timeout for the initial connect to the HTTP Server. An error -// return value indicates that this timeout is not supported. -// -// set-connect-timeout: func(duration: option) -// -//go:nosplit -func (self RequestOptions) SetConnectTimeout(duration cm.Option[Duration]) { - self0 := cm.Reinterpret[uint32](self) - duration0, duration1 := lower_OptionDuration(duration) - wasmimport_RequestOptionsSetConnectTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) - return -} - -// SetFirstByteTimeout represents the imported method "set-first-byte-timeout". -// -// Set the timeout for receiving the first byte of the Response body. An -// error return value indicates that this timeout is not supported. -// -// set-first-byte-timeout: func(duration: option) -// -//go:nosplit -func (self RequestOptions) SetFirstByteTimeout(duration cm.Option[Duration]) { - self0 := cm.Reinterpret[uint32](self) - duration0, duration1 := lower_OptionDuration(duration) - wasmimport_RequestOptionsSetFirstByteTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) - return -} - -// ResponseOutparam represents the imported resource "wasi:http/types@0.2.0#response-outparam". -// -// Represents the ability to send an HTTP Response. -// -// This resource is used by the `wasi:http/incoming-handler` interface to -// allow a Response to be sent corresponding to the Request provided as the -// other argument to `incoming-handler.handle`. -// -// resource response-outparam -type ResponseOutparam cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "response-outparam". -// -// Drops a resource handle. -// -//go:nosplit -func (self ResponseOutparam) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_ResponseOutparamResourceDrop((uint32)(self0)) - return -} - -// ResponseOutparamSet represents the imported static function "set". -// -// Set the value of the `response-outparam` to either send a response, -// or indicate an error. -// -// This method consumes the `response-outparam` to ensure that it is -// called at most once. If it is never called, the implementation -// will respond with an error. -// -// The user may provide an `error` to `response` to allow the -// implementation determine how to respond with an HTTP error response. -// -// set: static func(param: response-outparam, response: result) -// -//go:nosplit -func ResponseOutparamSet(param ResponseOutparam, response cm.Result[ErrorCodeShape, OutgoingResponse, ErrorCode]) { - param0 := cm.Reinterpret[uint32](param) - response0, response1, response2, response3, response4, response5, response6, response7 := lower_ResultOutgoingResponseErrorCode(response) - wasmimport_ResponseOutparamSet((uint32)(param0), (uint32)(response0), (uint32)(response1), (uint32)(response2), (uint64)(response3), (uint32)(response4), (uint32)(response5), (uint32)(response6), (uint32)(response7)) - return -} - -// StatusCode represents the u16 "wasi:http/types@0.2.0#status-code". -// -// This type corresponds to the HTTP standard Status Code. -// -// type status-code = u16 -type StatusCode uint16 - -// IncomingResponse represents the imported resource "wasi:http/types@0.2.0#incoming-response". -// -// Represents an incoming HTTP Response. -// -// resource incoming-response -type IncomingResponse cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "incoming-response". -// -// Drops a resource handle. -// -//go:nosplit -func (self IncomingResponse) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingResponseResourceDrop((uint32)(self0)) - return -} - -// Consume represents the imported method "consume". -// -// Returns the incoming body. May be called at most once. Returns error -// if called additional times. -// -// consume: func() -// -//go:nosplit -func (self IncomingResponse) Consume() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingResponseConsume((uint32)(self0)) - return -} - -// Headers represents the imported method "headers". -// -// Returns the headers from the incoming response. -// -// The returned `headers` resource is immutable: `set`, `append`, and -// `delete` operations will fail with `header-error.immutable`. -// -// This headers resource is a child: it must be dropped before the parent -// `incoming-response` is dropped. -// -// headers: func() -// -//go:nosplit -func (self IncomingResponse) Headers() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingResponseHeaders((uint32)(self0)) - return -} - -// Status represents the imported method "status". -// -// Returns the status code from the incoming response. -// -// status: func() -// -//go:nosplit -func (self IncomingResponse) Status() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingResponseStatus((uint32)(self0)) - return -} - -// IncomingBody represents the imported resource "wasi:http/types@0.2.0#incoming-body". -// -// Represents an incoming HTTP Request or Response's Body. -// -// A body has both its contents - a stream of bytes - and a (possibly -// empty) set of trailers, indicating that the full contents of the -// body have been received. This resource represents the contents as -// an `input-stream` and the delivery of trailers as a `future-trailers`, -// and ensures that the user of this interface may only be consuming either -// the body contents or waiting on trailers at any given time. -// -// resource incoming-body -type IncomingBody cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "incoming-body". -// -// Drops a resource handle. -// -//go:nosplit -func (self IncomingBody) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingBodyResourceDrop((uint32)(self0)) - return -} - -// IncomingBodyFinish represents the imported static function "finish". -// -// Takes ownership of `incoming-body`, and returns a `future-trailers`. -// This function will trap if the `input-stream` child is still alive. -// -// finish: static func(this: incoming-body) -// -//go:nosplit -func IncomingBodyFinish(this IncomingBody) { - this0 := cm.Reinterpret[uint32](this) - wasmimport_IncomingBodyFinish((uint32)(this0)) - return -} - -// Stream represents the imported method "stream". -// -// Returns the contents of the body, as a stream of bytes. -// -// Returns success on first call: the stream representing the contents -// can be retrieved at most once. Subsequent calls will return error. -// -// The returned `input-stream` resource is a child: it must be dropped -// before the parent `incoming-body` is dropped, or consumed by -// `incoming-body.finish`. -// -// This invariant ensures that the implementation can determine whether -// the user is consuming the contents of the body, waiting on the -// `future-trailers` to be ready, or neither. This allows for network -// backpressure is to be applied when the user is consuming the body, -// and for that backpressure to not inhibit delivery of the trailers if -// the user does not read the entire body. -// -// %stream: func() -// -//go:nosplit -func (self IncomingBody) Stream() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingBodyStream((uint32)(self0)) - return -} - -// FutureTrailers represents the imported resource "wasi:http/types@0.2.0#future-trailers". -// -// Represents a future which may eventaully return trailers, or an error. -// -// In the case that the incoming HTTP Request or Response did not have any -// trailers, this future will resolve to the empty set of trailers once the -// complete Request or Response body has been received. -// -// resource future-trailers -type FutureTrailers cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "future-trailers". -// -// Drops a resource handle. -// -//go:nosplit -func (self FutureTrailers) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureTrailersResourceDrop((uint32)(self0)) - return -} - -// Get represents the imported method "get". -// -// Returns the contents of the trailers, or an error which occured, -// once the future is ready. -// -// The outer `option` represents future readiness. Users can wait on this -// `option` to become `some` using the `subscribe` method. -// -// The outer `result` is used to retrieve the trailers or error at most -// once. It will be success on the first call in which the outer option -// is `some`, and error on subsequent calls. -// -// The inner `result` represents that either the HTTP Request or Response -// body, as well as any trailers, were received successfully, or that an -// error occured receiving them. The optional `trailers` indicates whether -// or not trailers were present in the body. -// -// When some `trailers` are returned by this method, the `trailers` -// resource is immutable, and a child. Use of the `set`, `append`, or -// `delete` methods will return an error, and the resource must be -// dropped before the parent `future-trailers` is dropped. -// -// get: func() -// -//go:nosplit -func (self FutureTrailers) Get() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureTrailersGet((uint32)(self0)) - return -} - -// Subscribe represents the imported method "subscribe". -// -// Returns a pollable which becomes ready when either the trailers have -// been received, or an error has occured. When this pollable is ready, -// the `get` method will return `some`. -// -// subscribe: func() -// -//go:nosplit -func (self FutureTrailers) Subscribe() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureTrailersSubscribe((uint32)(self0)) - return -} - -// OutgoingResponse represents the imported resource "wasi:http/types@0.2.0#outgoing-response". -// -// Represents an outgoing HTTP Response. -// -// resource outgoing-response -type OutgoingResponse cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "outgoing-response". -// -// Drops a resource handle. -// -//go:nosplit -func (self OutgoingResponse) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingResponseResourceDrop((uint32)(self0)) - return -} - -// NewOutgoingResponse represents the imported constructor for resource "outgoing-response". -// -// Construct an `outgoing-response`, with a default `status-code` of `200`. -// If a different `status-code` is needed, it must be set via the -// `set-status-code` method. -// -// * `headers` is the HTTP Headers for the Response. -// -// constructor(headers: headers) -// -//go:nosplit -func NewOutgoingResponse(headers Headers) { - headers0 := cm.Reinterpret[uint32](headers) - wasmimport_NewOutgoingResponse((uint32)(headers0)) - return -} - -// Body represents the imported method "body". -// -// Returns the resource corresponding to the outgoing Body for this Response. -// -// Returns success on the first call: the `outgoing-body` resource for -// this `outgoing-response` can be retrieved at most once. Subsequent -// calls will return error. -// -// body: func() -// -//go:nosplit -func (self OutgoingResponse) Body() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingResponseBody((uint32)(self0)) - return -} - -// Headers represents the imported method "headers". -// -// Get the headers associated with the Request. -// -// The returned `headers` resource is immutable: `set`, `append`, and -// `delete` operations will fail with `header-error.immutable`. -// -// This headers resource is a child: it must be dropped before the parent -// `outgoing-request` is dropped, or its ownership is transfered to -// another component by e.g. `outgoing-handler.handle`. -// -// headers: func() -// -//go:nosplit -func (self OutgoingResponse) Headers() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingResponseHeaders((uint32)(self0)) - return -} - -// SetStatusCode represents the imported method "set-status-code". -// -// Set the HTTP Status Code for the Response. Fails if the status-code -// given is not a valid http status code. -// -// set-status-code: func(status-code: status-code) -// -//go:nosplit -func (self OutgoingResponse) SetStatusCode(statusCode StatusCode) { - self0 := cm.Reinterpret[uint32](self) - statusCode0 := (uint32)(statusCode) - wasmimport_OutgoingResponseSetStatusCode((uint32)(self0), (uint32)(statusCode0)) - return -} - -// StatusCode represents the imported method "status-code". -// -// Get the HTTP Status Code for the Response. -// -// status-code: func() -// -//go:nosplit -func (self OutgoingResponse) StatusCode() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingResponseStatusCode((uint32)(self0)) - return -} - -// OutgoingBody represents the imported resource "wasi:http/types@0.2.0#outgoing-body". -// -// Represents an outgoing HTTP Request or Response's Body. -// -// A body has both its contents - a stream of bytes - and a (possibly -// empty) set of trailers, inducating the full contents of the body -// have been sent. This resource represents the contents as an -// `output-stream` child resource, and the completion of the body (with -// optional trailers) with a static function that consumes the -// `outgoing-body` resource, and ensures that the user of this interface -// may not write to the body contents after the body has been finished. -// -// If the user code drops this resource, as opposed to calling the static -// method `finish`, the implementation should treat the body as incomplete, -// and that an error has occured. The implementation should propogate this -// error to the HTTP protocol by whatever means it has available, -// including: corrupting the body on the wire, aborting the associated -// Request, or sending a late status code for the Response. -// -// resource outgoing-body -type OutgoingBody cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "outgoing-body". -// -// Drops a resource handle. -// -//go:nosplit -func (self OutgoingBody) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingBodyResourceDrop((uint32)(self0)) - return -} - -// OutgoingBodyFinish represents the imported static function "finish". -// -// Finalize an outgoing body, optionally providing trailers. This must be -// called to signal that the response is complete. If the `outgoing-body` -// is dropped without calling `outgoing-body.finalize`, the implementation -// should treat the body as corrupted. -// -// Fails if the body's `outgoing-request` or `outgoing-response` was -// constructed with a Content-Length header, and the contents written -// to the body (via `write`) does not match the value given in the -// Content-Length. -// -// finish: static func(this: outgoing-body, trailers: option) -// -//go:nosplit -func OutgoingBodyFinish(this OutgoingBody, trailers cm.Option[Trailers]) { - this0 := cm.Reinterpret[uint32](this) - trailers0, trailers1 := lower_OptionTrailers(trailers) - wasmimport_OutgoingBodyFinish((uint32)(this0), (uint32)(trailers0), (uint32)(trailers1)) - return -} - -// Write represents the imported method "write". -// -// Returns a stream for writing the body contents. -// -// The returned `output-stream` is a child resource: it must be dropped -// before the parent `outgoing-body` resource is dropped (or finished), -// otherwise the `outgoing-body` drop or `finish` will trap. -// -// Returns success on the first call: the `output-stream` resource for -// this `outgoing-body` may be retrieved at most once. Subsequent calls -// will return error. -// -// write: func() -// -//go:nosplit -func (self OutgoingBody) Write() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingBodyWrite((uint32)(self0)) - return -} - -// FutureIncomingResponse represents the imported resource "wasi:http/types@0.2.0#future-incoming-response". -// -// Represents a future which may eventaully return an incoming HTTP -// Response, or an error. -// -// This resource is returned by the `wasi:http/outgoing-handler` interface to -// provide the HTTP Response corresponding to the sent Request. -// -// resource future-incoming-response -type FutureIncomingResponse cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "future-incoming-response". -// -// Drops a resource handle. -// -//go:nosplit -func (self FutureIncomingResponse) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureIncomingResponseResourceDrop((uint32)(self0)) - return -} - -// Get represents the imported method "get". -// -// Returns the incoming HTTP Response, or an error, once one is ready. -// -// The outer `option` represents future readiness. Users can wait on this -// `option` to become `some` using the `subscribe` method. -// -// The outer `result` is used to retrieve the response or error at most -// once. It will be success on the first call in which the outer option -// is `some`, and error on subsequent calls. -// -// The inner `result` represents that either the incoming HTTP Response -// status and headers have recieved successfully, or that an error -// occured. Errors may also occur while consuming the response body, -// but those will be reported by the `incoming-body` and its -// `output-stream` child. -// -// get: func() -// -//go:nosplit -func (self FutureIncomingResponse) Get() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureIncomingResponseGet((uint32)(self0)) - return -} - -// Subscribe represents the imported method "subscribe". -// -// Returns a pollable which becomes ready when either the Response has -// been received, or an error has occured. When this pollable is ready, -// the `get` method will return `some`. -// -// subscribe: func() -// -//go:nosplit -func (self FutureIncomingResponse) Subscribe() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureIncomingResponseSubscribe((uint32)(self0)) - return -} - -// HTTPErrorCode represents the imported function "http-error-code". -// -// Attempts to extract a http-related `error` from the wasi:io `error` -// provided. -// -// Stream operations which return -// `wasi:io/stream/stream-error::last-operation-failed` have a payload of -// type `wasi:io/error/error` with more information about the operation -// that failed. This payload can be passed through to this function to see -// if there's http-related information about the error to return. -// -// Note that this function is fallible because not all io-errors are -// http-related errors. -// -// http-error-code: func(err: borrow) -// -//go:nosplit -func HTTPErrorCode(err IOError) { - err0 := cm.Reinterpret[uint32](err) - wasmimport_HTTPErrorCode((uint32)(err0)) - return -} diff --git a/examples/component/http-client/gen/wasi/io/error/empty.s b/examples/component/http-client/gen/wasi/io/error/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/io/error/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/io/error/error.wit.go b/examples/component/http-client/gen/wasi/io/error/error.wit.go deleted file mode 100755 index a7ebc7e4..00000000 --- a/examples/component/http-client/gen/wasi/io/error/error.wit.go +++ /dev/null @@ -1,35 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package ioerror represents the imported interface "wasi:io/error@0.2.0". -package ioerror - -import ( - "go.bytecodealliance.org/cm" -) - -// Error represents the imported resource "wasi:io/error@0.2.0#error". -// -// resource error -type Error cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "error". -// -// Drops a resource handle. -// -//go:nosplit -func (self Error) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_ErrorResourceDrop((uint32)(self0)) - return -} - -// ToDebugString represents the imported method "to-debug-string". -// -// to-debug-string: func() -// -//go:nosplit -func (self Error) ToDebugString() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_ErrorToDebugString((uint32)(self0)) - return -} diff --git a/examples/component/http-client/gen/wasi/io/error/ioerror.wasm.go b/examples/component/http-client/gen/wasi/io/error/ioerror.wasm.go deleted file mode 100755 index 96c77c65..00000000 --- a/examples/component/http-client/gen/wasi/io/error/ioerror.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package ioerror - -// This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". - -//go:wasmimport wasi:io/error@0.2.0 [resource-drop]error -//go:noescape -func wasmimport_ErrorResourceDrop(self0 uint32) - -//go:wasmimport wasi:io/error@0.2.0 [method]error.to-debug-string -//go:noescape -func wasmimport_ErrorToDebugString(self0 uint32) diff --git a/examples/component/http-client/gen/wasi/io/poll/empty.s b/examples/component/http-client/gen/wasi/io/poll/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/io/poll/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/io/poll/poll.wasm.go b/examples/component/http-client/gen/wasi/io/poll/poll.wasm.go deleted file mode 100755 index d89a9926..00000000 --- a/examples/component/http-client/gen/wasi/io/poll/poll.wasm.go +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package poll - -// This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". - -//go:wasmimport wasi:io/poll@0.2.0 [resource-drop]pollable -//go:noescape -func wasmimport_PollableResourceDrop(self0 uint32) - -//go:wasmimport wasi:io/poll@0.2.0 [method]pollable.block -//go:noescape -func wasmimport_PollableBlock(self0 uint32) - -//go:wasmimport wasi:io/poll@0.2.0 [method]pollable.ready -//go:noescape -func wasmimport_PollableReady(self0 uint32) - -//go:wasmimport wasi:io/poll@0.2.0 poll -//go:noescape -func wasmimport_Poll(in0 *Pollable, in1 uint32) diff --git a/examples/component/http-client/gen/wasi/io/poll/poll.wit.go b/examples/component/http-client/gen/wasi/io/poll/poll.wit.go deleted file mode 100755 index 4a952ecf..00000000 --- a/examples/component/http-client/gen/wasi/io/poll/poll.wit.go +++ /dev/null @@ -1,57 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package poll represents the imported interface "wasi:io/poll@0.2.0". -package poll - -import ( - "go.bytecodealliance.org/cm" -) - -// Pollable represents the imported resource "wasi:io/poll@0.2.0#pollable". -// -// resource pollable -type Pollable cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "pollable". -// -// Drops a resource handle. -// -//go:nosplit -func (self Pollable) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_PollableResourceDrop((uint32)(self0)) - return -} - -// Block represents the imported method "block". -// -// block: func() -// -//go:nosplit -func (self Pollable) Block() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_PollableBlock((uint32)(self0)) - return -} - -// Ready represents the imported method "ready". -// -// ready: func() -// -//go:nosplit -func (self Pollable) Ready() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_PollableReady((uint32)(self0)) - return -} - -// Poll represents the imported function "poll". -// -// poll: func(in: list>) -// -//go:nosplit -func Poll(in cm.List[Pollable]) { - in0, in1 := cm.LowerList(in) - wasmimport_Poll((*Pollable)(in0), (uint32)(in1)) - return -} diff --git a/examples/component/http-client/gen/wasi/io/streams/empty.s b/examples/component/http-client/gen/wasi/io/streams/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/io/streams/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/io/streams/streams.wasm.go b/examples/component/http-client/gen/wasi/io/streams/streams.wasm.go deleted file mode 100755 index 98543c56..00000000 --- a/examples/component/http-client/gen/wasi/io/streams/streams.wasm.go +++ /dev/null @@ -1,73 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package streams - -// This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". - -//go:wasmimport wasi:io/streams@0.2.0 [resource-drop]input-stream -//go:noescape -func wasmimport_InputStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.blocking-read -//go:noescape -func wasmimport_InputStreamBlockingRead(self0 uint32, len0 uint64) - -//go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.blocking-skip -//go:noescape -func wasmimport_InputStreamBlockingSkip(self0 uint32, len0 uint64) - -//go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.read -//go:noescape -func wasmimport_InputStreamRead(self0 uint32, len0 uint64) - -//go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.skip -//go:noescape -func wasmimport_InputStreamSkip(self0 uint32, len0 uint64) - -//go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.subscribe -//go:noescape -func wasmimport_InputStreamSubscribe(self0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [resource-drop]output-stream -//go:noescape -func wasmimport_OutputStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-flush -//go:noescape -func wasmimport_OutputStreamBlockingFlush(self0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-splice -//go:noescape -func wasmimport_OutputStreamBlockingSplice(self0 uint32, src0 uint32, len0 uint64) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-write-and-flush -//go:noescape -func wasmimport_OutputStreamBlockingWriteAndFlush(self0 uint32, contents0 *uint8, contents1 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-write-zeroes-and-flush -//go:noescape -func wasmimport_OutputStreamBlockingWriteZeroesAndFlush(self0 uint32, len0 uint64) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.check-write -//go:noescape -func wasmimport_OutputStreamCheckWrite(self0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.flush -//go:noescape -func wasmimport_OutputStreamFlush(self0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.splice -//go:noescape -func wasmimport_OutputStreamSplice(self0 uint32, src0 uint32, len0 uint64) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.subscribe -//go:noescape -func wasmimport_OutputStreamSubscribe(self0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.write -//go:noescape -func wasmimport_OutputStreamWrite(self0 uint32, contents0 *uint8, contents1 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.write-zeroes -//go:noescape -func wasmimport_OutputStreamWriteZeroes(self0 uint32, len0 uint64) diff --git a/examples/component/http-client/gen/wasi/io/streams/streams.wit.go b/examples/component/http-client/gen/wasi/io/streams/streams.wit.go deleted file mode 100755 index 05300c4f..00000000 --- a/examples/component/http-client/gen/wasi/io/streams/streams.wit.go +++ /dev/null @@ -1,268 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package streams represents the imported interface "wasi:io/streams@0.2.0". -package streams - -import ( - ioerror "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/io/error" - "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/io/poll" - "go.bytecodealliance.org/cm" -) - -// Error represents the imported type alias "wasi:io/streams@0.2.0#error". -// -// See [ioerror.Error] for more information. -type Error = ioerror.Error - -// Pollable represents the imported type alias "wasi:io/streams@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// StreamError represents the imported variant "wasi:io/streams@0.2.0#stream-error". -// -// variant stream-error { -// last-operation-failed(error), -// closed, -// } -type StreamError cm.Variant[uint8, Error, Error] - -// StreamErrorLastOperationFailed returns a [StreamError] of case "last-operation-failed". -func StreamErrorLastOperationFailed(data Error) StreamError { - return cm.New[StreamError](0, data) -} - -// LastOperationFailed returns a non-nil *[Error] if [StreamError] represents the variant case "last-operation-failed". -func (self *StreamError) LastOperationFailed() *Error { - return cm.Case[Error](self, 0) -} - -// StreamErrorClosed returns a [StreamError] of case "closed". -func StreamErrorClosed() StreamError { - var data struct{} - return cm.New[StreamError](1, data) -} - -// Closed returns true if [StreamError] represents the variant case "closed". -func (self *StreamError) Closed() bool { - return self.Tag() == 1 -} - -var stringsStreamError = [2]string{ - "last-operation-failed", - "closed", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v StreamError) String() string { - return stringsStreamError[v.Tag()] -} - -// InputStream represents the imported resource "wasi:io/streams@0.2.0#input-stream". -// -// resource input-stream -type InputStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "input-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self InputStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_InputStreamResourceDrop((uint32)(self0)) - return -} - -// BlockingRead represents the imported method "blocking-read". -// -// blocking-read: func(len: u64) -// -//go:nosplit -func (self InputStream) BlockingRead(len_ uint64) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_InputStreamBlockingRead((uint32)(self0), (uint64)(len0)) - return -} - -// BlockingSkip represents the imported method "blocking-skip". -// -// blocking-skip: func(len: u64) -// -//go:nosplit -func (self InputStream) BlockingSkip(len_ uint64) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_InputStreamBlockingSkip((uint32)(self0), (uint64)(len0)) - return -} - -// Read represents the imported method "read". -// -// read: func(len: u64) -// -//go:nosplit -func (self InputStream) Read(len_ uint64) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_InputStreamRead((uint32)(self0), (uint64)(len0)) - return -} - -// Skip represents the imported method "skip". -// -// skip: func(len: u64) -// -//go:nosplit -func (self InputStream) Skip(len_ uint64) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_InputStreamSkip((uint32)(self0), (uint64)(len0)) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -// -//go:nosplit -func (self InputStream) Subscribe() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_InputStreamSubscribe((uint32)(self0)) - return -} - -// OutputStream represents the imported resource "wasi:io/streams@0.2.0#output-stream". -// -// resource output-stream -type OutputStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "output-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self OutputStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamResourceDrop((uint32)(self0)) - return -} - -// BlockingFlush represents the imported method "blocking-flush". -// -// blocking-flush: func() -// -//go:nosplit -func (self OutputStream) BlockingFlush() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamBlockingFlush((uint32)(self0)) - return -} - -// BlockingSplice represents the imported method "blocking-splice". -// -// blocking-splice: func(src: borrow, len: u64) -// -//go:nosplit -func (self OutputStream) BlockingSplice(src InputStream, len_ uint64) { - self0 := cm.Reinterpret[uint32](self) - src0 := cm.Reinterpret[uint32](src) - len0 := (uint64)(len_) - wasmimport_OutputStreamBlockingSplice((uint32)(self0), (uint32)(src0), (uint64)(len0)) - return -} - -// BlockingWriteAndFlush represents the imported method "blocking-write-and-flush". -// -// blocking-write-and-flush: func(contents: list) -// -//go:nosplit -func (self OutputStream) BlockingWriteAndFlush(contents cm.List[uint8]) { - self0 := cm.Reinterpret[uint32](self) - contents0, contents1 := cm.LowerList(contents) - wasmimport_OutputStreamBlockingWriteAndFlush((uint32)(self0), (*uint8)(contents0), (uint32)(contents1)) - return -} - -// BlockingWriteZeroesAndFlush represents the imported method "blocking-write-zeroes-and-flush". -// -// blocking-write-zeroes-and-flush: func(len: u64) -// -//go:nosplit -func (self OutputStream) BlockingWriteZeroesAndFlush(len_ uint64) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_OutputStreamBlockingWriteZeroesAndFlush((uint32)(self0), (uint64)(len0)) - return -} - -// CheckWrite represents the imported method "check-write". -// -// check-write: func() -// -//go:nosplit -func (self OutputStream) CheckWrite() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamCheckWrite((uint32)(self0)) - return -} - -// Flush represents the imported method "flush". -// -// flush: func() -// -//go:nosplit -func (self OutputStream) Flush() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamFlush((uint32)(self0)) - return -} - -// Splice represents the imported method "splice". -// -// splice: func(src: borrow, len: u64) -// -//go:nosplit -func (self OutputStream) Splice(src InputStream, len_ uint64) { - self0 := cm.Reinterpret[uint32](self) - src0 := cm.Reinterpret[uint32](src) - len0 := (uint64)(len_) - wasmimport_OutputStreamSplice((uint32)(self0), (uint32)(src0), (uint64)(len0)) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -// -//go:nosplit -func (self OutputStream) Subscribe() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamSubscribe((uint32)(self0)) - return -} - -// Write represents the imported method "write". -// -// write: func(contents: list) -// -//go:nosplit -func (self OutputStream) Write(contents cm.List[uint8]) { - self0 := cm.Reinterpret[uint32](self) - contents0, contents1 := cm.LowerList(contents) - wasmimport_OutputStreamWrite((uint32)(self0), (*uint8)(contents0), (uint32)(contents1)) - return -} - -// WriteZeroes represents the imported method "write-zeroes". -// -// write-zeroes: func(len: u64) -// -//go:nosplit -func (self OutputStream) WriteZeroes(len_ uint64) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_OutputStreamWriteZeroes((uint32)(self0), (uint64)(len0)) - return -} diff --git a/examples/component/http-client/gen/wasi/logging/logging/empty.s b/examples/component/http-client/gen/wasi/logging/logging/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/logging/logging/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/logging/logging/logging.wasm.go b/examples/component/http-client/gen/wasi/logging/logging/logging.wasm.go deleted file mode 100755 index d2d27098..00000000 --- a/examples/component/http-client/gen/wasi/logging/logging/logging.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package logging - -// This file contains wasmimport and wasmexport declarations for "wasi:logging@0.1.0-draft". - -//go:wasmimport wasi:logging/logging@0.1.0-draft log -//go:noescape -func wasmimport_Log(level0 uint32, context0 *uint8, context1 uint32, message0 *uint8, message1 uint32) diff --git a/examples/component/http-client/gen/wasi/logging/logging/logging.wit.go b/examples/component/http-client/gen/wasi/logging/logging/logging.wit.go deleted file mode 100755 index 96e406ed..00000000 --- a/examples/component/http-client/gen/wasi/logging/logging/logging.wit.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package logging represents the imported interface "wasi:logging/logging@0.1.0-draft". -package logging - -import ( - "go.bytecodealliance.org/cm" -) - -// Level represents the enum "wasi:logging/logging@0.1.0-draft#level". -// -// enum level { -// trace, -// debug, -// info, -// warn, -// error, -// critical -// } -type Level uint8 - -const ( - LevelTrace Level = iota - LevelDebug - LevelInfo - LevelWarn - LevelError - LevelCritical -) - -var stringsLevel = [6]string{ - "trace", - "debug", - "info", - "warn", - "error", - "critical", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e Level) String() string { - return stringsLevel[e] -} - -// Log represents the imported function "log". -// -// log: func(level: level, context: string, message: string) -// -//go:nosplit -func Log(level Level, context string, message string) { - level0 := (uint32)(level) - context0, context1 := cm.LowerString(context) - message0, message1 := cm.LowerString(message) - wasmimport_Log((uint32)(level0), (*uint8)(context0), (uint32)(context1), (*uint8)(message0), (uint32)(message1)) - return -} diff --git a/examples/component/http-client/gen/wasi/random/insecure-seed/empty.s b/examples/component/http-client/gen/wasi/random/insecure-seed/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/random/insecure-seed/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/random/insecure-seed/insecure-seed.wit.go b/examples/component/http-client/gen/wasi/random/insecure-seed/insecure-seed.wit.go deleted file mode 100755 index 6b9afd75..00000000 --- a/examples/component/http-client/gen/wasi/random/insecure-seed/insecure-seed.wit.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package insecureseed represents the imported interface "wasi:random/insecure-seed@0.2.0". -package insecureseed - -// InsecureSeed represents the imported function "insecure-seed". -// -// insecure-seed: func() -// -//go:nosplit -func InsecureSeed() { - wasmimport_InsecureSeed() - return -} diff --git a/examples/component/http-client/gen/wasi/random/insecure-seed/insecureseed.wasm.go b/examples/component/http-client/gen/wasi/random/insecure-seed/insecureseed.wasm.go deleted file mode 100755 index 6dc19c0b..00000000 --- a/examples/component/http-client/gen/wasi/random/insecure-seed/insecureseed.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package insecureseed - -// This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". - -//go:wasmimport wasi:random/insecure-seed@0.2.0 insecure-seed -//go:noescape -func wasmimport_InsecureSeed() diff --git a/examples/component/http-client/gen/wasi/random/insecure/empty.s b/examples/component/http-client/gen/wasi/random/insecure/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/random/insecure/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/random/insecure/insecure.wasm.go b/examples/component/http-client/gen/wasi/random/insecure/insecure.wasm.go deleted file mode 100755 index 41ffb551..00000000 --- a/examples/component/http-client/gen/wasi/random/insecure/insecure.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package insecure - -// This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". - -//go:wasmimport wasi:random/insecure@0.2.0 get-insecure-random-bytes -//go:noescape -func wasmimport_GetInsecureRandomBytes(len0 uint64) - -//go:wasmimport wasi:random/insecure@0.2.0 get-insecure-random-u64 -//go:noescape -func wasmimport_GetInsecureRandomU64() diff --git a/examples/component/http-client/gen/wasi/random/insecure/insecure.wit.go b/examples/component/http-client/gen/wasi/random/insecure/insecure.wit.go deleted file mode 100755 index add35465..00000000 --- a/examples/component/http-client/gen/wasi/random/insecure/insecure.wit.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package insecure represents the imported interface "wasi:random/insecure@0.2.0". -package insecure - -// GetInsecureRandomBytes represents the imported function "get-insecure-random-bytes". -// -// get-insecure-random-bytes: func(len: u64) -// -//go:nosplit -func GetInsecureRandomBytes(len_ uint64) { - len0 := (uint64)(len_) - wasmimport_GetInsecureRandomBytes((uint64)(len0)) - return -} - -// GetInsecureRandomU64 represents the imported function "get-insecure-random-u64". -// -// get-insecure-random-u64: func() -// -//go:nosplit -func GetInsecureRandomU64() { - wasmimport_GetInsecureRandomU64() - return -} diff --git a/examples/component/http-client/gen/wasi/random/random/empty.s b/examples/component/http-client/gen/wasi/random/random/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/random/random/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/random/random/random.wasm.go b/examples/component/http-client/gen/wasi/random/random/random.wasm.go deleted file mode 100755 index 512ee826..00000000 --- a/examples/component/http-client/gen/wasi/random/random/random.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package random - -// This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". - -//go:wasmimport wasi:random/random@0.2.0 get-random-bytes -//go:noescape -func wasmimport_GetRandomBytes(len0 uint64) - -//go:wasmimport wasi:random/random@0.2.0 get-random-u64 -//go:noescape -func wasmimport_GetRandomU64() diff --git a/examples/component/http-client/gen/wasi/random/random/random.wit.go b/examples/component/http-client/gen/wasi/random/random/random.wit.go deleted file mode 100755 index f11f988d..00000000 --- a/examples/component/http-client/gen/wasi/random/random/random.wit.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package random represents the imported interface "wasi:random/random@0.2.0". -package random - -// GetRandomBytes represents the imported function "get-random-bytes". -// -// get-random-bytes: func(len: u64) -// -//go:nosplit -func GetRandomBytes(len_ uint64) { - len0 := (uint64)(len_) - wasmimport_GetRandomBytes((uint64)(len0)) - return -} - -// GetRandomU64 represents the imported function "get-random-u64". -// -// get-random-u64: func() -// -//go:nosplit -func GetRandomU64() { - wasmimport_GetRandomU64() - return -} diff --git a/examples/component/http-client/gen/wasi/sockets/instance-network/empty.s b/examples/component/http-client/gen/wasi/sockets/instance-network/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/sockets/instance-network/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/sockets/instance-network/instance-network.wit.go b/examples/component/http-client/gen/wasi/sockets/instance-network/instance-network.wit.go deleted file mode 100755 index b454a29d..00000000 --- a/examples/component/http-client/gen/wasi/sockets/instance-network/instance-network.wit.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package instancenetwork represents the imported interface "wasi:sockets/instance-network@0.2.0". -package instancenetwork - -import ( - "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/sockets/network" -) - -// Network represents the imported type alias "wasi:sockets/instance-network@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// InstanceNetwork represents the imported function "instance-network". -// -// instance-network: func() -// -//go:nosplit -func InstanceNetwork() { - wasmimport_InstanceNetwork() - return -} diff --git a/examples/component/http-client/gen/wasi/sockets/instance-network/instancenetwork.wasm.go b/examples/component/http-client/gen/wasi/sockets/instance-network/instancenetwork.wasm.go deleted file mode 100755 index 01fc4839..00000000 --- a/examples/component/http-client/gen/wasi/sockets/instance-network/instancenetwork.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package instancenetwork - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/instance-network@0.2.0 instance-network -//go:noescape -func wasmimport_InstanceNetwork() diff --git a/examples/component/http-client/gen/wasi/sockets/ip-name-lookup/abi.go b/examples/component/http-client/gen/wasi/sockets/ip-name-lookup/abi.go deleted file mode 100755 index a63f0d01..00000000 --- a/examples/component/http-client/gen/wasi/sockets/ip-name-lookup/abi.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package ipnamelookup - -import ( - "go.bytecodealliance.org/cm" - "unsafe" -) - -// OptionIPAddressShape is used for storage in variant or result types. -type OptionIPAddressShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Option[IPAddress]{})]byte -} diff --git a/examples/component/http-client/gen/wasi/sockets/ip-name-lookup/empty.s b/examples/component/http-client/gen/wasi/sockets/ip-name-lookup/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/sockets/ip-name-lookup/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go b/examples/component/http-client/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go deleted file mode 100755 index d6b8d1fc..00000000 --- a/examples/component/http-client/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package ipnamelookup represents the imported interface "wasi:sockets/ip-name-lookup@0.2.0". -package ipnamelookup - -import ( - "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/io/poll" - "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/sockets/network" - "go.bytecodealliance.org/cm" -) - -// Pollable represents the imported type alias "wasi:sockets/ip-name-lookup@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// Network represents the imported type alias "wasi:sockets/ip-name-lookup@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// ErrorCode represents the type alias "wasi:sockets/ip-name-lookup@0.2.0#error-code". -// -// See [network.ErrorCode] for more information. -type ErrorCode = network.ErrorCode - -// IPAddress represents the type alias "wasi:sockets/ip-name-lookup@0.2.0#ip-address". -// -// See [network.IPAddress] for more information. -type IPAddress = network.IPAddress - -// ResolveAddressStream represents the imported resource "wasi:sockets/ip-name-lookup@0.2.0#resolve-address-stream". -// -// resource resolve-address-stream -type ResolveAddressStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "resolve-address-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self ResolveAddressStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_ResolveAddressStreamResourceDrop((uint32)(self0)) - return -} - -// ResolveNextAddress represents the imported method "resolve-next-address". -// -// resolve-next-address: func() -// -//go:nosplit -func (self ResolveAddressStream) ResolveNextAddress() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_ResolveAddressStreamResolveNextAddress((uint32)(self0)) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -// -//go:nosplit -func (self ResolveAddressStream) Subscribe() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_ResolveAddressStreamSubscribe((uint32)(self0)) - return -} - -// ResolveAddresses represents the imported function "resolve-addresses". -// -// resolve-addresses: func(network: borrow, name: string) -// -//go:nosplit -func ResolveAddresses(network_ Network, name string) { - network0 := cm.Reinterpret[uint32](network_) - name0, name1 := cm.LowerString(name) - wasmimport_ResolveAddresses((uint32)(network0), (*uint8)(name0), (uint32)(name1)) - return -} diff --git a/examples/component/http-client/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go b/examples/component/http-client/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go deleted file mode 100755 index df4d85bc..00000000 --- a/examples/component/http-client/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package ipnamelookup - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 [resource-drop]resolve-address-stream -//go:noescape -func wasmimport_ResolveAddressStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 [method]resolve-address-stream.resolve-next-address -//go:noescape -func wasmimport_ResolveAddressStreamResolveNextAddress(self0 uint32) - -//go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 [method]resolve-address-stream.subscribe -//go:noescape -func wasmimport_ResolveAddressStreamSubscribe(self0 uint32) - -//go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 resolve-addresses -//go:noescape -func wasmimport_ResolveAddresses(network0 uint32, name0 *uint8, name1 uint32) diff --git a/examples/component/http-client/gen/wasi/sockets/network/abi.go b/examples/component/http-client/gen/wasi/sockets/network/abi.go deleted file mode 100755 index a088bd1d..00000000 --- a/examples/component/http-client/gen/wasi/sockets/network/abi.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package network - -import ( - "go.bytecodealliance.org/cm" - "unsafe" -) - -// IPv6SocketAddressShape is used for storage in variant or result types. -type IPv6SocketAddressShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(IPv6SocketAddress{})]byte -} diff --git a/examples/component/http-client/gen/wasi/sockets/network/empty.s b/examples/component/http-client/gen/wasi/sockets/network/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/sockets/network/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/sockets/network/network.wasm.go b/examples/component/http-client/gen/wasi/sockets/network/network.wasm.go deleted file mode 100755 index 012a79ff..00000000 --- a/examples/component/http-client/gen/wasi/sockets/network/network.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package network - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/network@0.2.0 [resource-drop]network -//go:noescape -func wasmimport_NetworkResourceDrop(self0 uint32) diff --git a/examples/component/http-client/gen/wasi/sockets/network/network.wit.go b/examples/component/http-client/gen/wasi/sockets/network/network.wit.go deleted file mode 100755 index f0fb7eef..00000000 --- a/examples/component/http-client/gen/wasi/sockets/network/network.wit.go +++ /dev/null @@ -1,241 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package network represents the imported interface "wasi:sockets/network@0.2.0". -package network - -import ( - "go.bytecodealliance.org/cm" -) - -// Network represents the imported resource "wasi:sockets/network@0.2.0#network". -// -// resource network -type Network cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "network". -// -// Drops a resource handle. -// -//go:nosplit -func (self Network) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_NetworkResourceDrop((uint32)(self0)) - return -} - -// ErrorCode represents the enum "wasi:sockets/network@0.2.0#error-code". -// -// enum error-code { -// unknown, -// access-denied, -// not-supported, -// invalid-argument, -// out-of-memory, -// timeout, -// concurrency-conflict, -// not-in-progress, -// would-block, -// invalid-state, -// new-socket-limit, -// address-not-bindable, -// address-in-use, -// remote-unreachable, -// connection-refused, -// connection-reset, -// connection-aborted, -// datagram-too-large, -// name-unresolvable, -// temporary-resolver-failure, -// permanent-resolver-failure -// } -type ErrorCode uint8 - -const ( - ErrorCodeUnknown ErrorCode = iota - ErrorCodeAccessDenied - ErrorCodeNotSupported - ErrorCodeInvalidArgument - ErrorCodeOutOfMemory - ErrorCodeTimeout - ErrorCodeConcurrencyConflict - ErrorCodeNotInProgress - ErrorCodeWouldBlock - ErrorCodeInvalidState - ErrorCodeNewSocketLimit - ErrorCodeAddressNotBindable - ErrorCodeAddressInUse - ErrorCodeRemoteUnreachable - ErrorCodeConnectionRefused - ErrorCodeConnectionReset - ErrorCodeConnectionAborted - ErrorCodeDatagramTooLarge - ErrorCodeNameUnresolvable - ErrorCodeTemporaryResolverFailure - ErrorCodePermanentResolverFailure -) - -var stringsErrorCode = [21]string{ - "unknown", - "access-denied", - "not-supported", - "invalid-argument", - "out-of-memory", - "timeout", - "concurrency-conflict", - "not-in-progress", - "would-block", - "invalid-state", - "new-socket-limit", - "address-not-bindable", - "address-in-use", - "remote-unreachable", - "connection-refused", - "connection-reset", - "connection-aborted", - "datagram-too-large", - "name-unresolvable", - "temporary-resolver-failure", - "permanent-resolver-failure", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e ErrorCode) String() string { - return stringsErrorCode[e] -} - -// IPAddressFamily represents the enum "wasi:sockets/network@0.2.0#ip-address-family". -// -// enum ip-address-family { -// ipv4, -// ipv6 -// } -type IPAddressFamily uint8 - -const ( - IPAddressFamilyIPv4 IPAddressFamily = iota - IPAddressFamilyIPv6 -) - -var stringsIPAddressFamily = [2]string{ - "ipv4", - "ipv6", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e IPAddressFamily) String() string { - return stringsIPAddressFamily[e] -} - -// IPv4Address represents the tuple "wasi:sockets/network@0.2.0#ipv4-address". -// -// type ipv4-address = tuple -type IPv4Address [4]uint8 - -// IPv6Address represents the tuple "wasi:sockets/network@0.2.0#ipv6-address". -// -// type ipv6-address = tuple -type IPv6Address [8]uint16 - -// IPAddress represents the variant "wasi:sockets/network@0.2.0#ip-address". -// -// variant ip-address { -// ipv4(ipv4-address), -// ipv6(ipv6-address), -// } -type IPAddress cm.Variant[uint8, IPv6Address, IPv6Address] - -// IPAddressIPv4 returns a [IPAddress] of case "ipv4". -func IPAddressIPv4(data IPv4Address) IPAddress { - return cm.New[IPAddress](0, data) -} - -// IPv4 returns a non-nil *[IPv4Address] if [IPAddress] represents the variant case "ipv4". -func (self *IPAddress) IPv4() *IPv4Address { - return cm.Case[IPv4Address](self, 0) -} - -// IPAddressIPv6 returns a [IPAddress] of case "ipv6". -func IPAddressIPv6(data IPv6Address) IPAddress { - return cm.New[IPAddress](1, data) -} - -// IPv6 returns a non-nil *[IPv6Address] if [IPAddress] represents the variant case "ipv6". -func (self *IPAddress) IPv6() *IPv6Address { - return cm.Case[IPv6Address](self, 1) -} - -var stringsIPAddress = [2]string{ - "ipv4", - "ipv6", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v IPAddress) String() string { - return stringsIPAddress[v.Tag()] -} - -// IPv4SocketAddress represents the record "wasi:sockets/network@0.2.0#ipv4-socket-address". -// -// record ipv4-socket-address { -// port: u16, -// address: ipv4-address, -// } -type IPv4SocketAddress struct { - _ cm.HostLayout - Port uint16 - Address IPv4Address -} - -// IPv6SocketAddress represents the record "wasi:sockets/network@0.2.0#ipv6-socket-address". -// -// record ipv6-socket-address { -// port: u16, -// flow-info: u32, -// address: ipv6-address, -// scope-id: u32, -// } -type IPv6SocketAddress struct { - _ cm.HostLayout - Port uint16 - FlowInfo uint32 - Address IPv6Address - ScopeID uint32 -} - -// IPSocketAddress represents the variant "wasi:sockets/network@0.2.0#ip-socket-address". -// -// variant ip-socket-address { -// ipv4(ipv4-socket-address), -// ipv6(ipv6-socket-address), -// } -type IPSocketAddress cm.Variant[uint8, IPv6SocketAddressShape, IPv6SocketAddress] - -// IPSocketAddressIPv4 returns a [IPSocketAddress] of case "ipv4". -func IPSocketAddressIPv4(data IPv4SocketAddress) IPSocketAddress { - return cm.New[IPSocketAddress](0, data) -} - -// IPv4 returns a non-nil *[IPv4SocketAddress] if [IPSocketAddress] represents the variant case "ipv4". -func (self *IPSocketAddress) IPv4() *IPv4SocketAddress { - return cm.Case[IPv4SocketAddress](self, 0) -} - -// IPSocketAddressIPv6 returns a [IPSocketAddress] of case "ipv6". -func IPSocketAddressIPv6(data IPv6SocketAddress) IPSocketAddress { - return cm.New[IPSocketAddress](1, data) -} - -// IPv6 returns a non-nil *[IPv6SocketAddress] if [IPSocketAddress] represents the variant case "ipv6". -func (self *IPSocketAddress) IPv6() *IPv6SocketAddress { - return cm.Case[IPv6SocketAddress](self, 1) -} - -var stringsIPSocketAddress = [2]string{ - "ipv4", - "ipv6", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v IPSocketAddress) String() string { - return stringsIPSocketAddress[v.Tag()] -} diff --git a/examples/component/http-client/gen/wasi/sockets/tcp-create-socket/empty.s b/examples/component/http-client/gen/wasi/sockets/tcp-create-socket/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/sockets/tcp-create-socket/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go b/examples/component/http-client/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go deleted file mode 100755 index 1399b820..00000000 --- a/examples/component/http-client/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package tcpcreatesocket represents the imported interface "wasi:sockets/tcp-create-socket@0.2.0". -package tcpcreatesocket - -import ( - "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/sockets/network" - "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/sockets/tcp" -) - -// Network represents the imported type alias "wasi:sockets/tcp-create-socket@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// ErrorCode represents the type alias "wasi:sockets/tcp-create-socket@0.2.0#error-code". -// -// See [network.ErrorCode] for more information. -type ErrorCode = network.ErrorCode - -// IPAddressFamily represents the type alias "wasi:sockets/tcp-create-socket@0.2.0#ip-address-family". -// -// See [network.IPAddressFamily] for more information. -type IPAddressFamily = network.IPAddressFamily - -// TCPSocket represents the imported type alias "wasi:sockets/tcp-create-socket@0.2.0#tcp-socket". -// -// See [tcp.TCPSocket] for more information. -type TCPSocket = tcp.TCPSocket - -// CreateTCPSocket represents the imported function "create-tcp-socket". -// -// create-tcp-socket: func(address-family: ip-address-family) -// -//go:nosplit -func CreateTCPSocket(addressFamily IPAddressFamily) { - addressFamily0 := (uint32)(addressFamily) - wasmimport_CreateTCPSocket((uint32)(addressFamily0)) - return -} diff --git a/examples/component/http-client/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go b/examples/component/http-client/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go deleted file mode 100755 index 48d9b113..00000000 --- a/examples/component/http-client/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package tcpcreatesocket - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/tcp-create-socket@0.2.0 create-tcp-socket -//go:noescape -func wasmimport_CreateTCPSocket(addressFamily0 uint32) diff --git a/examples/component/http-client/gen/wasi/sockets/tcp/abi.go b/examples/component/http-client/gen/wasi/sockets/tcp/abi.go deleted file mode 100755 index e1b5e5d7..00000000 --- a/examples/component/http-client/gen/wasi/sockets/tcp/abi.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package tcp - -import ( - "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/sockets/network" - "go.bytecodealliance.org/cm" -) - -func lower_IPv4Address(v network.IPv4Address) (f0 uint32, f1 uint32, f2 uint32, f3 uint32) { - f0 = (uint32)(v[0]) - f1 = (uint32)(v[1]) - f2 = (uint32)(v[2]) - f3 = (uint32)(v[3]) - return -} - -func lower_IPv4SocketAddress(v network.IPv4SocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32) { - f0 = (uint32)(v.Port) - f1, f2, f3, f4 = lower_IPv4Address(v.Address) - return -} - -func lower_IPv6Address(v network.IPv6Address) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32) { - f0 = (uint32)(v[0]) - f1 = (uint32)(v[1]) - f2 = (uint32)(v[2]) - f3 = (uint32)(v[3]) - f4 = (uint32)(v[4]) - f5 = (uint32)(v[5]) - f6 = (uint32)(v[6]) - f7 = (uint32)(v[7]) - return -} - -func lower_IPv6SocketAddress(v network.IPv6SocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32) { - f0 = (uint32)(v.Port) - f1 = (uint32)(v.FlowInfo) - f2, f3, f4, f5, f6, f7, f8, f9 = lower_IPv6Address(v.Address) - f10 = (uint32)(v.ScopeID) - return -} - -func lower_IPSocketAddress(v network.IPSocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32, f11 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 0: // ipv4 - v1, v2, v3, v4, v5 := lower_IPv4SocketAddress(*cm.Case[network.IPv4SocketAddress](&v, 0)) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 1: // ipv6 - v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11 := lower_IPv6SocketAddress(*cm.Case[network.IPv6SocketAddress](&v, 1)) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - f6 = (uint32)(v6) - f7 = (uint32)(v7) - f8 = (uint32)(v8) - f9 = (uint32)(v9) - f10 = (uint32)(v10) - f11 = (uint32)(v11) - } - return -} diff --git a/examples/component/http-client/gen/wasi/sockets/tcp/empty.s b/examples/component/http-client/gen/wasi/sockets/tcp/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/sockets/tcp/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/sockets/tcp/tcp.wasm.go b/examples/component/http-client/gen/wasi/sockets/tcp/tcp.wasm.go deleted file mode 100755 index 3d3553be..00000000 --- a/examples/component/http-client/gen/wasi/sockets/tcp/tcp.wasm.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package tcp - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/tcp@0.2.0 [resource-drop]tcp-socket -//go:noescape -func wasmimport_TCPSocketResourceDrop(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.accept -//go:noescape -func wasmimport_TCPSocketAccept(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.address-family -//go:noescape -func wasmimport_TCPSocketAddressFamily(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-bind -//go:noescape -func wasmimport_TCPSocketFinishBind(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-connect -//go:noescape -func wasmimport_TCPSocketFinishConnect(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-listen -//go:noescape -func wasmimport_TCPSocketFinishListen(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.hop-limit -//go:noescape -func wasmimport_TCPSocketHopLimit(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.is-listening -//go:noescape -func wasmimport_TCPSocketIsListening(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-count -//go:noescape -func wasmimport_TCPSocketKeepAliveCount(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-enabled -//go:noescape -func wasmimport_TCPSocketKeepAliveEnabled(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-idle-time -//go:noescape -func wasmimport_TCPSocketKeepAliveIdleTime(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-interval -//go:noescape -func wasmimport_TCPSocketKeepAliveInterval(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.local-address -//go:noescape -func wasmimport_TCPSocketLocalAddress(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.receive-buffer-size -//go:noescape -func wasmimport_TCPSocketReceiveBufferSize(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.remote-address -//go:noescape -func wasmimport_TCPSocketRemoteAddress(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.send-buffer-size -//go:noescape -func wasmimport_TCPSocketSendBufferSize(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-hop-limit -//go:noescape -func wasmimport_TCPSocketSetHopLimit(self0 uint32, value0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-count -//go:noescape -func wasmimport_TCPSocketSetKeepAliveCount(self0 uint32, value0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-enabled -//go:noescape -func wasmimport_TCPSocketSetKeepAliveEnabled(self0 uint32, value0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-idle-time -//go:noescape -func wasmimport_TCPSocketSetKeepAliveIdleTime(self0 uint32, value0 uint64) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-interval -//go:noescape -func wasmimport_TCPSocketSetKeepAliveInterval(self0 uint32, value0 uint64) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-listen-backlog-size -//go:noescape -func wasmimport_TCPSocketSetListenBacklogSize(self0 uint32, value0 uint64) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-receive-buffer-size -//go:noescape -func wasmimport_TCPSocketSetReceiveBufferSize(self0 uint32, value0 uint64) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-send-buffer-size -//go:noescape -func wasmimport_TCPSocketSetSendBufferSize(self0 uint32, value0 uint64) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.shutdown -//go:noescape -func wasmimport_TCPSocketShutdown(self0 uint32, shutdownType0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-bind -//go:noescape -func wasmimport_TCPSocketStartBind(self0 uint32, network0 uint32, localAddress0 uint32, localAddress1 uint32, localAddress2 uint32, localAddress3 uint32, localAddress4 uint32, localAddress5 uint32, localAddress6 uint32, localAddress7 uint32, localAddress8 uint32, localAddress9 uint32, localAddress10 uint32, localAddress11 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-connect -//go:noescape -func wasmimport_TCPSocketStartConnect(self0 uint32, network0 uint32, remoteAddress0 uint32, remoteAddress1 uint32, remoteAddress2 uint32, remoteAddress3 uint32, remoteAddress4 uint32, remoteAddress5 uint32, remoteAddress6 uint32, remoteAddress7 uint32, remoteAddress8 uint32, remoteAddress9 uint32, remoteAddress10 uint32, remoteAddress11 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-listen -//go:noescape -func wasmimport_TCPSocketStartListen(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.subscribe -//go:noescape -func wasmimport_TCPSocketSubscribe(self0 uint32) diff --git a/examples/component/http-client/gen/wasi/sockets/tcp/tcp.wit.go b/examples/component/http-client/gen/wasi/sockets/tcp/tcp.wit.go deleted file mode 100755 index 26a180f7..00000000 --- a/examples/component/http-client/gen/wasi/sockets/tcp/tcp.wit.go +++ /dev/null @@ -1,415 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package tcp represents the imported interface "wasi:sockets/tcp@0.2.0". -package tcp - -import ( - monotonicclock "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/clocks/monotonic-clock" - "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/io/poll" - "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/io/streams" - "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/sockets/network" - "go.bytecodealliance.org/cm" -) - -// InputStream represents the imported type alias "wasi:sockets/tcp@0.2.0#input-stream". -// -// See [streams.InputStream] for more information. -type InputStream = streams.InputStream - -// OutputStream represents the imported type alias "wasi:sockets/tcp@0.2.0#output-stream". -// -// See [streams.OutputStream] for more information. -type OutputStream = streams.OutputStream - -// Pollable represents the imported type alias "wasi:sockets/tcp@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// Duration represents the type alias "wasi:sockets/tcp@0.2.0#duration". -// -// See [monotonicclock.Duration] for more information. -type Duration = monotonicclock.Duration - -// Network represents the imported type alias "wasi:sockets/tcp@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// ErrorCode represents the type alias "wasi:sockets/tcp@0.2.0#error-code". -// -// See [network.ErrorCode] for more information. -type ErrorCode = network.ErrorCode - -// IPSocketAddress represents the type alias "wasi:sockets/tcp@0.2.0#ip-socket-address". -// -// See [network.IPSocketAddress] for more information. -type IPSocketAddress = network.IPSocketAddress - -// IPAddressFamily represents the type alias "wasi:sockets/tcp@0.2.0#ip-address-family". -// -// See [network.IPAddressFamily] for more information. -type IPAddressFamily = network.IPAddressFamily - -// ShutdownType represents the enum "wasi:sockets/tcp@0.2.0#shutdown-type". -// -// enum shutdown-type { -// receive, -// send, -// both -// } -type ShutdownType uint8 - -const ( - ShutdownTypeReceive ShutdownType = iota - ShutdownTypeSend - ShutdownTypeBoth -) - -var stringsShutdownType = [3]string{ - "receive", - "send", - "both", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e ShutdownType) String() string { - return stringsShutdownType[e] -} - -// TCPSocket represents the imported resource "wasi:sockets/tcp@0.2.0#tcp-socket". -// -// resource tcp-socket -type TCPSocket cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "tcp-socket". -// -// Drops a resource handle. -// -//go:nosplit -func (self TCPSocket) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketResourceDrop((uint32)(self0)) - return -} - -// Accept represents the imported method "accept". -// -// accept: func() -// -//go:nosplit -func (self TCPSocket) Accept() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketAccept((uint32)(self0)) - return -} - -// AddressFamily represents the imported method "address-family". -// -// address-family: func() -// -//go:nosplit -func (self TCPSocket) AddressFamily() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketAddressFamily((uint32)(self0)) - return -} - -// FinishBind represents the imported method "finish-bind". -// -// finish-bind: func() -// -//go:nosplit -func (self TCPSocket) FinishBind() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketFinishBind((uint32)(self0)) - return -} - -// FinishConnect represents the imported method "finish-connect". -// -// finish-connect: func() -// -//go:nosplit -func (self TCPSocket) FinishConnect() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketFinishConnect((uint32)(self0)) - return -} - -// FinishListen represents the imported method "finish-listen". -// -// finish-listen: func() -// -//go:nosplit -func (self TCPSocket) FinishListen() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketFinishListen((uint32)(self0)) - return -} - -// HopLimit represents the imported method "hop-limit". -// -// hop-limit: func() -// -//go:nosplit -func (self TCPSocket) HopLimit() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketHopLimit((uint32)(self0)) - return -} - -// IsListening represents the imported method "is-listening". -// -// is-listening: func() -// -//go:nosplit -func (self TCPSocket) IsListening() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketIsListening((uint32)(self0)) - return -} - -// KeepAliveCount represents the imported method "keep-alive-count". -// -// keep-alive-count: func() -// -//go:nosplit -func (self TCPSocket) KeepAliveCount() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveCount((uint32)(self0)) - return -} - -// KeepAliveEnabled represents the imported method "keep-alive-enabled". -// -// keep-alive-enabled: func() -// -//go:nosplit -func (self TCPSocket) KeepAliveEnabled() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveEnabled((uint32)(self0)) - return -} - -// KeepAliveIdleTime represents the imported method "keep-alive-idle-time". -// -// keep-alive-idle-time: func() -// -//go:nosplit -func (self TCPSocket) KeepAliveIdleTime() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveIdleTime((uint32)(self0)) - return -} - -// KeepAliveInterval represents the imported method "keep-alive-interval". -// -// keep-alive-interval: func() -// -//go:nosplit -func (self TCPSocket) KeepAliveInterval() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveInterval((uint32)(self0)) - return -} - -// LocalAddress represents the imported method "local-address". -// -// local-address: func() -// -//go:nosplit -func (self TCPSocket) LocalAddress() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketLocalAddress((uint32)(self0)) - return -} - -// ReceiveBufferSize represents the imported method "receive-buffer-size". -// -// receive-buffer-size: func() -// -//go:nosplit -func (self TCPSocket) ReceiveBufferSize() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketReceiveBufferSize((uint32)(self0)) - return -} - -// RemoteAddress represents the imported method "remote-address". -// -// remote-address: func() -// -//go:nosplit -func (self TCPSocket) RemoteAddress() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketRemoteAddress((uint32)(self0)) - return -} - -// SendBufferSize represents the imported method "send-buffer-size". -// -// send-buffer-size: func() -// -//go:nosplit -func (self TCPSocket) SendBufferSize() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketSendBufferSize((uint32)(self0)) - return -} - -// SetHopLimit represents the imported method "set-hop-limit". -// -// set-hop-limit: func(value: u8) -// -//go:nosplit -func (self TCPSocket) SetHopLimit(value uint8) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint32)(value) - wasmimport_TCPSocketSetHopLimit((uint32)(self0), (uint32)(value0)) - return -} - -// SetKeepAliveCount represents the imported method "set-keep-alive-count". -// -// set-keep-alive-count: func(value: u32) -// -//go:nosplit -func (self TCPSocket) SetKeepAliveCount(value uint32) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint32)(value) - wasmimport_TCPSocketSetKeepAliveCount((uint32)(self0), (uint32)(value0)) - return -} - -// SetKeepAliveEnabled represents the imported method "set-keep-alive-enabled". -// -// set-keep-alive-enabled: func(value: bool) -// -//go:nosplit -func (self TCPSocket) SetKeepAliveEnabled(value bool) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint32)(cm.BoolToU32(value)) - wasmimport_TCPSocketSetKeepAliveEnabled((uint32)(self0), (uint32)(value0)) - return -} - -// SetKeepAliveIdleTime represents the imported method "set-keep-alive-idle-time". -// -// set-keep-alive-idle-time: func(value: duration) -// -//go:nosplit -func (self TCPSocket) SetKeepAliveIdleTime(value Duration) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_TCPSocketSetKeepAliveIdleTime((uint32)(self0), (uint64)(value0)) - return -} - -// SetKeepAliveInterval represents the imported method "set-keep-alive-interval". -// -// set-keep-alive-interval: func(value: duration) -// -//go:nosplit -func (self TCPSocket) SetKeepAliveInterval(value Duration) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_TCPSocketSetKeepAliveInterval((uint32)(self0), (uint64)(value0)) - return -} - -// SetListenBacklogSize represents the imported method "set-listen-backlog-size". -// -// set-listen-backlog-size: func(value: u64) -// -//go:nosplit -func (self TCPSocket) SetListenBacklogSize(value uint64) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_TCPSocketSetListenBacklogSize((uint32)(self0), (uint64)(value0)) - return -} - -// SetReceiveBufferSize represents the imported method "set-receive-buffer-size". -// -// set-receive-buffer-size: func(value: u64) -// -//go:nosplit -func (self TCPSocket) SetReceiveBufferSize(value uint64) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_TCPSocketSetReceiveBufferSize((uint32)(self0), (uint64)(value0)) - return -} - -// SetSendBufferSize represents the imported method "set-send-buffer-size". -// -// set-send-buffer-size: func(value: u64) -// -//go:nosplit -func (self TCPSocket) SetSendBufferSize(value uint64) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_TCPSocketSetSendBufferSize((uint32)(self0), (uint64)(value0)) - return -} - -// Shutdown represents the imported method "shutdown". -// -// shutdown: func(shutdown-type: shutdown-type) -// -//go:nosplit -func (self TCPSocket) Shutdown(shutdownType ShutdownType) { - self0 := cm.Reinterpret[uint32](self) - shutdownType0 := (uint32)(shutdownType) - wasmimport_TCPSocketShutdown((uint32)(self0), (uint32)(shutdownType0)) - return -} - -// StartBind represents the imported method "start-bind". -// -// start-bind: func(network: borrow, local-address: ip-socket-address) -// -//go:nosplit -func (self TCPSocket) StartBind(network_ Network, localAddress IPSocketAddress) { - self0 := cm.Reinterpret[uint32](self) - network0 := cm.Reinterpret[uint32](network_) - localAddress0, localAddress1, localAddress2, localAddress3, localAddress4, localAddress5, localAddress6, localAddress7, localAddress8, localAddress9, localAddress10, localAddress11 := lower_IPSocketAddress(localAddress) - wasmimport_TCPSocketStartBind((uint32)(self0), (uint32)(network0), (uint32)(localAddress0), (uint32)(localAddress1), (uint32)(localAddress2), (uint32)(localAddress3), (uint32)(localAddress4), (uint32)(localAddress5), (uint32)(localAddress6), (uint32)(localAddress7), (uint32)(localAddress8), (uint32)(localAddress9), (uint32)(localAddress10), (uint32)(localAddress11)) - return -} - -// StartConnect represents the imported method "start-connect". -// -// start-connect: func(network: borrow, remote-address: ip-socket-address) -// -//go:nosplit -func (self TCPSocket) StartConnect(network_ Network, remoteAddress IPSocketAddress) { - self0 := cm.Reinterpret[uint32](self) - network0 := cm.Reinterpret[uint32](network_) - remoteAddress0, remoteAddress1, remoteAddress2, remoteAddress3, remoteAddress4, remoteAddress5, remoteAddress6, remoteAddress7, remoteAddress8, remoteAddress9, remoteAddress10, remoteAddress11 := lower_IPSocketAddress(remoteAddress) - wasmimport_TCPSocketStartConnect((uint32)(self0), (uint32)(network0), (uint32)(remoteAddress0), (uint32)(remoteAddress1), (uint32)(remoteAddress2), (uint32)(remoteAddress3), (uint32)(remoteAddress4), (uint32)(remoteAddress5), (uint32)(remoteAddress6), (uint32)(remoteAddress7), (uint32)(remoteAddress8), (uint32)(remoteAddress9), (uint32)(remoteAddress10), (uint32)(remoteAddress11)) - return -} - -// StartListen represents the imported method "start-listen". -// -// start-listen: func() -// -//go:nosplit -func (self TCPSocket) StartListen() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketStartListen((uint32)(self0)) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -// -//go:nosplit -func (self TCPSocket) Subscribe() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketSubscribe((uint32)(self0)) - return -} diff --git a/examples/component/http-client/gen/wasi/sockets/udp-create-socket/empty.s b/examples/component/http-client/gen/wasi/sockets/udp-create-socket/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/sockets/udp-create-socket/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go b/examples/component/http-client/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go deleted file mode 100755 index 60011fc9..00000000 --- a/examples/component/http-client/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package udpcreatesocket represents the imported interface "wasi:sockets/udp-create-socket@0.2.0". -package udpcreatesocket - -import ( - "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/sockets/network" - "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/sockets/udp" -) - -// Network represents the imported type alias "wasi:sockets/udp-create-socket@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// ErrorCode represents the type alias "wasi:sockets/udp-create-socket@0.2.0#error-code". -// -// See [network.ErrorCode] for more information. -type ErrorCode = network.ErrorCode - -// IPAddressFamily represents the type alias "wasi:sockets/udp-create-socket@0.2.0#ip-address-family". -// -// See [network.IPAddressFamily] for more information. -type IPAddressFamily = network.IPAddressFamily - -// UDPSocket represents the imported type alias "wasi:sockets/udp-create-socket@0.2.0#udp-socket". -// -// See [udp.UDPSocket] for more information. -type UDPSocket = udp.UDPSocket - -// CreateUDPSocket represents the imported function "create-udp-socket". -// -// create-udp-socket: func(address-family: ip-address-family) -// -//go:nosplit -func CreateUDPSocket(addressFamily IPAddressFamily) { - addressFamily0 := (uint32)(addressFamily) - wasmimport_CreateUDPSocket((uint32)(addressFamily0)) - return -} diff --git a/examples/component/http-client/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go b/examples/component/http-client/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go deleted file mode 100755 index dfe49e18..00000000 --- a/examples/component/http-client/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package udpcreatesocket - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/udp-create-socket@0.2.0 create-udp-socket -//go:noescape -func wasmimport_CreateUDPSocket(addressFamily0 uint32) diff --git a/examples/component/http-client/gen/wasi/sockets/udp/abi.go b/examples/component/http-client/gen/wasi/sockets/udp/abi.go deleted file mode 100755 index cf83af26..00000000 --- a/examples/component/http-client/gen/wasi/sockets/udp/abi.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package udp - -import ( - "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/sockets/network" - "go.bytecodealliance.org/cm" -) - -func lower_IPv4Address(v network.IPv4Address) (f0 uint32, f1 uint32, f2 uint32, f3 uint32) { - f0 = (uint32)(v[0]) - f1 = (uint32)(v[1]) - f2 = (uint32)(v[2]) - f3 = (uint32)(v[3]) - return -} - -func lower_IPv4SocketAddress(v network.IPv4SocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32) { - f0 = (uint32)(v.Port) - f1, f2, f3, f4 = lower_IPv4Address(v.Address) - return -} - -func lower_IPv6Address(v network.IPv6Address) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32) { - f0 = (uint32)(v[0]) - f1 = (uint32)(v[1]) - f2 = (uint32)(v[2]) - f3 = (uint32)(v[3]) - f4 = (uint32)(v[4]) - f5 = (uint32)(v[5]) - f6 = (uint32)(v[6]) - f7 = (uint32)(v[7]) - return -} - -func lower_IPv6SocketAddress(v network.IPv6SocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32) { - f0 = (uint32)(v.Port) - f1 = (uint32)(v.FlowInfo) - f2, f3, f4, f5, f6, f7, f8, f9 = lower_IPv6Address(v.Address) - f10 = (uint32)(v.ScopeID) - return -} - -func lower_IPSocketAddress(v network.IPSocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32, f11 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 0: // ipv4 - v1, v2, v3, v4, v5 := lower_IPv4SocketAddress(*cm.Case[network.IPv4SocketAddress](&v, 0)) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 1: // ipv6 - v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11 := lower_IPv6SocketAddress(*cm.Case[network.IPv6SocketAddress](&v, 1)) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - f6 = (uint32)(v6) - f7 = (uint32)(v7) - f8 = (uint32)(v8) - f9 = (uint32)(v9) - f10 = (uint32)(v10) - f11 = (uint32)(v11) - } - return -} - -func lower_OptionIPSocketAddress(v cm.Option[IPSocketAddress]) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32, f11 uint32, f12 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12 := lower_IPSocketAddress(*some) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - f6 = (uint32)(v6) - f7 = (uint32)(v7) - f8 = (uint32)(v8) - f9 = (uint32)(v9) - f10 = (uint32)(v10) - f11 = (uint32)(v11) - f12 = (uint32)(v12) - } - return -} diff --git a/examples/component/http-client/gen/wasi/sockets/udp/empty.s b/examples/component/http-client/gen/wasi/sockets/udp/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasi/sockets/udp/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasi/sockets/udp/udp.wasm.go b/examples/component/http-client/gen/wasi/sockets/udp/udp.wasm.go deleted file mode 100755 index 0b0fd6ba..00000000 --- a/examples/component/http-client/gen/wasi/sockets/udp/udp.wasm.go +++ /dev/null @@ -1,89 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package udp - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/udp@0.2.0 [resource-drop]udp-socket -//go:noescape -func wasmimport_UDPSocketResourceDrop(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.address-family -//go:noescape -func wasmimport_UDPSocketAddressFamily(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.finish-bind -//go:noescape -func wasmimport_UDPSocketFinishBind(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.local-address -//go:noescape -func wasmimport_UDPSocketLocalAddress(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.receive-buffer-size -//go:noescape -func wasmimport_UDPSocketReceiveBufferSize(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.remote-address -//go:noescape -func wasmimport_UDPSocketRemoteAddress(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.send-buffer-size -//go:noescape -func wasmimport_UDPSocketSendBufferSize(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.set-receive-buffer-size -//go:noescape -func wasmimport_UDPSocketSetReceiveBufferSize(self0 uint32, value0 uint64) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.set-send-buffer-size -//go:noescape -func wasmimport_UDPSocketSetSendBufferSize(self0 uint32, value0 uint64) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.set-unicast-hop-limit -//go:noescape -func wasmimport_UDPSocketSetUnicastHopLimit(self0 uint32, value0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.start-bind -//go:noescape -func wasmimport_UDPSocketStartBind(self0 uint32, network0 uint32, localAddress0 uint32, localAddress1 uint32, localAddress2 uint32, localAddress3 uint32, localAddress4 uint32, localAddress5 uint32, localAddress6 uint32, localAddress7 uint32, localAddress8 uint32, localAddress9 uint32, localAddress10 uint32, localAddress11 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.stream -//go:noescape -func wasmimport_UDPSocketStream(self0 uint32, remoteAddress0 uint32, remoteAddress1 uint32, remoteAddress2 uint32, remoteAddress3 uint32, remoteAddress4 uint32, remoteAddress5 uint32, remoteAddress6 uint32, remoteAddress7 uint32, remoteAddress8 uint32, remoteAddress9 uint32, remoteAddress10 uint32, remoteAddress11 uint32, remoteAddress12 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.subscribe -//go:noescape -func wasmimport_UDPSocketSubscribe(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.unicast-hop-limit -//go:noescape -func wasmimport_UDPSocketUnicastHopLimit(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [resource-drop]incoming-datagram-stream -//go:noescape -func wasmimport_IncomingDatagramStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]incoming-datagram-stream.receive -//go:noescape -func wasmimport_IncomingDatagramStreamReceive(self0 uint32, maxResults0 uint64) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]incoming-datagram-stream.subscribe -//go:noescape -func wasmimport_IncomingDatagramStreamSubscribe(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [resource-drop]outgoing-datagram-stream -//go:noescape -func wasmimport_OutgoingDatagramStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]outgoing-datagram-stream.check-send -//go:noescape -func wasmimport_OutgoingDatagramStreamCheckSend(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]outgoing-datagram-stream.send -//go:noescape -func wasmimport_OutgoingDatagramStreamSend(self0 uint32, datagrams0 *OutgoingDatagram, datagrams1 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]outgoing-datagram-stream.subscribe -//go:noescape -func wasmimport_OutgoingDatagramStreamSubscribe(self0 uint32) diff --git a/examples/component/http-client/gen/wasi/sockets/udp/udp.wit.go b/examples/component/http-client/gen/wasi/sockets/udp/udp.wit.go deleted file mode 100755 index e3bb0079..00000000 --- a/examples/component/http-client/gen/wasi/sockets/udp/udp.wit.go +++ /dev/null @@ -1,313 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package udp represents the imported interface "wasi:sockets/udp@0.2.0". -package udp - -import ( - "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/io/poll" - "github.com/wasmCloud/go/examples/component/http-client/gen/wasi/sockets/network" - "go.bytecodealliance.org/cm" -) - -// Pollable represents the imported type alias "wasi:sockets/udp@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// Network represents the imported type alias "wasi:sockets/udp@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// ErrorCode represents the type alias "wasi:sockets/udp@0.2.0#error-code". -// -// See [network.ErrorCode] for more information. -type ErrorCode = network.ErrorCode - -// IPSocketAddress represents the type alias "wasi:sockets/udp@0.2.0#ip-socket-address". -// -// See [network.IPSocketAddress] for more information. -type IPSocketAddress = network.IPSocketAddress - -// IPAddressFamily represents the type alias "wasi:sockets/udp@0.2.0#ip-address-family". -// -// See [network.IPAddressFamily] for more information. -type IPAddressFamily = network.IPAddressFamily - -// IncomingDatagram represents the record "wasi:sockets/udp@0.2.0#incoming-datagram". -// -// record incoming-datagram { -// data: list, -// remote-address: ip-socket-address, -// } -type IncomingDatagram struct { - _ cm.HostLayout - Data cm.List[uint8] - RemoteAddress IPSocketAddress -} - -// OutgoingDatagram represents the record "wasi:sockets/udp@0.2.0#outgoing-datagram". -// -// record outgoing-datagram { -// data: list, -// remote-address: option, -// } -type OutgoingDatagram struct { - _ cm.HostLayout - Data cm.List[uint8] - RemoteAddress cm.Option[IPSocketAddress] -} - -// UDPSocket represents the imported resource "wasi:sockets/udp@0.2.0#udp-socket". -// -// resource udp-socket -type UDPSocket cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "udp-socket". -// -// Drops a resource handle. -// -//go:nosplit -func (self UDPSocket) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketResourceDrop((uint32)(self0)) - return -} - -// AddressFamily represents the imported method "address-family". -// -// address-family: func() -// -//go:nosplit -func (self UDPSocket) AddressFamily() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketAddressFamily((uint32)(self0)) - return -} - -// FinishBind represents the imported method "finish-bind". -// -// finish-bind: func() -// -//go:nosplit -func (self UDPSocket) FinishBind() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketFinishBind((uint32)(self0)) - return -} - -// LocalAddress represents the imported method "local-address". -// -// local-address: func() -// -//go:nosplit -func (self UDPSocket) LocalAddress() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketLocalAddress((uint32)(self0)) - return -} - -// ReceiveBufferSize represents the imported method "receive-buffer-size". -// -// receive-buffer-size: func() -// -//go:nosplit -func (self UDPSocket) ReceiveBufferSize() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketReceiveBufferSize((uint32)(self0)) - return -} - -// RemoteAddress represents the imported method "remote-address". -// -// remote-address: func() -// -//go:nosplit -func (self UDPSocket) RemoteAddress() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketRemoteAddress((uint32)(self0)) - return -} - -// SendBufferSize represents the imported method "send-buffer-size". -// -// send-buffer-size: func() -// -//go:nosplit -func (self UDPSocket) SendBufferSize() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketSendBufferSize((uint32)(self0)) - return -} - -// SetReceiveBufferSize represents the imported method "set-receive-buffer-size". -// -// set-receive-buffer-size: func(value: u64) -// -//go:nosplit -func (self UDPSocket) SetReceiveBufferSize(value uint64) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_UDPSocketSetReceiveBufferSize((uint32)(self0), (uint64)(value0)) - return -} - -// SetSendBufferSize represents the imported method "set-send-buffer-size". -// -// set-send-buffer-size: func(value: u64) -// -//go:nosplit -func (self UDPSocket) SetSendBufferSize(value uint64) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_UDPSocketSetSendBufferSize((uint32)(self0), (uint64)(value0)) - return -} - -// SetUnicastHopLimit represents the imported method "set-unicast-hop-limit". -// -// set-unicast-hop-limit: func(value: u8) -// -//go:nosplit -func (self UDPSocket) SetUnicastHopLimit(value uint8) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint32)(value) - wasmimport_UDPSocketSetUnicastHopLimit((uint32)(self0), (uint32)(value0)) - return -} - -// StartBind represents the imported method "start-bind". -// -// start-bind: func(network: borrow, local-address: ip-socket-address) -// -//go:nosplit -func (self UDPSocket) StartBind(network_ Network, localAddress IPSocketAddress) { - self0 := cm.Reinterpret[uint32](self) - network0 := cm.Reinterpret[uint32](network_) - localAddress0, localAddress1, localAddress2, localAddress3, localAddress4, localAddress5, localAddress6, localAddress7, localAddress8, localAddress9, localAddress10, localAddress11 := lower_IPSocketAddress(localAddress) - wasmimport_UDPSocketStartBind((uint32)(self0), (uint32)(network0), (uint32)(localAddress0), (uint32)(localAddress1), (uint32)(localAddress2), (uint32)(localAddress3), (uint32)(localAddress4), (uint32)(localAddress5), (uint32)(localAddress6), (uint32)(localAddress7), (uint32)(localAddress8), (uint32)(localAddress9), (uint32)(localAddress10), (uint32)(localAddress11)) - return -} - -// Stream represents the imported method "stream". -// -// %stream: func(remote-address: option) -// -//go:nosplit -func (self UDPSocket) Stream(remoteAddress cm.Option[IPSocketAddress]) { - self0 := cm.Reinterpret[uint32](self) - remoteAddress0, remoteAddress1, remoteAddress2, remoteAddress3, remoteAddress4, remoteAddress5, remoteAddress6, remoteAddress7, remoteAddress8, remoteAddress9, remoteAddress10, remoteAddress11, remoteAddress12 := lower_OptionIPSocketAddress(remoteAddress) - wasmimport_UDPSocketStream((uint32)(self0), (uint32)(remoteAddress0), (uint32)(remoteAddress1), (uint32)(remoteAddress2), (uint32)(remoteAddress3), (uint32)(remoteAddress4), (uint32)(remoteAddress5), (uint32)(remoteAddress6), (uint32)(remoteAddress7), (uint32)(remoteAddress8), (uint32)(remoteAddress9), (uint32)(remoteAddress10), (uint32)(remoteAddress11), (uint32)(remoteAddress12)) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -// -//go:nosplit -func (self UDPSocket) Subscribe() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketSubscribe((uint32)(self0)) - return -} - -// UnicastHopLimit represents the imported method "unicast-hop-limit". -// -// unicast-hop-limit: func() -// -//go:nosplit -func (self UDPSocket) UnicastHopLimit() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketUnicastHopLimit((uint32)(self0)) - return -} - -// IncomingDatagramStream represents the imported resource "wasi:sockets/udp@0.2.0#incoming-datagram-stream". -// -// resource incoming-datagram-stream -type IncomingDatagramStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "incoming-datagram-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self IncomingDatagramStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingDatagramStreamResourceDrop((uint32)(self0)) - return -} - -// Receive represents the imported method "receive". -// -// receive: func(max-results: u64) -// -//go:nosplit -func (self IncomingDatagramStream) Receive(maxResults uint64) { - self0 := cm.Reinterpret[uint32](self) - maxResults0 := (uint64)(maxResults) - wasmimport_IncomingDatagramStreamReceive((uint32)(self0), (uint64)(maxResults0)) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -// -//go:nosplit -func (self IncomingDatagramStream) Subscribe() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingDatagramStreamSubscribe((uint32)(self0)) - return -} - -// OutgoingDatagramStream represents the imported resource "wasi:sockets/udp@0.2.0#outgoing-datagram-stream". -// -// resource outgoing-datagram-stream -type OutgoingDatagramStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "outgoing-datagram-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self OutgoingDatagramStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingDatagramStreamResourceDrop((uint32)(self0)) - return -} - -// CheckSend represents the imported method "check-send". -// -// check-send: func() -// -//go:nosplit -func (self OutgoingDatagramStream) CheckSend() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingDatagramStreamCheckSend((uint32)(self0)) - return -} - -// Send represents the imported method "send". -// -// send: func(datagrams: list) -// -//go:nosplit -func (self OutgoingDatagramStream) Send(datagrams cm.List[OutgoingDatagram]) { - self0 := cm.Reinterpret[uint32](self) - datagrams0, datagrams1 := cm.LowerList(datagrams) - wasmimport_OutgoingDatagramStreamSend((uint32)(self0), (*OutgoingDatagram)(datagrams0), (uint32)(datagrams1)) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -// -//go:nosplit -func (self OutgoingDatagramStream) Subscribe() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingDatagramStreamSubscribe((uint32)(self0)) - return -} diff --git a/examples/component/http-client/gen/wasmcloud/bus/lattice/empty.s b/examples/component/http-client/gen/wasmcloud/bus/lattice/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasmcloud/bus/lattice/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasmcloud/bus/lattice/lattice.wasm.go b/examples/component/http-client/gen/wasmcloud/bus/lattice/lattice.wasm.go deleted file mode 100755 index 6c044549..00000000 --- a/examples/component/http-client/gen/wasmcloud/bus/lattice/lattice.wasm.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package lattice - -// This file contains wasmimport and wasmexport declarations for "wasmcloud:bus@1.0.0". - -//go:wasmimport wasmcloud:bus/lattice@1.0.0 [resource-drop]call-target-interface -//go:noescape -func wasmimport_CallTargetInterfaceResourceDrop(self0 uint32) - -//go:wasmimport wasmcloud:bus/lattice@1.0.0 [constructor]call-target-interface -//go:noescape -func wasmimport_NewCallTargetInterface(namespace0 *uint8, namespace1 uint32, package0 *uint8, package1 uint32, interface0 *uint8, interface1 uint32) - -//go:wasmimport wasmcloud:bus/lattice@1.0.0 set-link-name -//go:noescape -func wasmimport_SetLinkName(name0 *uint8, name1 uint32, interfaces0 *CallTargetInterface, interfaces1 uint32) diff --git a/examples/component/http-client/gen/wasmcloud/bus/lattice/lattice.wit.go b/examples/component/http-client/gen/wasmcloud/bus/lattice/lattice.wit.go deleted file mode 100755 index af5d44b6..00000000 --- a/examples/component/http-client/gen/wasmcloud/bus/lattice/lattice.wit.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package lattice represents the imported interface "wasmcloud:bus/lattice@1.0.0". -package lattice - -import ( - "go.bytecodealliance.org/cm" -) - -// CallTargetInterface represents the imported resource "wasmcloud:bus/lattice@1.0.0#call-target-interface". -// -// resource call-target-interface -type CallTargetInterface cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "call-target-interface". -// -// Drops a resource handle. -// -//go:nosplit -func (self CallTargetInterface) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_CallTargetInterfaceResourceDrop((uint32)(self0)) - return -} - -// NewCallTargetInterface represents the imported constructor for resource "call-target-interface". -// -// constructor(namespace: string, %package: string, %interface: string) -// -//go:nosplit -func NewCallTargetInterface(namespace string, package_ string, interface_ string) { - namespace0, namespace1 := cm.LowerString(namespace) - package0, package1 := cm.LowerString(package_) - interface0, interface1 := cm.LowerString(interface_) - wasmimport_NewCallTargetInterface((*uint8)(namespace0), (uint32)(namespace1), (*uint8)(package0), (uint32)(package1), (*uint8)(interface0), (uint32)(interface1)) - return -} - -// SetLinkName represents the imported function "set-link-name". -// -// set-link-name: func(name: string, interfaces: list) -// -//go:nosplit -func SetLinkName(name string, interfaces cm.List[CallTargetInterface]) { - name0, name1 := cm.LowerString(name) - interfaces0, interfaces1 := cm.LowerList(interfaces) - wasmimport_SetLinkName((*uint8)(name0), (uint32)(name1), (*CallTargetInterface)(interfaces0), (uint32)(interfaces1)) - return -} diff --git a/examples/component/http-client/gen/wasmcloud/secrets/reveal/empty.s b/examples/component/http-client/gen/wasmcloud/secrets/reveal/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasmcloud/secrets/reveal/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasmcloud/secrets/reveal/reveal.wasm.go b/examples/component/http-client/gen/wasmcloud/secrets/reveal/reveal.wasm.go deleted file mode 100755 index a6d83174..00000000 --- a/examples/component/http-client/gen/wasmcloud/secrets/reveal/reveal.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package reveal - -// This file contains wasmimport and wasmexport declarations for "wasmcloud:secrets@0.1.0-draft". - -//go:wasmimport wasmcloud:secrets/reveal@0.1.0-draft reveal -//go:noescape -func wasmimport_Reveal(s0 uint32) diff --git a/examples/component/http-client/gen/wasmcloud/secrets/reveal/reveal.wit.go b/examples/component/http-client/gen/wasmcloud/secrets/reveal/reveal.wit.go deleted file mode 100755 index 077a3369..00000000 --- a/examples/component/http-client/gen/wasmcloud/secrets/reveal/reveal.wit.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package reveal represents the imported interface "wasmcloud:secrets/reveal@0.1.0-draft". -package reveal - -import ( - "github.com/wasmCloud/go/examples/component/http-client/gen/wasmcloud/secrets/store" - "go.bytecodealliance.org/cm" -) - -// Secret represents the imported type alias "wasmcloud:secrets/reveal@0.1.0-draft#secret". -// -// See [store.Secret] for more information. -type Secret = store.Secret - -// SecretValue represents the type alias "wasmcloud:secrets/reveal@0.1.0-draft#secret-value". -// -// See [store.SecretValue] for more information. -type SecretValue = store.SecretValue - -// Reveal represents the imported function "reveal". -// -// reveal: func(s: borrow) -// -//go:nosplit -func Reveal(s Secret) { - s0 := cm.Reinterpret[uint32](s) - wasmimport_Reveal((uint32)(s0)) - return -} diff --git a/examples/component/http-client/gen/wasmcloud/secrets/store/abi.go b/examples/component/http-client/gen/wasmcloud/secrets/store/abi.go deleted file mode 100755 index 20affd6c..00000000 --- a/examples/component/http-client/gen/wasmcloud/secrets/store/abi.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package store - -import ( - "go.bytecodealliance.org/cm" - "unsafe" -) - -// SecretsErrorShape is used for storage in variant or result types. -type SecretsErrorShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(SecretsError{})]byte -} diff --git a/examples/component/http-client/gen/wasmcloud/secrets/store/empty.s b/examples/component/http-client/gen/wasmcloud/secrets/store/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-client/gen/wasmcloud/secrets/store/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-client/gen/wasmcloud/secrets/store/store.wasm.go b/examples/component/http-client/gen/wasmcloud/secrets/store/store.wasm.go deleted file mode 100755 index 4ef43490..00000000 --- a/examples/component/http-client/gen/wasmcloud/secrets/store/store.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package store - -// This file contains wasmimport and wasmexport declarations for "wasmcloud:secrets@0.1.0-draft". - -//go:wasmimport wasmcloud:secrets/store@0.1.0-draft [resource-drop]secret -//go:noescape -func wasmimport_SecretResourceDrop(self0 uint32) - -//go:wasmimport wasmcloud:secrets/store@0.1.0-draft get -//go:noescape -func wasmimport_Get(key0 *uint8, key1 uint32) diff --git a/examples/component/http-client/gen/wasmcloud/secrets/store/store.wit.go b/examples/component/http-client/gen/wasmcloud/secrets/store/store.wit.go deleted file mode 100755 index 405555fa..00000000 --- a/examples/component/http-client/gen/wasmcloud/secrets/store/store.wit.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package store represents the imported interface "wasmcloud:secrets/store@0.1.0-draft". -package store - -import ( - "go.bytecodealliance.org/cm" -) - -// SecretsError represents the variant "wasmcloud:secrets/store@0.1.0-draft#secrets-error". -// -// variant secrets-error { -// upstream(string), -// io(string), -// not-found, -// } -type SecretsError cm.Variant[uint8, string, string] - -// SecretsErrorUpstream returns a [SecretsError] of case "upstream". -func SecretsErrorUpstream(data string) SecretsError { - return cm.New[SecretsError](0, data) -} - -// Upstream returns a non-nil *[string] if [SecretsError] represents the variant case "upstream". -func (self *SecretsError) Upstream() *string { - return cm.Case[string](self, 0) -} - -// SecretsErrorIO returns a [SecretsError] of case "io". -func SecretsErrorIO(data string) SecretsError { - return cm.New[SecretsError](1, data) -} - -// IO returns a non-nil *[string] if [SecretsError] represents the variant case "io". -func (self *SecretsError) IO() *string { - return cm.Case[string](self, 1) -} - -// SecretsErrorNotFound returns a [SecretsError] of case "not-found". -func SecretsErrorNotFound() SecretsError { - var data struct{} - return cm.New[SecretsError](2, data) -} - -// NotFound returns true if [SecretsError] represents the variant case "not-found". -func (self *SecretsError) NotFound() bool { - return self.Tag() == 2 -} - -var stringsSecretsError = [3]string{ - "upstream", - "io", - "not-found", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v SecretsError) String() string { - return stringsSecretsError[v.Tag()] -} - -// SecretValue represents the variant "wasmcloud:secrets/store@0.1.0-draft#secret-value". -// -// variant secret-value { -// %string(string), -// bytes(list), -// } -type SecretValue cm.Variant[uint8, string, cm.List[uint8]] - -// SecretValueString_ returns a [SecretValue] of case "string". -func SecretValueString_(data string) SecretValue { - return cm.New[SecretValue](0, data) -} - -// String_ returns a non-nil *[string] if [SecretValue] represents the variant case "string". -func (self *SecretValue) String_() *string { - return cm.Case[string](self, 0) -} - -// SecretValueBytes returns a [SecretValue] of case "bytes". -func SecretValueBytes(data cm.List[uint8]) SecretValue { - return cm.New[SecretValue](1, data) -} - -// Bytes returns a non-nil *[cm.List[uint8]] if [SecretValue] represents the variant case "bytes". -func (self *SecretValue) Bytes() *cm.List[uint8] { - return cm.Case[cm.List[uint8]](self, 1) -} - -var stringsSecretValue = [2]string{ - "string", - "bytes", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v SecretValue) String() string { - return stringsSecretValue[v.Tag()] -} - -// Secret represents the imported resource "wasmcloud:secrets/store@0.1.0-draft#secret". -// -// resource secret -type Secret cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "secret". -// -// Drops a resource handle. -// -//go:nosplit -func (self Secret) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_SecretResourceDrop((uint32)(self0)) - return -} - -// Get represents the imported function "get". -// -// get: func(key: string) -// -//go:nosplit -func Get(key string) { - key0, key1 := cm.LowerString(key) - wasmimport_Get((*uint8)(key0), (uint32)(key1)) - return -} diff --git a/examples/component/http-password-checker/.gitignore b/examples/component/http-password-checker/.gitignore index a007feab..6892fd2b 100644 --- a/examples/component/http-password-checker/.gitignore +++ b/examples/component/http-password-checker/.gitignore @@ -1 +1,2 @@ build/* +gen/* diff --git a/examples/component/http-password-checker/gen/wasi/cli/environment/empty.s b/examples/component/http-password-checker/gen/wasi/cli/environment/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/environment/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/cli/environment/environment.wasm.go b/examples/component/http-password-checker/gen/wasi/cli/environment/environment.wasm.go deleted file mode 100755 index b4c02ba4..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/environment/environment.wasm.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package environment - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/environment@0.2.0 get-environment -//go:noescape -func wasmimport_GetEnvironment() - -//go:wasmimport wasi:cli/environment@0.2.0 get-arguments -//go:noescape -func wasmimport_GetArguments() - -//go:wasmimport wasi:cli/environment@0.2.0 initial-cwd -//go:noescape -func wasmimport_InitialCWD() diff --git a/examples/component/http-password-checker/gen/wasi/cli/environment/environment.wit.go b/examples/component/http-password-checker/gen/wasi/cli/environment/environment.wit.go deleted file mode 100755 index 7d1f8133..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/environment/environment.wit.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package environment represents the imported interface "wasi:cli/environment@0.2.0". -package environment - -// GetEnvironment represents the imported function "get-environment". -// -// get-environment: func() -// -//go:nosplit -func GetEnvironment() { - wasmimport_GetEnvironment() - return -} - -// GetArguments represents the imported function "get-arguments". -// -// get-arguments: func() -// -//go:nosplit -func GetArguments() { - wasmimport_GetArguments() - return -} - -// InitialCWD represents the imported function "initial-cwd". -// -// initial-cwd: func() -// -//go:nosplit -func InitialCWD() { - wasmimport_InitialCWD() - return -} diff --git a/examples/component/http-password-checker/gen/wasi/cli/exit/empty.s b/examples/component/http-password-checker/gen/wasi/cli/exit/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/exit/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/cli/exit/exit.wasm.go b/examples/component/http-password-checker/gen/wasi/cli/exit/exit.wasm.go deleted file mode 100755 index 849d5f50..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/exit/exit.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package exit - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/exit@0.2.0 exit -//go:noescape -func wasmimport_Exit(status0 uint32) diff --git a/examples/component/http-password-checker/gen/wasi/cli/exit/exit.wit.go b/examples/component/http-password-checker/gen/wasi/cli/exit/exit.wit.go deleted file mode 100755 index 7a347b60..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/exit/exit.wit.go +++ /dev/null @@ -1,19 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package exit represents the imported interface "wasi:cli/exit@0.2.0". -package exit - -import ( - "go.bytecodealliance.org/cm" -) - -// Exit represents the imported function "exit". -// -// exit: func(status: result) -// -//go:nosplit -func Exit(status cm.BoolResult) { - status0 := (uint32)(cm.BoolToU32(status)) - wasmimport_Exit((uint32)(status0)) - return -} diff --git a/examples/component/http-password-checker/gen/wasi/cli/stderr/empty.s b/examples/component/http-password-checker/gen/wasi/cli/stderr/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/stderr/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/cli/stderr/stderr.wasm.go b/examples/component/http-password-checker/gen/wasi/cli/stderr/stderr.wasm.go deleted file mode 100755 index 9c5bcdb9..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/stderr/stderr.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package stderr - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/stderr@0.2.0 get-stderr -//go:noescape -func wasmimport_GetStderr() diff --git a/examples/component/http-password-checker/gen/wasi/cli/stderr/stderr.wit.go b/examples/component/http-password-checker/gen/wasi/cli/stderr/stderr.wit.go deleted file mode 100755 index ddac2bda..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/stderr/stderr.wit.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package stderr represents the imported interface "wasi:cli/stderr@0.2.0". -package stderr - -import ( - "http-password-checker/gen/wasi/io/streams" -) - -// OutputStream represents the imported type alias "wasi:cli/stderr@0.2.0#output-stream". -// -// See [streams.OutputStream] for more information. -type OutputStream = streams.OutputStream - -// GetStderr represents the imported function "get-stderr". -// -// get-stderr: func() -// -//go:nosplit -func GetStderr() { - wasmimport_GetStderr() - return -} diff --git a/examples/component/http-password-checker/gen/wasi/cli/stdin/empty.s b/examples/component/http-password-checker/gen/wasi/cli/stdin/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/stdin/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/cli/stdin/stdin.wasm.go b/examples/component/http-password-checker/gen/wasi/cli/stdin/stdin.wasm.go deleted file mode 100755 index 090f2e31..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/stdin/stdin.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package stdin - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/stdin@0.2.0 get-stdin -//go:noescape -func wasmimport_GetStdin() diff --git a/examples/component/http-password-checker/gen/wasi/cli/stdin/stdin.wit.go b/examples/component/http-password-checker/gen/wasi/cli/stdin/stdin.wit.go deleted file mode 100755 index 55888f91..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/stdin/stdin.wit.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package stdin represents the imported interface "wasi:cli/stdin@0.2.0". -package stdin - -import ( - "http-password-checker/gen/wasi/io/streams" -) - -// InputStream represents the imported type alias "wasi:cli/stdin@0.2.0#input-stream". -// -// See [streams.InputStream] for more information. -type InputStream = streams.InputStream - -// GetStdin represents the imported function "get-stdin". -// -// get-stdin: func() -// -//go:nosplit -func GetStdin() { - wasmimport_GetStdin() - return -} diff --git a/examples/component/http-password-checker/gen/wasi/cli/stdout/empty.s b/examples/component/http-password-checker/gen/wasi/cli/stdout/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/stdout/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/cli/stdout/stdout.wasm.go b/examples/component/http-password-checker/gen/wasi/cli/stdout/stdout.wasm.go deleted file mode 100755 index 1a1a2650..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/stdout/stdout.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package stdout - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/stdout@0.2.0 get-stdout -//go:noescape -func wasmimport_GetStdout() diff --git a/examples/component/http-password-checker/gen/wasi/cli/stdout/stdout.wit.go b/examples/component/http-password-checker/gen/wasi/cli/stdout/stdout.wit.go deleted file mode 100755 index b123b280..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/stdout/stdout.wit.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package stdout represents the imported interface "wasi:cli/stdout@0.2.0". -package stdout - -import ( - "http-password-checker/gen/wasi/io/streams" -) - -// OutputStream represents the imported type alias "wasi:cli/stdout@0.2.0#output-stream". -// -// See [streams.OutputStream] for more information. -type OutputStream = streams.OutputStream - -// GetStdout represents the imported function "get-stdout". -// -// get-stdout: func() -// -//go:nosplit -func GetStdout() { - wasmimport_GetStdout() - return -} diff --git a/examples/component/http-password-checker/gen/wasi/cli/terminal-input/empty.s b/examples/component/http-password-checker/gen/wasi/cli/terminal-input/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/terminal-input/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/cli/terminal-input/terminal-input.wit.go b/examples/component/http-password-checker/gen/wasi/cli/terminal-input/terminal-input.wit.go deleted file mode 100755 index 18b9a9d7..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/terminal-input/terminal-input.wit.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package terminalinput represents the imported interface "wasi:cli/terminal-input@0.2.0". -package terminalinput - -import ( - "go.bytecodealliance.org/cm" -) - -// TerminalInput represents the imported resource "wasi:cli/terminal-input@0.2.0#terminal-input". -// -// resource terminal-input -type TerminalInput cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "terminal-input". -// -// Drops a resource handle. -// -//go:nosplit -func (self TerminalInput) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TerminalInputResourceDrop((uint32)(self0)) - return -} diff --git a/examples/component/http-password-checker/gen/wasi/cli/terminal-input/terminalinput.wasm.go b/examples/component/http-password-checker/gen/wasi/cli/terminal-input/terminalinput.wasm.go deleted file mode 100755 index 1df3794f..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/terminal-input/terminalinput.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package terminalinput - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/terminal-input@0.2.0 [resource-drop]terminal-input -//go:noescape -func wasmimport_TerminalInputResourceDrop(self0 uint32) diff --git a/examples/component/http-password-checker/gen/wasi/cli/terminal-output/empty.s b/examples/component/http-password-checker/gen/wasi/cli/terminal-output/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/terminal-output/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/cli/terminal-output/terminal-output.wit.go b/examples/component/http-password-checker/gen/wasi/cli/terminal-output/terminal-output.wit.go deleted file mode 100755 index 823aaf52..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/terminal-output/terminal-output.wit.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package terminaloutput represents the imported interface "wasi:cli/terminal-output@0.2.0". -package terminaloutput - -import ( - "go.bytecodealliance.org/cm" -) - -// TerminalOutput represents the imported resource "wasi:cli/terminal-output@0.2.0#terminal-output". -// -// resource terminal-output -type TerminalOutput cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "terminal-output". -// -// Drops a resource handle. -// -//go:nosplit -func (self TerminalOutput) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TerminalOutputResourceDrop((uint32)(self0)) - return -} diff --git a/examples/component/http-password-checker/gen/wasi/cli/terminal-output/terminaloutput.wasm.go b/examples/component/http-password-checker/gen/wasi/cli/terminal-output/terminaloutput.wasm.go deleted file mode 100755 index fb35fc41..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/terminal-output/terminaloutput.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package terminaloutput - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/terminal-output@0.2.0 [resource-drop]terminal-output -//go:noescape -func wasmimport_TerminalOutputResourceDrop(self0 uint32) diff --git a/examples/component/http-password-checker/gen/wasi/cli/terminal-stderr/empty.s b/examples/component/http-password-checker/gen/wasi/cli/terminal-stderr/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/terminal-stderr/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go b/examples/component/http-password-checker/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go deleted file mode 100755 index c9c97a7a..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package terminalstderr represents the imported interface "wasi:cli/terminal-stderr@0.2.0". -package terminalstderr - -import ( - terminaloutput "http-password-checker/gen/wasi/cli/terminal-output" -) - -// TerminalOutput represents the imported type alias "wasi:cli/terminal-stderr@0.2.0#terminal-output". -// -// See [terminaloutput.TerminalOutput] for more information. -type TerminalOutput = terminaloutput.TerminalOutput - -// GetTerminalStderr represents the imported function "get-terminal-stderr". -// -// get-terminal-stderr: func() -// -//go:nosplit -func GetTerminalStderr() { - wasmimport_GetTerminalStderr() - return -} diff --git a/examples/component/http-password-checker/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go b/examples/component/http-password-checker/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go deleted file mode 100755 index 03cbe909..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package terminalstderr - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/terminal-stderr@0.2.0 get-terminal-stderr -//go:noescape -func wasmimport_GetTerminalStderr() diff --git a/examples/component/http-password-checker/gen/wasi/cli/terminal-stdin/empty.s b/examples/component/http-password-checker/gen/wasi/cli/terminal-stdin/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/terminal-stdin/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go b/examples/component/http-password-checker/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go deleted file mode 100755 index b1423587..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package terminalstdin represents the imported interface "wasi:cli/terminal-stdin@0.2.0". -package terminalstdin - -import ( - terminalinput "http-password-checker/gen/wasi/cli/terminal-input" -) - -// TerminalInput represents the imported type alias "wasi:cli/terminal-stdin@0.2.0#terminal-input". -// -// See [terminalinput.TerminalInput] for more information. -type TerminalInput = terminalinput.TerminalInput - -// GetTerminalStdin represents the imported function "get-terminal-stdin". -// -// get-terminal-stdin: func() -// -//go:nosplit -func GetTerminalStdin() { - wasmimport_GetTerminalStdin() - return -} diff --git a/examples/component/http-password-checker/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go b/examples/component/http-password-checker/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go deleted file mode 100755 index 1a59d9fd..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package terminalstdin - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/terminal-stdin@0.2.0 get-terminal-stdin -//go:noescape -func wasmimport_GetTerminalStdin() diff --git a/examples/component/http-password-checker/gen/wasi/cli/terminal-stdout/empty.s b/examples/component/http-password-checker/gen/wasi/cli/terminal-stdout/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/terminal-stdout/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go b/examples/component/http-password-checker/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go deleted file mode 100755 index c38358ef..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package terminalstdout represents the imported interface "wasi:cli/terminal-stdout@0.2.0". -package terminalstdout - -import ( - terminaloutput "http-password-checker/gen/wasi/cli/terminal-output" -) - -// TerminalOutput represents the imported type alias "wasi:cli/terminal-stdout@0.2.0#terminal-output". -// -// See [terminaloutput.TerminalOutput] for more information. -type TerminalOutput = terminaloutput.TerminalOutput - -// GetTerminalStdout represents the imported function "get-terminal-stdout". -// -// get-terminal-stdout: func() -// -//go:nosplit -func GetTerminalStdout() { - wasmimport_GetTerminalStdout() - return -} diff --git a/examples/component/http-password-checker/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go b/examples/component/http-password-checker/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go deleted file mode 100755 index c45db1d2..00000000 --- a/examples/component/http-password-checker/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package terminalstdout - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/terminal-stdout@0.2.0 get-terminal-stdout -//go:noescape -func wasmimport_GetTerminalStdout() diff --git a/examples/component/http-password-checker/gen/wasi/clocks/monotonic-clock/empty.s b/examples/component/http-password-checker/gen/wasi/clocks/monotonic-clock/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/clocks/monotonic-clock/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go b/examples/component/http-password-checker/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go deleted file mode 100755 index 0d17e749..00000000 --- a/examples/component/http-password-checker/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package monotonicclock represents the imported interface "wasi:clocks/monotonic-clock@0.2.0". -package monotonicclock - -import ( - "http-password-checker/gen/wasi/io/poll" -) - -// Pollable represents the imported type alias "wasi:clocks/monotonic-clock@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// Instant represents the u64 "wasi:clocks/monotonic-clock@0.2.0#instant". -// -// type instant = u64 -type Instant uint64 - -// Duration represents the u64 "wasi:clocks/monotonic-clock@0.2.0#duration". -// -// type duration = u64 -type Duration uint64 - -// Now represents the imported function "now". -// -// now: func() -// -//go:nosplit -func Now() { - wasmimport_Now() - return -} - -// Resolution represents the imported function "resolution". -// -// resolution: func() -// -//go:nosplit -func Resolution() { - wasmimport_Resolution() - return -} - -// SubscribeInstant represents the imported function "subscribe-instant". -// -// subscribe-instant: func(when: instant) -// -//go:nosplit -func SubscribeInstant(when Instant) { - when0 := (uint64)(when) - wasmimport_SubscribeInstant((uint64)(when0)) - return -} - -// SubscribeDuration represents the imported function "subscribe-duration". -// -// subscribe-duration: func(when: duration) -// -//go:nosplit -func SubscribeDuration(when Duration) { - when0 := (uint64)(when) - wasmimport_SubscribeDuration((uint64)(when0)) - return -} diff --git a/examples/component/http-password-checker/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go b/examples/component/http-password-checker/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go deleted file mode 100755 index 4494c61a..00000000 --- a/examples/component/http-password-checker/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package monotonicclock - -// This file contains wasmimport and wasmexport declarations for "wasi:clocks@0.2.0". - -//go:wasmimport wasi:clocks/monotonic-clock@0.2.0 now -//go:noescape -func wasmimport_Now() - -//go:wasmimport wasi:clocks/monotonic-clock@0.2.0 resolution -//go:noescape -func wasmimport_Resolution() - -//go:wasmimport wasi:clocks/monotonic-clock@0.2.0 subscribe-instant -//go:noescape -func wasmimport_SubscribeInstant(when0 uint64) - -//go:wasmimport wasi:clocks/monotonic-clock@0.2.0 subscribe-duration -//go:noescape -func wasmimport_SubscribeDuration(when0 uint64) diff --git a/examples/component/http-password-checker/gen/wasi/clocks/wall-clock/empty.s b/examples/component/http-password-checker/gen/wasi/clocks/wall-clock/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/clocks/wall-clock/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/clocks/wall-clock/wall-clock.wit.go b/examples/component/http-password-checker/gen/wasi/clocks/wall-clock/wall-clock.wit.go deleted file mode 100755 index 308f0910..00000000 --- a/examples/component/http-password-checker/gen/wasi/clocks/wall-clock/wall-clock.wit.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package wallclock represents the imported interface "wasi:clocks/wall-clock@0.2.0". -package wallclock - -import ( - "go.bytecodealliance.org/cm" -) - -// DateTime represents the record "wasi:clocks/wall-clock@0.2.0#datetime". -// -// record datetime { -// seconds: u64, -// nanoseconds: u32, -// } -type DateTime struct { - _ cm.HostLayout - Seconds uint64 - Nanoseconds uint32 -} - -// Now represents the imported function "now". -// -// now: func() -// -//go:nosplit -func Now() { - wasmimport_Now() - return -} - -// Resolution represents the imported function "resolution". -// -// resolution: func() -// -//go:nosplit -func Resolution() { - wasmimport_Resolution() - return -} diff --git a/examples/component/http-password-checker/gen/wasi/clocks/wall-clock/wallclock.wasm.go b/examples/component/http-password-checker/gen/wasi/clocks/wall-clock/wallclock.wasm.go deleted file mode 100755 index 4efbaf84..00000000 --- a/examples/component/http-password-checker/gen/wasi/clocks/wall-clock/wallclock.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package wallclock - -// This file contains wasmimport and wasmexport declarations for "wasi:clocks@0.2.0". - -//go:wasmimport wasi:clocks/wall-clock@0.2.0 now -//go:noescape -func wasmimport_Now() - -//go:wasmimport wasi:clocks/wall-clock@0.2.0 resolution -//go:noescape -func wasmimport_Resolution() diff --git a/examples/component/http-password-checker/gen/wasi/config/runtime/abi.go b/examples/component/http-password-checker/gen/wasi/config/runtime/abi.go deleted file mode 100755 index 61412cbe..00000000 --- a/examples/component/http-password-checker/gen/wasi/config/runtime/abi.go +++ /dev/null @@ -1,20 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package runtime - -import ( - "go.bytecodealliance.org/cm" - "unsafe" -) - -// OptionStringShape is used for storage in variant or result types. -type OptionStringShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Option[string]{})]byte -} - -// ConfigErrorShape is used for storage in variant or result types. -type ConfigErrorShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(ConfigError{})]byte -} diff --git a/examples/component/http-password-checker/gen/wasi/config/runtime/empty.s b/examples/component/http-password-checker/gen/wasi/config/runtime/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/config/runtime/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/config/runtime/runtime.wasm.go b/examples/component/http-password-checker/gen/wasi/config/runtime/runtime.wasm.go deleted file mode 100755 index 4abfb286..00000000 --- a/examples/component/http-password-checker/gen/wasi/config/runtime/runtime.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package runtime - -// This file contains wasmimport and wasmexport declarations for "wasi:config@0.2.0-draft". - -//go:wasmimport wasi:config/runtime@0.2.0-draft get -//go:noescape -func wasmimport_Get(key0 *uint8, key1 uint32) - -//go:wasmimport wasi:config/runtime@0.2.0-draft get-all -//go:noescape -func wasmimport_GetAll() diff --git a/examples/component/http-password-checker/gen/wasi/config/runtime/runtime.wit.go b/examples/component/http-password-checker/gen/wasi/config/runtime/runtime.wit.go deleted file mode 100755 index 204a5c0c..00000000 --- a/examples/component/http-password-checker/gen/wasi/config/runtime/runtime.wit.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package runtime represents the imported interface "wasi:config/runtime@0.2.0-draft". -package runtime - -import ( - "go.bytecodealliance.org/cm" -) - -// ConfigError represents the variant "wasi:config/runtime@0.2.0-draft#config-error". -// -// variant config-error { -// upstream(string), -// io(string), -// } -type ConfigError cm.Variant[uint8, string, string] - -// ConfigErrorUpstream returns a [ConfigError] of case "upstream". -func ConfigErrorUpstream(data string) ConfigError { - return cm.New[ConfigError](0, data) -} - -// Upstream returns a non-nil *[string] if [ConfigError] represents the variant case "upstream". -func (self *ConfigError) Upstream() *string { - return cm.Case[string](self, 0) -} - -// ConfigErrorIO returns a [ConfigError] of case "io". -func ConfigErrorIO(data string) ConfigError { - return cm.New[ConfigError](1, data) -} - -// IO returns a non-nil *[string] if [ConfigError] represents the variant case "io". -func (self *ConfigError) IO() *string { - return cm.Case[string](self, 1) -} - -var stringsConfigError = [2]string{ - "upstream", - "io", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v ConfigError) String() string { - return stringsConfigError[v.Tag()] -} - -// Get represents the imported function "get". -// -// get: func(key: string) -// -//go:nosplit -func Get(key string) { - key0, key1 := cm.LowerString(key) - wasmimport_Get((*uint8)(key0), (uint32)(key1)) - return -} - -// GetAll represents the imported function "get-all". -// -// get-all: func() -// -//go:nosplit -func GetAll() { - wasmimport_GetAll() - return -} diff --git a/examples/component/http-password-checker/gen/wasi/filesystem/preopens/empty.s b/examples/component/http-password-checker/gen/wasi/filesystem/preopens/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/filesystem/preopens/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/filesystem/preopens/preopens.wasm.go b/examples/component/http-password-checker/gen/wasi/filesystem/preopens/preopens.wasm.go deleted file mode 100755 index 50885ee0..00000000 --- a/examples/component/http-password-checker/gen/wasi/filesystem/preopens/preopens.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package preopens - -// This file contains wasmimport and wasmexport declarations for "wasi:filesystem@0.2.0". - -//go:wasmimport wasi:filesystem/preopens@0.2.0 get-directories -//go:noescape -func wasmimport_GetDirectories() diff --git a/examples/component/http-password-checker/gen/wasi/filesystem/preopens/preopens.wit.go b/examples/component/http-password-checker/gen/wasi/filesystem/preopens/preopens.wit.go deleted file mode 100755 index 2145be9a..00000000 --- a/examples/component/http-password-checker/gen/wasi/filesystem/preopens/preopens.wit.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package preopens represents the imported interface "wasi:filesystem/preopens@0.2.0". -package preopens - -import ( - "http-password-checker/gen/wasi/filesystem/types" -) - -// Descriptor represents the imported type alias "wasi:filesystem/preopens@0.2.0#descriptor". -// -// See [types.Descriptor] for more information. -type Descriptor = types.Descriptor - -// GetDirectories represents the imported function "get-directories". -// -// get-directories: func() -// -//go:nosplit -func GetDirectories() { - wasmimport_GetDirectories() - return -} diff --git a/examples/component/http-password-checker/gen/wasi/filesystem/types/abi.go b/examples/component/http-password-checker/gen/wasi/filesystem/types/abi.go deleted file mode 100755 index efa146f7..00000000 --- a/examples/component/http-password-checker/gen/wasi/filesystem/types/abi.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package types - -import ( - "go.bytecodealliance.org/cm" - wallclock "http-password-checker/gen/wasi/clocks/wall-clock" -) - -func lower_DateTime(v wallclock.DateTime) (f0 uint64, f1 uint32) { - f0 = (uint64)(v.Seconds) - f1 = (uint32)(v.Nanoseconds) - return -} - -func lower_NewTimestamp(v NewTimestamp) (f0 uint32, f1 uint64, f2 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 2: // timestamp - v1, v2 := lower_DateTime(*cm.Case[DateTime](&v, 2)) - f1 = (uint64)(v1) - f2 = (uint32)(v2) - } - return -} diff --git a/examples/component/http-password-checker/gen/wasi/filesystem/types/empty.s b/examples/component/http-password-checker/gen/wasi/filesystem/types/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/filesystem/types/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/filesystem/types/types.wasm.go b/examples/component/http-password-checker/gen/wasi/filesystem/types/types.wasm.go deleted file mode 100755 index 7a2b9993..00000000 --- a/examples/component/http-password-checker/gen/wasi/filesystem/types/types.wasm.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package types - -// This file contains wasmimport and wasmexport declarations for "wasi:filesystem@0.2.0". - -//go:wasmimport wasi:filesystem/types@0.2.0 [resource-drop]descriptor -//go:noescape -func wasmimport_DescriptorResourceDrop(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.advise -//go:noescape -func wasmimport_DescriptorAdvise(self0 uint32, offset0 uint64, length0 uint64, advice0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.append-via-stream -//go:noescape -func wasmimport_DescriptorAppendViaStream(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.create-directory-at -//go:noescape -func wasmimport_DescriptorCreateDirectoryAt(self0 uint32, path0 *uint8, path1 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.get-flags -//go:noescape -func wasmimport_DescriptorGetFlags(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.get-type -//go:noescape -func wasmimport_DescriptorGetType(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.is-same-object -//go:noescape -func wasmimport_DescriptorIsSameObject(self0 uint32, other0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.link-at -//go:noescape -func wasmimport_DescriptorLinkAt(self0 uint32, oldPathFlags0 uint32, oldPath0 *uint8, oldPath1 uint32, newDescriptor0 uint32, newPath0 *uint8, newPath1 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.metadata-hash -//go:noescape -func wasmimport_DescriptorMetadataHash(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.metadata-hash-at -//go:noescape -func wasmimport_DescriptorMetadataHashAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.open-at -//go:noescape -func wasmimport_DescriptorOpenAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, openFlags0 uint32, flags0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.read -//go:noescape -func wasmimport_DescriptorRead(self0 uint32, length0 uint64, offset0 uint64) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.read-directory -//go:noescape -func wasmimport_DescriptorReadDirectory(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.read-via-stream -//go:noescape -func wasmimport_DescriptorReadViaStream(self0 uint32, offset0 uint64) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.readlink-at -//go:noescape -func wasmimport_DescriptorReadLinkAt(self0 uint32, path0 *uint8, path1 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.remove-directory-at -//go:noescape -func wasmimport_DescriptorRemoveDirectoryAt(self0 uint32, path0 *uint8, path1 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.rename-at -//go:noescape -func wasmimport_DescriptorRenameAt(self0 uint32, oldPath0 *uint8, oldPath1 uint32, newDescriptor0 uint32, newPath0 *uint8, newPath1 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.set-size -//go:noescape -func wasmimport_DescriptorSetSize(self0 uint32, size0 uint64) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.set-times -//go:noescape -func wasmimport_DescriptorSetTimes(self0 uint32, dataAccessTimestamp0 uint32, dataAccessTimestamp1 uint64, dataAccessTimestamp2 uint32, dataModificationTimestamp0 uint32, dataModificationTimestamp1 uint64, dataModificationTimestamp2 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.set-times-at -//go:noescape -func wasmimport_DescriptorSetTimesAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, dataAccessTimestamp0 uint32, dataAccessTimestamp1 uint64, dataAccessTimestamp2 uint32, dataModificationTimestamp0 uint32, dataModificationTimestamp1 uint64, dataModificationTimestamp2 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.stat -//go:noescape -func wasmimport_DescriptorStat(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.stat-at -//go:noescape -func wasmimport_DescriptorStatAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.symlink-at -//go:noescape -func wasmimport_DescriptorSymlinkAt(self0 uint32, oldPath0 *uint8, oldPath1 uint32, newPath0 *uint8, newPath1 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.sync -//go:noescape -func wasmimport_DescriptorSync(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.sync-data -//go:noescape -func wasmimport_DescriptorSyncData(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.unlink-file-at -//go:noescape -func wasmimport_DescriptorUnlinkFileAt(self0 uint32, path0 *uint8, path1 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.write -//go:noescape -func wasmimport_DescriptorWrite(self0 uint32, buffer0 *uint8, buffer1 uint32, offset0 uint64) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.write-via-stream -//go:noescape -func wasmimport_DescriptorWriteViaStream(self0 uint32, offset0 uint64) - -//go:wasmimport wasi:filesystem/types@0.2.0 [resource-drop]directory-entry-stream -//go:noescape -func wasmimport_DirectoryEntryStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]directory-entry-stream.read-directory-entry -//go:noescape -func wasmimport_DirectoryEntryStreamReadDirectoryEntry(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 filesystem-error-code -//go:noescape -func wasmimport_FilesystemErrorCode(err0 uint32) diff --git a/examples/component/http-password-checker/gen/wasi/filesystem/types/types.wit.go b/examples/component/http-password-checker/gen/wasi/filesystem/types/types.wit.go deleted file mode 100755 index c61191ef..00000000 --- a/examples/component/http-password-checker/gen/wasi/filesystem/types/types.wit.go +++ /dev/null @@ -1,783 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package types represents the imported interface "wasi:filesystem/types@0.2.0". -package types - -import ( - "go.bytecodealliance.org/cm" - wallclock "http-password-checker/gen/wasi/clocks/wall-clock" - "http-password-checker/gen/wasi/io/streams" -) - -// InputStream represents the imported type alias "wasi:filesystem/types@0.2.0#input-stream". -// -// See [streams.InputStream] for more information. -type InputStream = streams.InputStream - -// OutputStream represents the imported type alias "wasi:filesystem/types@0.2.0#output-stream". -// -// See [streams.OutputStream] for more information. -type OutputStream = streams.OutputStream - -// Error represents the imported type alias "wasi:filesystem/types@0.2.0#error". -// -// See [streams.Error] for more information. -type Error = streams.Error - -// DateTime represents the type alias "wasi:filesystem/types@0.2.0#datetime". -// -// See [wallclock.DateTime] for more information. -type DateTime = wallclock.DateTime - -// FileSize represents the u64 "wasi:filesystem/types@0.2.0#filesize". -// -// type filesize = u64 -type FileSize uint64 - -// DescriptorType represents the enum "wasi:filesystem/types@0.2.0#descriptor-type". -// -// enum descriptor-type { -// unknown, -// block-device, -// character-device, -// directory, -// fifo, -// symbolic-link, -// regular-file, -// socket -// } -type DescriptorType uint8 - -const ( - DescriptorTypeUnknown DescriptorType = iota - DescriptorTypeBlockDevice - DescriptorTypeCharacterDevice - DescriptorTypeDirectory - DescriptorTypeFIFO - DescriptorTypeSymbolicLink - DescriptorTypeRegularFile - DescriptorTypeSocket -) - -var stringsDescriptorType = [8]string{ - "unknown", - "block-device", - "character-device", - "directory", - "fifo", - "symbolic-link", - "regular-file", - "socket", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e DescriptorType) String() string { - return stringsDescriptorType[e] -} - -// DescriptorFlags represents the flags "wasi:filesystem/types@0.2.0#descriptor-flags". -// -// flags descriptor-flags { -// read, -// write, -// file-integrity-sync, -// data-integrity-sync, -// requested-write-sync, -// mutate-directory, -// } -type DescriptorFlags uint8 - -const ( - DescriptorFlagsRead DescriptorFlags = 1 << iota - DescriptorFlagsWrite - DescriptorFlagsFileIntegritySync - DescriptorFlagsDataIntegritySync - DescriptorFlagsRequestedWriteSync - DescriptorFlagsMutateDirectory -) - -// PathFlags represents the flags "wasi:filesystem/types@0.2.0#path-flags". -// -// flags path-flags { -// symlink-follow, -// } -type PathFlags uint8 - -const ( - PathFlagsSymlinkFollow PathFlags = 1 << iota -) - -// OpenFlags represents the flags "wasi:filesystem/types@0.2.0#open-flags". -// -// flags open-flags { -// create, -// directory, -// exclusive, -// truncate, -// } -type OpenFlags uint8 - -const ( - OpenFlagsCreate OpenFlags = 1 << iota - OpenFlagsDirectory - OpenFlagsExclusive - OpenFlagsTruncate -) - -// LinkCount represents the u64 "wasi:filesystem/types@0.2.0#link-count". -// -// type link-count = u64 -type LinkCount uint64 - -// DescriptorStat represents the record "wasi:filesystem/types@0.2.0#descriptor-stat". -// -// record descriptor-stat { -// %type: descriptor-type, -// link-count: link-count, -// size: filesize, -// data-access-timestamp: option, -// data-modification-timestamp: option, -// status-change-timestamp: option, -// } -type DescriptorStat struct { - _ cm.HostLayout - Type DescriptorType - LinkCount LinkCount - Size FileSize - DataAccessTimestamp cm.Option[DateTime] - DataModificationTimestamp cm.Option[DateTime] - StatusChangeTimestamp cm.Option[DateTime] -} - -// NewTimestamp represents the variant "wasi:filesystem/types@0.2.0#new-timestamp". -// -// variant new-timestamp { -// no-change, -// now, -// timestamp(datetime), -// } -type NewTimestamp cm.Variant[uint8, DateTime, DateTime] - -// NewTimestampNoChange returns a [NewTimestamp] of case "no-change". -func NewTimestampNoChange() NewTimestamp { - var data struct{} - return cm.New[NewTimestamp](0, data) -} - -// NoChange returns true if [NewTimestamp] represents the variant case "no-change". -func (self *NewTimestamp) NoChange() bool { - return self.Tag() == 0 -} - -// NewTimestampNow returns a [NewTimestamp] of case "now". -func NewTimestampNow() NewTimestamp { - var data struct{} - return cm.New[NewTimestamp](1, data) -} - -// Now returns true if [NewTimestamp] represents the variant case "now". -func (self *NewTimestamp) Now() bool { - return self.Tag() == 1 -} - -// NewTimestampTimestamp returns a [NewTimestamp] of case "timestamp". -func NewTimestampTimestamp(data DateTime) NewTimestamp { - return cm.New[NewTimestamp](2, data) -} - -// Timestamp returns a non-nil *[DateTime] if [NewTimestamp] represents the variant case "timestamp". -func (self *NewTimestamp) Timestamp() *DateTime { - return cm.Case[DateTime](self, 2) -} - -var stringsNewTimestamp = [3]string{ - "no-change", - "now", - "timestamp", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v NewTimestamp) String() string { - return stringsNewTimestamp[v.Tag()] -} - -// DirectoryEntry represents the record "wasi:filesystem/types@0.2.0#directory-entry". -// -// record directory-entry { -// %type: descriptor-type, -// name: string, -// } -type DirectoryEntry struct { - _ cm.HostLayout - Type DescriptorType - Name string -} - -// ErrorCode represents the enum "wasi:filesystem/types@0.2.0#error-code". -// -// enum error-code { -// access, -// would-block, -// already, -// bad-descriptor, -// busy, -// deadlock, -// quota, -// exist, -// file-too-large, -// illegal-byte-sequence, -// in-progress, -// interrupted, -// invalid, -// io, -// is-directory, -// loop, -// too-many-links, -// message-size, -// name-too-long, -// no-device, -// no-entry, -// no-lock, -// insufficient-memory, -// insufficient-space, -// not-directory, -// not-empty, -// not-recoverable, -// unsupported, -// no-tty, -// no-such-device, -// overflow, -// not-permitted, -// pipe, -// read-only, -// invalid-seek, -// text-file-busy, -// cross-device -// } -type ErrorCode uint8 - -const ( - ErrorCodeAccess ErrorCode = iota - ErrorCodeWouldBlock - ErrorCodeAlready - ErrorCodeBadDescriptor - ErrorCodeBusy - ErrorCodeDeadlock - ErrorCodeQuota - ErrorCodeExist - ErrorCodeFileTooLarge - ErrorCodeIllegalByteSequence - ErrorCodeInProgress - ErrorCodeInterrupted - ErrorCodeInvalid - ErrorCodeIO - ErrorCodeIsDirectory - ErrorCodeLoop - ErrorCodeTooManyLinks - ErrorCodeMessageSize - ErrorCodeNameTooLong - ErrorCodeNoDevice - ErrorCodeNoEntry - ErrorCodeNoLock - ErrorCodeInsufficientMemory - ErrorCodeInsufficientSpace - ErrorCodeNotDirectory - ErrorCodeNotEmpty - ErrorCodeNotRecoverable - ErrorCodeUnsupported - ErrorCodeNoTTY - ErrorCodeNoSuchDevice - ErrorCodeOverflow - ErrorCodeNotPermitted - ErrorCodePipe - ErrorCodeReadOnly - ErrorCodeInvalidSeek - ErrorCodeTextFileBusy - ErrorCodeCrossDevice -) - -var stringsErrorCode = [37]string{ - "access", - "would-block", - "already", - "bad-descriptor", - "busy", - "deadlock", - "quota", - "exist", - "file-too-large", - "illegal-byte-sequence", - "in-progress", - "interrupted", - "invalid", - "io", - "is-directory", - "loop", - "too-many-links", - "message-size", - "name-too-long", - "no-device", - "no-entry", - "no-lock", - "insufficient-memory", - "insufficient-space", - "not-directory", - "not-empty", - "not-recoverable", - "unsupported", - "no-tty", - "no-such-device", - "overflow", - "not-permitted", - "pipe", - "read-only", - "invalid-seek", - "text-file-busy", - "cross-device", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e ErrorCode) String() string { - return stringsErrorCode[e] -} - -// Advice represents the enum "wasi:filesystem/types@0.2.0#advice". -// -// enum advice { -// normal, -// sequential, -// random, -// will-need, -// dont-need, -// no-reuse -// } -type Advice uint8 - -const ( - AdviceNormal Advice = iota - AdviceSequential - AdviceRandom - AdviceWillNeed - AdviceDontNeed - AdviceNoReuse -) - -var stringsAdvice = [6]string{ - "normal", - "sequential", - "random", - "will-need", - "dont-need", - "no-reuse", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e Advice) String() string { - return stringsAdvice[e] -} - -// MetadataHashValue represents the record "wasi:filesystem/types@0.2.0#metadata-hash-value". -// -// record metadata-hash-value { -// lower: u64, -// upper: u64, -// } -type MetadataHashValue struct { - _ cm.HostLayout - Lower uint64 - Upper uint64 -} - -// Descriptor represents the imported resource "wasi:filesystem/types@0.2.0#descriptor". -// -// resource descriptor -type Descriptor cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "descriptor". -// -// Drops a resource handle. -// -//go:nosplit -func (self Descriptor) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorResourceDrop((uint32)(self0)) - return -} - -// Advise represents the imported method "advise". -// -// advise: func(offset: filesize, length: filesize, advice: advice) -// -//go:nosplit -func (self Descriptor) Advise(offset FileSize, length FileSize, advice Advice) { - self0 := cm.Reinterpret[uint32](self) - offset0 := (uint64)(offset) - length0 := (uint64)(length) - advice0 := (uint32)(advice) - wasmimport_DescriptorAdvise((uint32)(self0), (uint64)(offset0), (uint64)(length0), (uint32)(advice0)) - return -} - -// AppendViaStream represents the imported method "append-via-stream". -// -// append-via-stream: func() -// -//go:nosplit -func (self Descriptor) AppendViaStream() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorAppendViaStream((uint32)(self0)) - return -} - -// CreateDirectoryAt represents the imported method "create-directory-at". -// -// create-directory-at: func(path: string) -// -//go:nosplit -func (self Descriptor) CreateDirectoryAt(path string) { - self0 := cm.Reinterpret[uint32](self) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorCreateDirectoryAt((uint32)(self0), (*uint8)(path0), (uint32)(path1)) - return -} - -// GetFlags represents the imported method "get-flags". -// -// get-flags: func() -// -//go:nosplit -func (self Descriptor) GetFlags() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorGetFlags((uint32)(self0)) - return -} - -// GetType represents the imported method "get-type". -// -// get-type: func() -// -//go:nosplit -func (self Descriptor) GetType() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorGetType((uint32)(self0)) - return -} - -// IsSameObject represents the imported method "is-same-object". -// -// is-same-object: func(other: borrow) -// -//go:nosplit -func (self Descriptor) IsSameObject(other Descriptor) { - self0 := cm.Reinterpret[uint32](self) - other0 := cm.Reinterpret[uint32](other) - wasmimport_DescriptorIsSameObject((uint32)(self0), (uint32)(other0)) - return -} - -// LinkAt represents the imported method "link-at". -// -// link-at: func(old-path-flags: path-flags, old-path: string, new-descriptor: borrow, -// new-path: string) -// -//go:nosplit -func (self Descriptor) LinkAt(oldPathFlags PathFlags, oldPath string, newDescriptor Descriptor, newPath string) { - self0 := cm.Reinterpret[uint32](self) - oldPathFlags0 := (uint32)(oldPathFlags) - oldPath0, oldPath1 := cm.LowerString(oldPath) - newDescriptor0 := cm.Reinterpret[uint32](newDescriptor) - newPath0, newPath1 := cm.LowerString(newPath) - wasmimport_DescriptorLinkAt((uint32)(self0), (uint32)(oldPathFlags0), (*uint8)(oldPath0), (uint32)(oldPath1), (uint32)(newDescriptor0), (*uint8)(newPath0), (uint32)(newPath1)) - return -} - -// MetadataHash represents the imported method "metadata-hash". -// -// metadata-hash: func() -// -//go:nosplit -func (self Descriptor) MetadataHash() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorMetadataHash((uint32)(self0)) - return -} - -// MetadataHashAt represents the imported method "metadata-hash-at". -// -// metadata-hash-at: func(path-flags: path-flags, path: string) -// -//go:nosplit -func (self Descriptor) MetadataHashAt(pathFlags PathFlags, path string) { - self0 := cm.Reinterpret[uint32](self) - pathFlags0 := (uint32)(pathFlags) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorMetadataHashAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1)) - return -} - -// OpenAt represents the imported method "open-at". -// -// open-at: func(path-flags: path-flags, path: string, open-flags: open-flags, %flags: -// descriptor-flags) -// -//go:nosplit -func (self Descriptor) OpenAt(pathFlags PathFlags, path string, openFlags OpenFlags, flags DescriptorFlags) { - self0 := cm.Reinterpret[uint32](self) - pathFlags0 := (uint32)(pathFlags) - path0, path1 := cm.LowerString(path) - openFlags0 := (uint32)(openFlags) - flags0 := (uint32)(flags) - wasmimport_DescriptorOpenAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), (uint32)(openFlags0), (uint32)(flags0)) - return -} - -// Read represents the imported method "read". -// -// read: func(length: filesize, offset: filesize) -// -//go:nosplit -func (self Descriptor) Read(length FileSize, offset FileSize) { - self0 := cm.Reinterpret[uint32](self) - length0 := (uint64)(length) - offset0 := (uint64)(offset) - wasmimport_DescriptorRead((uint32)(self0), (uint64)(length0), (uint64)(offset0)) - return -} - -// ReadDirectory represents the imported method "read-directory". -// -// read-directory: func() -// -//go:nosplit -func (self Descriptor) ReadDirectory() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorReadDirectory((uint32)(self0)) - return -} - -// ReadViaStream represents the imported method "read-via-stream". -// -// read-via-stream: func(offset: filesize) -// -//go:nosplit -func (self Descriptor) ReadViaStream(offset FileSize) { - self0 := cm.Reinterpret[uint32](self) - offset0 := (uint64)(offset) - wasmimport_DescriptorReadViaStream((uint32)(self0), (uint64)(offset0)) - return -} - -// ReadLinkAt represents the imported method "readlink-at". -// -// readlink-at: func(path: string) -// -//go:nosplit -func (self Descriptor) ReadLinkAt(path string) { - self0 := cm.Reinterpret[uint32](self) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorReadLinkAt((uint32)(self0), (*uint8)(path0), (uint32)(path1)) - return -} - -// RemoveDirectoryAt represents the imported method "remove-directory-at". -// -// remove-directory-at: func(path: string) -// -//go:nosplit -func (self Descriptor) RemoveDirectoryAt(path string) { - self0 := cm.Reinterpret[uint32](self) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorRemoveDirectoryAt((uint32)(self0), (*uint8)(path0), (uint32)(path1)) - return -} - -// RenameAt represents the imported method "rename-at". -// -// rename-at: func(old-path: string, new-descriptor: borrow, new-path: -// string) -// -//go:nosplit -func (self Descriptor) RenameAt(oldPath string, newDescriptor Descriptor, newPath string) { - self0 := cm.Reinterpret[uint32](self) - oldPath0, oldPath1 := cm.LowerString(oldPath) - newDescriptor0 := cm.Reinterpret[uint32](newDescriptor) - newPath0, newPath1 := cm.LowerString(newPath) - wasmimport_DescriptorRenameAt((uint32)(self0), (*uint8)(oldPath0), (uint32)(oldPath1), (uint32)(newDescriptor0), (*uint8)(newPath0), (uint32)(newPath1)) - return -} - -// SetSize represents the imported method "set-size". -// -// set-size: func(size: filesize) -// -//go:nosplit -func (self Descriptor) SetSize(size FileSize) { - self0 := cm.Reinterpret[uint32](self) - size0 := (uint64)(size) - wasmimport_DescriptorSetSize((uint32)(self0), (uint64)(size0)) - return -} - -// SetTimes represents the imported method "set-times". -// -// set-times: func(data-access-timestamp: new-timestamp, data-modification-timestamp: -// new-timestamp) -// -//go:nosplit -func (self Descriptor) SetTimes(dataAccessTimestamp NewTimestamp, dataModificationTimestamp NewTimestamp) { - self0 := cm.Reinterpret[uint32](self) - dataAccessTimestamp0, dataAccessTimestamp1, dataAccessTimestamp2 := lower_NewTimestamp(dataAccessTimestamp) - dataModificationTimestamp0, dataModificationTimestamp1, dataModificationTimestamp2 := lower_NewTimestamp(dataModificationTimestamp) - wasmimport_DescriptorSetTimes((uint32)(self0), (uint32)(dataAccessTimestamp0), (uint64)(dataAccessTimestamp1), (uint32)(dataAccessTimestamp2), (uint32)(dataModificationTimestamp0), (uint64)(dataModificationTimestamp1), (uint32)(dataModificationTimestamp2)) - return -} - -// SetTimesAt represents the imported method "set-times-at". -// -// set-times-at: func(path-flags: path-flags, path: string, data-access-timestamp: -// new-timestamp, data-modification-timestamp: new-timestamp) -// -//go:nosplit -func (self Descriptor) SetTimesAt(pathFlags PathFlags, path string, dataAccessTimestamp NewTimestamp, dataModificationTimestamp NewTimestamp) { - self0 := cm.Reinterpret[uint32](self) - pathFlags0 := (uint32)(pathFlags) - path0, path1 := cm.LowerString(path) - dataAccessTimestamp0, dataAccessTimestamp1, dataAccessTimestamp2 := lower_NewTimestamp(dataAccessTimestamp) - dataModificationTimestamp0, dataModificationTimestamp1, dataModificationTimestamp2 := lower_NewTimestamp(dataModificationTimestamp) - wasmimport_DescriptorSetTimesAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), (uint32)(dataAccessTimestamp0), (uint64)(dataAccessTimestamp1), (uint32)(dataAccessTimestamp2), (uint32)(dataModificationTimestamp0), (uint64)(dataModificationTimestamp1), (uint32)(dataModificationTimestamp2)) - return -} - -// Stat represents the imported method "stat". -// -// stat: func() -// -//go:nosplit -func (self Descriptor) Stat() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorStat((uint32)(self0)) - return -} - -// StatAt represents the imported method "stat-at". -// -// stat-at: func(path-flags: path-flags, path: string) -// -//go:nosplit -func (self Descriptor) StatAt(pathFlags PathFlags, path string) { - self0 := cm.Reinterpret[uint32](self) - pathFlags0 := (uint32)(pathFlags) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorStatAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1)) - return -} - -// SymlinkAt represents the imported method "symlink-at". -// -// symlink-at: func(old-path: string, new-path: string) -// -//go:nosplit -func (self Descriptor) SymlinkAt(oldPath string, newPath string) { - self0 := cm.Reinterpret[uint32](self) - oldPath0, oldPath1 := cm.LowerString(oldPath) - newPath0, newPath1 := cm.LowerString(newPath) - wasmimport_DescriptorSymlinkAt((uint32)(self0), (*uint8)(oldPath0), (uint32)(oldPath1), (*uint8)(newPath0), (uint32)(newPath1)) - return -} - -// Sync represents the imported method "sync". -// -// sync: func() -// -//go:nosplit -func (self Descriptor) Sync() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorSync((uint32)(self0)) - return -} - -// SyncData represents the imported method "sync-data". -// -// sync-data: func() -// -//go:nosplit -func (self Descriptor) SyncData() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorSyncData((uint32)(self0)) - return -} - -// UnlinkFileAt represents the imported method "unlink-file-at". -// -// unlink-file-at: func(path: string) -// -//go:nosplit -func (self Descriptor) UnlinkFileAt(path string) { - self0 := cm.Reinterpret[uint32](self) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorUnlinkFileAt((uint32)(self0), (*uint8)(path0), (uint32)(path1)) - return -} - -// Write represents the imported method "write". -// -// write: func(buffer: list, offset: filesize) -// -//go:nosplit -func (self Descriptor) Write(buffer cm.List[uint8], offset FileSize) { - self0 := cm.Reinterpret[uint32](self) - buffer0, buffer1 := cm.LowerList(buffer) - offset0 := (uint64)(offset) - wasmimport_DescriptorWrite((uint32)(self0), (*uint8)(buffer0), (uint32)(buffer1), (uint64)(offset0)) - return -} - -// WriteViaStream represents the imported method "write-via-stream". -// -// write-via-stream: func(offset: filesize) -// -//go:nosplit -func (self Descriptor) WriteViaStream(offset FileSize) { - self0 := cm.Reinterpret[uint32](self) - offset0 := (uint64)(offset) - wasmimport_DescriptorWriteViaStream((uint32)(self0), (uint64)(offset0)) - return -} - -// DirectoryEntryStream represents the imported resource "wasi:filesystem/types@0.2.0#directory-entry-stream". -// -// resource directory-entry-stream -type DirectoryEntryStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "directory-entry-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self DirectoryEntryStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DirectoryEntryStreamResourceDrop((uint32)(self0)) - return -} - -// ReadDirectoryEntry represents the imported method "read-directory-entry". -// -// read-directory-entry: func() -// -//go:nosplit -func (self DirectoryEntryStream) ReadDirectoryEntry() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DirectoryEntryStreamReadDirectoryEntry((uint32)(self0)) - return -} - -// FilesystemErrorCode represents the imported function "filesystem-error-code". -// -// filesystem-error-code: func(err: borrow) -// -//go:nosplit -func FilesystemErrorCode(err Error) { - err0 := cm.Reinterpret[uint32](err) - wasmimport_FilesystemErrorCode((uint32)(err0)) - return -} diff --git a/examples/component/http-password-checker/gen/wasi/http/incoming-handler/empty.s b/examples/component/http-password-checker/gen/wasi/http/incoming-handler/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/http/incoming-handler/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/http/incoming-handler/incoming-handler.exports.go b/examples/component/http-password-checker/gen/wasi/http/incoming-handler/incoming-handler.exports.go deleted file mode 100755 index 673ccb48..00000000 --- a/examples/component/http-password-checker/gen/wasi/http/incoming-handler/incoming-handler.exports.go +++ /dev/null @@ -1,22 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package incominghandler - -// Exports represents the caller-defined exports from "wasi:http/incoming-handler@0.2.0". -var Exports struct { - // Handle represents the caller-defined, exported function "handle". - // - // This function is invoked with an incoming HTTP Request, and a resource - // `response-outparam` which provides the capability to reply with an HTTP - // Response. The response is sent by calling the `response-outparam.set` - // method, which allows execution to continue after the response has been - // sent. This enables both streaming to the response body, and performing other - // work. - // - // The implementor of this function must write a response to the - // `response-outparam` before returning, or else the caller will respond - // with an error on its behalf. - // - // handle: func(request: incoming-request, response-out: response-outparam) - Handle func(request IncomingRequest, responseOut ResponseOutparam) -} diff --git a/examples/component/http-password-checker/gen/wasi/http/incoming-handler/incoming-handler.wit.go b/examples/component/http-password-checker/gen/wasi/http/incoming-handler/incoming-handler.wit.go deleted file mode 100755 index f4d1b9cc..00000000 --- a/examples/component/http-password-checker/gen/wasi/http/incoming-handler/incoming-handler.wit.go +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package incominghandler represents the exported interface "wasi:http/incoming-handler@0.2.0". -// -// This interface defines a handler of incoming HTTP Requests. It should -// be exported by components which can respond to HTTP Requests. -package incominghandler - -import ( - "http-password-checker/gen/wasi/http/types" -) - -// IncomingRequest represents the exported type alias "wasi:http/incoming-handler@0.2.0#incoming-request". -// -// See [types.IncomingRequest] for more information. -type IncomingRequest = types.IncomingRequest - -// ResponseOutparam represents the exported type alias "wasi:http/incoming-handler@0.2.0#response-outparam". -// -// See [types.ResponseOutparam] for more information. -type ResponseOutparam = types.ResponseOutparam diff --git a/examples/component/http-password-checker/gen/wasi/http/incoming-handler/incominghandler.wasm.go b/examples/component/http-password-checker/gen/wasi/http/incoming-handler/incominghandler.wasm.go deleted file mode 100755 index eae429f3..00000000 --- a/examples/component/http-password-checker/gen/wasi/http/incoming-handler/incominghandler.wasm.go +++ /dev/null @@ -1,18 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package incominghandler - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:http@0.2.0". - -//go:wasmexport wasi:http/incoming-handler@0.2.0#handle -//export wasi:http/incoming-handler@0.2.0#handle -func wasmexport_Handle(request0 uint32, responseOut0 uint32) { - request := cm.Reinterpret[IncomingRequest]((uint32)(request0)) - responseOut := cm.Reinterpret[ResponseOutparam]((uint32)(responseOut0)) - Exports.Handle(request, responseOut) - return -} diff --git a/examples/component/http-password-checker/gen/wasi/http/outgoing-handler/abi.go b/examples/component/http-password-checker/gen/wasi/http/outgoing-handler/abi.go deleted file mode 100755 index 5c6a7b48..00000000 --- a/examples/component/http-password-checker/gen/wasi/http/outgoing-handler/abi.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package outgoinghandler - -import ( - "go.bytecodealliance.org/cm" -) - -func lower_OptionRequestOptions(v cm.Option[RequestOptions]) (f0 uint32, f1 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := cm.Reinterpret[uint32](*some) - f1 = (uint32)(v1) - } - return -} diff --git a/examples/component/http-password-checker/gen/wasi/http/outgoing-handler/empty.s b/examples/component/http-password-checker/gen/wasi/http/outgoing-handler/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/http/outgoing-handler/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go b/examples/component/http-password-checker/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go deleted file mode 100755 index facb69b2..00000000 --- a/examples/component/http-password-checker/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package outgoinghandler represents the imported interface "wasi:http/outgoing-handler@0.2.0". -// -// This interface defines a handler of outgoing HTTP Requests. It should be -// imported by components which wish to make HTTP Requests. -package outgoinghandler - -import ( - "go.bytecodealliance.org/cm" - "http-password-checker/gen/wasi/http/types" -) - -// OutgoingRequest represents the imported type alias "wasi:http/outgoing-handler@0.2.0#outgoing-request". -// -// See [types.OutgoingRequest] for more information. -type OutgoingRequest = types.OutgoingRequest - -// RequestOptions represents the imported type alias "wasi:http/outgoing-handler@0.2.0#request-options". -// -// See [types.RequestOptions] for more information. -type RequestOptions = types.RequestOptions - -// FutureIncomingResponse represents the imported type alias "wasi:http/outgoing-handler@0.2.0#future-incoming-response". -// -// See [types.FutureIncomingResponse] for more information. -type FutureIncomingResponse = types.FutureIncomingResponse - -// ErrorCode represents the type alias "wasi:http/outgoing-handler@0.2.0#error-code". -// -// See [types.ErrorCode] for more information. -type ErrorCode = types.ErrorCode - -// Handle represents the imported function "handle". -// -// This function is invoked with an outgoing HTTP Request, and it returns -// a resource `future-incoming-response` which represents an HTTP Response -// which may arrive in the future. -// -// The `options` argument accepts optional parameters for the HTTP -// protocol's transport layer. -// -// This function may return an error if the `outgoing-request` is invalid -// or not allowed to be made. Otherwise, protocol errors are reported -// through the `future-incoming-response`. -// -// handle: func(request: outgoing-request, options: option) -// -//go:nosplit -func Handle(request OutgoingRequest, options cm.Option[RequestOptions]) { - request0 := cm.Reinterpret[uint32](request) - options0, options1 := lower_OptionRequestOptions(options) - wasmimport_Handle((uint32)(request0), (uint32)(options0), (uint32)(options1)) - return -} diff --git a/examples/component/http-password-checker/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go b/examples/component/http-password-checker/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go deleted file mode 100755 index 1f362c2a..00000000 --- a/examples/component/http-password-checker/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package outgoinghandler - -// This file contains wasmimport and wasmexport declarations for "wasi:http@0.2.0". - -//go:wasmimport wasi:http/outgoing-handler@0.2.0 handle -//go:noescape -func wasmimport_Handle(request0 uint32, options0 uint32, options1 uint32) diff --git a/examples/component/http-password-checker/gen/wasi/http/types/abi.go b/examples/component/http-password-checker/gen/wasi/http/types/abi.go deleted file mode 100755 index 6ffb1fdd..00000000 --- a/examples/component/http-password-checker/gen/wasi/http/types/abi.go +++ /dev/null @@ -1,264 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package types - -import ( - "go.bytecodealliance.org/cm" - "unsafe" -) - -// OptionFieldSizePayloadShape is used for storage in variant or result types. -type OptionFieldSizePayloadShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Option[FieldSizePayload]{})]byte -} - -func lower_OptionString(v cm.Option[string]) (f0 uint32, f1 *uint8, f2 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1, v2 := cm.LowerString(*some) - f1 = (*uint8)(v1) - f2 = (uint32)(v2) - } - return -} - -func lower_Method(v Method) (f0 uint32, f1 *uint8, f2 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 9: // other - v1, v2 := cm.LowerString(*cm.Case[string](&v, 9)) - f1 = (*uint8)(v1) - f2 = (uint32)(v2) - } - return -} - -func lower_Scheme(v Scheme) (f0 uint32, f1 *uint8, f2 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 2: // other - v1, v2 := cm.LowerString(*cm.Case[string](&v, 2)) - f1 = (*uint8)(v1) - f2 = (uint32)(v2) - } - return -} - -func lower_OptionScheme(v cm.Option[Scheme]) (f0 uint32, f1 uint32, f2 *uint8, f3 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1, v2, v3 := lower_Scheme(*some) - f1 = (uint32)(v1) - f2 = (*uint8)(v2) - f3 = (uint32)(v3) - } - return -} - -func lower_OptionDuration(v cm.Option[Duration]) (f0 uint32, f1 uint64) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := (uint64)(*some) - f1 = (uint64)(v1) - } - return -} - -// ErrorCodeShape is used for storage in variant or result types. -type ErrorCodeShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(ErrorCode{})]byte -} - -func lower_OptionU16(v cm.Option[uint16]) (f0 uint32, f1 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := (uint32)(*some) - f1 = (uint32)(v1) - } - return -} - -func lower_DNSErrorPayload(v DNSErrorPayload) (f0 uint32, f1 *uint8, f2 uint32, f3 uint32, f4 uint32) { - f0, f1, f2 = lower_OptionString(v.Rcode) - f3, f4 = lower_OptionU16(v.InfoCode) - return -} - -func lower_OptionU8(v cm.Option[uint8]) (f0 uint32, f1 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := (uint32)(*some) - f1 = (uint32)(v1) - } - return -} - -func lower_TLSAlertReceivedPayload(v TLSAlertReceivedPayload) (f0 uint32, f1 uint32, f2 uint32, f3 *uint8, f4 uint32) { - f0, f1 = lower_OptionU8(v.AlertID) - f2, f3, f4 = lower_OptionString(v.AlertMessage) - return -} - -func lower_OptionU64(v cm.Option[uint64]) (f0 uint32, f1 uint64) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := (uint64)(*some) - f1 = (uint64)(v1) - } - return -} - -func lower_OptionU32(v cm.Option[uint32]) (f0 uint32, f1 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := (uint32)(*some) - f1 = (uint32)(v1) - } - return -} - -func lower_FieldSizePayload(v FieldSizePayload) (f0 uint32, f1 *uint8, f2 uint32, f3 uint32, f4 uint32) { - f0, f1, f2 = lower_OptionString(v.FieldName) - f3, f4 = lower_OptionU32(v.FieldSize) - return -} - -func lower_OptionFieldSizePayload(v cm.Option[FieldSizePayload]) (f0 uint32, f1 uint32, f2 *uint8, f3 uint32, f4 uint32, f5 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1, v2, v3, v4, v5 := lower_FieldSizePayload(*some) - f1 = (uint32)(v1) - f2 = (*uint8)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - } - return -} - -func lower_ErrorCode(v ErrorCode) (f0 uint32, f1 uint32, f2 uint64, f3 uint32, f4 uint32, f5 uint32, f6 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 1: // DNS-error - v1, v2, v3, v4, v5 := lower_DNSErrorPayload(*cm.Case[DNSErrorPayload](&v, 1)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 14: // TLS-alert-received - v1, v2, v3, v4, v5 := lower_TLSAlertReceivedPayload(*cm.Case[TLSAlertReceivedPayload](&v, 14)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(cm.PointerToU32(v4)) - f5 = (uint32)(v5) - case 17: // HTTP-request-body-size - v1, v2 := lower_OptionU64(*cm.Case[cm.Option[uint64]](&v, 17)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 21: // HTTP-request-header-section-size - v1, v2 := lower_OptionU32(*cm.Case[cm.Option[uint32]](&v, 21)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 22: // HTTP-request-header-size - v1, v2, v3, v4, v5, v6 := lower_OptionFieldSizePayload(*cm.Case[cm.Option[FieldSizePayload]](&v, 22)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - f3 = (uint32)(cm.PointerToU32(v3)) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - f6 = (uint32)(v6) - case 23: // HTTP-request-trailer-section-size - v1, v2 := lower_OptionU32(*cm.Case[cm.Option[uint32]](&v, 23)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 24: // HTTP-request-trailer-size - v1, v2, v3, v4, v5 := lower_FieldSizePayload(*cm.Case[FieldSizePayload](&v, 24)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 26: // HTTP-response-header-section-size - v1, v2 := lower_OptionU32(*cm.Case[cm.Option[uint32]](&v, 26)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 27: // HTTP-response-header-size - v1, v2, v3, v4, v5 := lower_FieldSizePayload(*cm.Case[FieldSizePayload](&v, 27)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 28: // HTTP-response-body-size - v1, v2 := lower_OptionU64(*cm.Case[cm.Option[uint64]](&v, 28)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 29: // HTTP-response-trailer-section-size - v1, v2 := lower_OptionU32(*cm.Case[cm.Option[uint32]](&v, 29)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 30: // HTTP-response-trailer-size - v1, v2, v3, v4, v5 := lower_FieldSizePayload(*cm.Case[FieldSizePayload](&v, 30)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 31: // HTTP-response-transfer-coding - v1, v2, v3 := lower_OptionString(*cm.Case[cm.Option[string]](&v, 31)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - case 32: // HTTP-response-content-coding - v1, v2, v3 := lower_OptionString(*cm.Case[cm.Option[string]](&v, 32)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - case 38: // internal-error - v1, v2, v3 := lower_OptionString(*cm.Case[cm.Option[string]](&v, 38)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - } - return -} - -func lower_ResultOutgoingResponseErrorCode(v cm.Result[ErrorCodeShape, OutgoingResponse, ErrorCode]) (f0 uint32, f1 uint32, f2 uint32, f3 uint64, f4 uint32, f5 uint32, f6 uint32, f7 uint32) { - if v.IsOK() { - v1 := cm.Reinterpret[uint32](*v.OK()) - f1 = (uint32)(v1) - } else { - f0 = 1 - v1, v2, v3, v4, v5, v6, v7 := lower_ErrorCode(*v.Err()) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint64)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - f6 = (uint32)(v6) - f7 = (uint32)(v7) - } - return -} - -func lower_OptionTrailers(v cm.Option[Trailers]) (f0 uint32, f1 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := cm.Reinterpret[uint32](*some) - f1 = (uint32)(v1) - } - return -} diff --git a/examples/component/http-password-checker/gen/wasi/http/types/empty.s b/examples/component/http-password-checker/gen/wasi/http/types/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/http/types/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/http/types/types.wasm.go b/examples/component/http-password-checker/gen/wasi/http/types/types.wasm.go deleted file mode 100755 index 584e55ae..00000000 --- a/examples/component/http-password-checker/gen/wasi/http/types/types.wasm.go +++ /dev/null @@ -1,257 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package types - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:http@0.2.0". - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]fields -//go:noescape -func wasmimport_FieldsResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [constructor]fields -//go:noescape -func wasmimport_NewFields() - -//go:wasmimport wasi:http/types@0.2.0 [static]fields.from-list -//go:noescape -func wasmimport_FieldsFromList(entries0 *cm.Tuple[FieldKey, FieldValue], entries1 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.append -//go:noescape -func wasmimport_FieldsAppend(self0 uint32, name0 *uint8, name1 uint32, value0 *uint8, value1 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.clone -//go:noescape -func wasmimport_FieldsClone(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.delete -//go:noescape -func wasmimport_FieldsDelete(self0 uint32, name0 *uint8, name1 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.entries -//go:noescape -func wasmimport_FieldsEntries(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.get -//go:noescape -func wasmimport_FieldsGet(self0 uint32, name0 *uint8, name1 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.has -//go:noescape -func wasmimport_FieldsHas(self0 uint32, name0 *uint8, name1 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.set -//go:noescape -func wasmimport_FieldsSet(self0 uint32, name0 *uint8, name1 uint32, value0 *FieldValue, value1 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]incoming-request -//go:noescape -func wasmimport_IncomingRequestResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.authority -//go:noescape -func wasmimport_IncomingRequestAuthority(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.consume -//go:noescape -func wasmimport_IncomingRequestConsume(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.headers -//go:noescape -func wasmimport_IncomingRequestHeaders(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.method -//go:noescape -func wasmimport_IncomingRequestMethod(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.path-with-query -//go:noescape -func wasmimport_IncomingRequestPathWithQuery(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.scheme -//go:noescape -func wasmimport_IncomingRequestScheme(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]outgoing-request -//go:noescape -func wasmimport_OutgoingRequestResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [constructor]outgoing-request -//go:noescape -func wasmimport_NewOutgoingRequest(headers0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.authority -//go:noescape -func wasmimport_OutgoingRequestAuthority(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.body -//go:noescape -func wasmimport_OutgoingRequestBody(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.headers -//go:noescape -func wasmimport_OutgoingRequestHeaders(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.method -//go:noescape -func wasmimport_OutgoingRequestMethod(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.path-with-query -//go:noescape -func wasmimport_OutgoingRequestPathWithQuery(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.scheme -//go:noescape -func wasmimport_OutgoingRequestScheme(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-authority -//go:noescape -func wasmimport_OutgoingRequestSetAuthority(self0 uint32, authority0 uint32, authority1 *uint8, authority2 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-method -//go:noescape -func wasmimport_OutgoingRequestSetMethod(self0 uint32, method0 uint32, method1 *uint8, method2 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-path-with-query -//go:noescape -func wasmimport_OutgoingRequestSetPathWithQuery(self0 uint32, pathWithQuery0 uint32, pathWithQuery1 *uint8, pathWithQuery2 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-scheme -//go:noescape -func wasmimport_OutgoingRequestSetScheme(self0 uint32, scheme0 uint32, scheme1 uint32, scheme2 *uint8, scheme3 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]request-options -//go:noescape -func wasmimport_RequestOptionsResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [constructor]request-options -//go:noescape -func wasmimport_NewRequestOptions() - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.between-bytes-timeout -//go:noescape -func wasmimport_RequestOptionsBetweenBytesTimeout(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.connect-timeout -//go:noescape -func wasmimport_RequestOptionsConnectTimeout(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.first-byte-timeout -//go:noescape -func wasmimport_RequestOptionsFirstByteTimeout(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.set-between-bytes-timeout -//go:noescape -func wasmimport_RequestOptionsSetBetweenBytesTimeout(self0 uint32, duration0 uint32, duration1 uint64) - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.set-connect-timeout -//go:noescape -func wasmimport_RequestOptionsSetConnectTimeout(self0 uint32, duration0 uint32, duration1 uint64) - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.set-first-byte-timeout -//go:noescape -func wasmimport_RequestOptionsSetFirstByteTimeout(self0 uint32, duration0 uint32, duration1 uint64) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]response-outparam -//go:noescape -func wasmimport_ResponseOutparamResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [static]response-outparam.set -//go:noescape -func wasmimport_ResponseOutparamSet(param0 uint32, response0 uint32, response1 uint32, response2 uint32, response3 uint64, response4 uint32, response5 uint32, response6 uint32, response7 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]incoming-response -//go:noescape -func wasmimport_IncomingResponseResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-response.consume -//go:noescape -func wasmimport_IncomingResponseConsume(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-response.headers -//go:noescape -func wasmimport_IncomingResponseHeaders(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-response.status -//go:noescape -func wasmimport_IncomingResponseStatus(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]incoming-body -//go:noescape -func wasmimport_IncomingBodyResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [static]incoming-body.finish -//go:noescape -func wasmimport_IncomingBodyFinish(this0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-body.stream -//go:noescape -func wasmimport_IncomingBodyStream(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]future-trailers -//go:noescape -func wasmimport_FutureTrailersResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]future-trailers.get -//go:noescape -func wasmimport_FutureTrailersGet(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]future-trailers.subscribe -//go:noescape -func wasmimport_FutureTrailersSubscribe(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]outgoing-response -//go:noescape -func wasmimport_OutgoingResponseResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [constructor]outgoing-response -//go:noescape -func wasmimport_NewOutgoingResponse(headers0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.body -//go:noescape -func wasmimport_OutgoingResponseBody(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.headers -//go:noescape -func wasmimport_OutgoingResponseHeaders(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.set-status-code -//go:noescape -func wasmimport_OutgoingResponseSetStatusCode(self0 uint32, statusCode0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.status-code -//go:noescape -func wasmimport_OutgoingResponseStatusCode(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]outgoing-body -//go:noescape -func wasmimport_OutgoingBodyResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [static]outgoing-body.finish -//go:noescape -func wasmimport_OutgoingBodyFinish(this0 uint32, trailers0 uint32, trailers1 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-body.write -//go:noescape -func wasmimport_OutgoingBodyWrite(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]future-incoming-response -//go:noescape -func wasmimport_FutureIncomingResponseResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]future-incoming-response.get -//go:noescape -func wasmimport_FutureIncomingResponseGet(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]future-incoming-response.subscribe -//go:noescape -func wasmimport_FutureIncomingResponseSubscribe(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 http-error-code -//go:noescape -func wasmimport_HTTPErrorCode(err0 uint32) diff --git a/examples/component/http-password-checker/gen/wasi/http/types/types.wit.go b/examples/component/http-password-checker/gen/wasi/http/types/types.wit.go deleted file mode 100755 index e20e027e..00000000 --- a/examples/component/http-password-checker/gen/wasi/http/types/types.wit.go +++ /dev/null @@ -1,1982 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package types represents the imported interface "wasi:http/types@0.2.0". -// -// This interface defines all of the types and methods for implementing -// HTTP Requests and Responses, both incoming and outgoing, as well as -// their headers, trailers, and bodies. -package types - -import ( - "go.bytecodealliance.org/cm" - monotonicclock "http-password-checker/gen/wasi/clocks/monotonic-clock" - ioerror "http-password-checker/gen/wasi/io/error" - "http-password-checker/gen/wasi/io/poll" - "http-password-checker/gen/wasi/io/streams" -) - -// Duration represents the type alias "wasi:http/types@0.2.0#duration". -// -// See [monotonicclock.Duration] for more information. -type Duration = monotonicclock.Duration - -// InputStream represents the imported type alias "wasi:http/types@0.2.0#input-stream". -// -// See [streams.InputStream] for more information. -type InputStream = streams.InputStream - -// OutputStream represents the imported type alias "wasi:http/types@0.2.0#output-stream". -// -// See [streams.OutputStream] for more information. -type OutputStream = streams.OutputStream - -// IOError represents the imported type alias "wasi:http/types@0.2.0#io-error". -// -// See [ioerror.Error] for more information. -type IOError = ioerror.Error - -// Pollable represents the imported type alias "wasi:http/types@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// Method represents the variant "wasi:http/types@0.2.0#method". -// -// This type corresponds to HTTP standard Methods. -// -// variant method { -// get, -// head, -// post, -// put, -// delete, -// connect, -// options, -// trace, -// patch, -// other(string), -// } -type Method cm.Variant[uint8, string, string] - -// MethodGet returns a [Method] of case "get". -func MethodGet() Method { - var data struct{} - return cm.New[Method](0, data) -} - -// Get returns true if [Method] represents the variant case "get". -func (self *Method) Get() bool { - return self.Tag() == 0 -} - -// MethodHead returns a [Method] of case "head". -func MethodHead() Method { - var data struct{} - return cm.New[Method](1, data) -} - -// Head returns true if [Method] represents the variant case "head". -func (self *Method) Head() bool { - return self.Tag() == 1 -} - -// MethodPost returns a [Method] of case "post". -func MethodPost() Method { - var data struct{} - return cm.New[Method](2, data) -} - -// Post returns true if [Method] represents the variant case "post". -func (self *Method) Post() bool { - return self.Tag() == 2 -} - -// MethodPut returns a [Method] of case "put". -func MethodPut() Method { - var data struct{} - return cm.New[Method](3, data) -} - -// Put returns true if [Method] represents the variant case "put". -func (self *Method) Put() bool { - return self.Tag() == 3 -} - -// MethodDelete returns a [Method] of case "delete". -func MethodDelete() Method { - var data struct{} - return cm.New[Method](4, data) -} - -// Delete returns true if [Method] represents the variant case "delete". -func (self *Method) Delete() bool { - return self.Tag() == 4 -} - -// MethodConnect returns a [Method] of case "connect". -func MethodConnect() Method { - var data struct{} - return cm.New[Method](5, data) -} - -// Connect returns true if [Method] represents the variant case "connect". -func (self *Method) Connect() bool { - return self.Tag() == 5 -} - -// MethodOptions returns a [Method] of case "options". -func MethodOptions() Method { - var data struct{} - return cm.New[Method](6, data) -} - -// Options returns true if [Method] represents the variant case "options". -func (self *Method) Options() bool { - return self.Tag() == 6 -} - -// MethodTrace returns a [Method] of case "trace". -func MethodTrace() Method { - var data struct{} - return cm.New[Method](7, data) -} - -// Trace returns true if [Method] represents the variant case "trace". -func (self *Method) Trace() bool { - return self.Tag() == 7 -} - -// MethodPatch returns a [Method] of case "patch". -func MethodPatch() Method { - var data struct{} - return cm.New[Method](8, data) -} - -// Patch returns true if [Method] represents the variant case "patch". -func (self *Method) Patch() bool { - return self.Tag() == 8 -} - -// MethodOther returns a [Method] of case "other". -func MethodOther(data string) Method { - return cm.New[Method](9, data) -} - -// Other returns a non-nil *[string] if [Method] represents the variant case "other". -func (self *Method) Other() *string { - return cm.Case[string](self, 9) -} - -var stringsMethod = [10]string{ - "get", - "head", - "post", - "put", - "delete", - "connect", - "options", - "trace", - "patch", - "other", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v Method) String() string { - return stringsMethod[v.Tag()] -} - -// Scheme represents the variant "wasi:http/types@0.2.0#scheme". -// -// This type corresponds to HTTP standard Related Schemes. -// -// variant scheme { -// HTTP, -// HTTPS, -// other(string), -// } -type Scheme cm.Variant[uint8, string, string] - -// SchemeHTTP returns a [Scheme] of case "HTTP". -func SchemeHTTP() Scheme { - var data struct{} - return cm.New[Scheme](0, data) -} - -// HTTP returns true if [Scheme] represents the variant case "HTTP". -func (self *Scheme) HTTP() bool { - return self.Tag() == 0 -} - -// SchemeHTTPS returns a [Scheme] of case "HTTPS". -func SchemeHTTPS() Scheme { - var data struct{} - return cm.New[Scheme](1, data) -} - -// HTTPS returns true if [Scheme] represents the variant case "HTTPS". -func (self *Scheme) HTTPS() bool { - return self.Tag() == 1 -} - -// SchemeOther returns a [Scheme] of case "other". -func SchemeOther(data string) Scheme { - return cm.New[Scheme](2, data) -} - -// Other returns a non-nil *[string] if [Scheme] represents the variant case "other". -func (self *Scheme) Other() *string { - return cm.Case[string](self, 2) -} - -var stringsScheme = [3]string{ - "HTTP", - "HTTPS", - "other", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v Scheme) String() string { - return stringsScheme[v.Tag()] -} - -// DNSErrorPayload represents the record "wasi:http/types@0.2.0#DNS-error-payload". -// -// Defines the case payload type for `DNS-error` above: -// -// record DNS-error-payload { -// rcode: option, -// info-code: option, -// } -type DNSErrorPayload struct { - _ cm.HostLayout - Rcode cm.Option[string] - InfoCode cm.Option[uint16] -} - -// TLSAlertReceivedPayload represents the record "wasi:http/types@0.2.0#TLS-alert-received-payload". -// -// Defines the case payload type for `TLS-alert-received` above: -// -// record TLS-alert-received-payload { -// alert-id: option, -// alert-message: option, -// } -type TLSAlertReceivedPayload struct { - _ cm.HostLayout - AlertID cm.Option[uint8] - AlertMessage cm.Option[string] -} - -// FieldSizePayload represents the record "wasi:http/types@0.2.0#field-size-payload". -// -// Defines the case payload type for `HTTP-response-{header,trailer}-size` above: -// -// record field-size-payload { -// field-name: option, -// field-size: option, -// } -type FieldSizePayload struct { - _ cm.HostLayout - FieldName cm.Option[string] - FieldSize cm.Option[uint32] -} - -// ErrorCode represents the variant "wasi:http/types@0.2.0#error-code". -// -// These cases are inspired by the IANA HTTP Proxy Error Types: -// https://www.iana.org/assignments/http-proxy-status/http-proxy-status.xhtml#table-http-proxy-error-types -// -// variant error-code { -// DNS-timeout, -// DNS-error(DNS-error-payload), -// destination-not-found, -// destination-unavailable, -// destination-IP-prohibited, -// destination-IP-unroutable, -// connection-refused, -// connection-terminated, -// connection-timeout, -// connection-read-timeout, -// connection-write-timeout, -// connection-limit-reached, -// TLS-protocol-error, -// TLS-certificate-error, -// TLS-alert-received(TLS-alert-received-payload), -// HTTP-request-denied, -// HTTP-request-length-required, -// HTTP-request-body-size(option), -// HTTP-request-method-invalid, -// HTTP-request-URI-invalid, -// HTTP-request-URI-too-long, -// HTTP-request-header-section-size(option), -// HTTP-request-header-size(option), -// HTTP-request-trailer-section-size(option), -// HTTP-request-trailer-size(field-size-payload), -// HTTP-response-incomplete, -// HTTP-response-header-section-size(option), -// HTTP-response-header-size(field-size-payload), -// HTTP-response-body-size(option), -// HTTP-response-trailer-section-size(option), -// HTTP-response-trailer-size(field-size-payload), -// HTTP-response-transfer-coding(option), -// HTTP-response-content-coding(option), -// HTTP-response-timeout, -// HTTP-upgrade-failed, -// HTTP-protocol-error, -// loop-detected, -// configuration-error, -// internal-error(option), -// } -type ErrorCode cm.Variant[uint8, OptionFieldSizePayloadShape, cm.Option[uint64]] - -// ErrorCodeDNSTimeout returns a [ErrorCode] of case "DNS-timeout". -func ErrorCodeDNSTimeout() ErrorCode { - var data struct{} - return cm.New[ErrorCode](0, data) -} - -// DNSTimeout returns true if [ErrorCode] represents the variant case "DNS-timeout". -func (self *ErrorCode) DNSTimeout() bool { - return self.Tag() == 0 -} - -// ErrorCodeDNSError returns a [ErrorCode] of case "DNS-error". -func ErrorCodeDNSError(data DNSErrorPayload) ErrorCode { - return cm.New[ErrorCode](1, data) -} - -// DNSError returns a non-nil *[DNSErrorPayload] if [ErrorCode] represents the variant case "DNS-error". -func (self *ErrorCode) DNSError() *DNSErrorPayload { - return cm.Case[DNSErrorPayload](self, 1) -} - -// ErrorCodeDestinationNotFound returns a [ErrorCode] of case "destination-not-found". -func ErrorCodeDestinationNotFound() ErrorCode { - var data struct{} - return cm.New[ErrorCode](2, data) -} - -// DestinationNotFound returns true if [ErrorCode] represents the variant case "destination-not-found". -func (self *ErrorCode) DestinationNotFound() bool { - return self.Tag() == 2 -} - -// ErrorCodeDestinationUnavailable returns a [ErrorCode] of case "destination-unavailable". -func ErrorCodeDestinationUnavailable() ErrorCode { - var data struct{} - return cm.New[ErrorCode](3, data) -} - -// DestinationUnavailable returns true if [ErrorCode] represents the variant case "destination-unavailable". -func (self *ErrorCode) DestinationUnavailable() bool { - return self.Tag() == 3 -} - -// ErrorCodeDestinationIPProhibited returns a [ErrorCode] of case "destination-IP-prohibited". -func ErrorCodeDestinationIPProhibited() ErrorCode { - var data struct{} - return cm.New[ErrorCode](4, data) -} - -// DestinationIPProhibited returns true if [ErrorCode] represents the variant case "destination-IP-prohibited". -func (self *ErrorCode) DestinationIPProhibited() bool { - return self.Tag() == 4 -} - -// ErrorCodeDestinationIPUnroutable returns a [ErrorCode] of case "destination-IP-unroutable". -func ErrorCodeDestinationIPUnroutable() ErrorCode { - var data struct{} - return cm.New[ErrorCode](5, data) -} - -// DestinationIPUnroutable returns true if [ErrorCode] represents the variant case "destination-IP-unroutable". -func (self *ErrorCode) DestinationIPUnroutable() bool { - return self.Tag() == 5 -} - -// ErrorCodeConnectionRefused returns a [ErrorCode] of case "connection-refused". -func ErrorCodeConnectionRefused() ErrorCode { - var data struct{} - return cm.New[ErrorCode](6, data) -} - -// ConnectionRefused returns true if [ErrorCode] represents the variant case "connection-refused". -func (self *ErrorCode) ConnectionRefused() bool { - return self.Tag() == 6 -} - -// ErrorCodeConnectionTerminated returns a [ErrorCode] of case "connection-terminated". -func ErrorCodeConnectionTerminated() ErrorCode { - var data struct{} - return cm.New[ErrorCode](7, data) -} - -// ConnectionTerminated returns true if [ErrorCode] represents the variant case "connection-terminated". -func (self *ErrorCode) ConnectionTerminated() bool { - return self.Tag() == 7 -} - -// ErrorCodeConnectionTimeout returns a [ErrorCode] of case "connection-timeout". -func ErrorCodeConnectionTimeout() ErrorCode { - var data struct{} - return cm.New[ErrorCode](8, data) -} - -// ConnectionTimeout returns true if [ErrorCode] represents the variant case "connection-timeout". -func (self *ErrorCode) ConnectionTimeout() bool { - return self.Tag() == 8 -} - -// ErrorCodeConnectionReadTimeout returns a [ErrorCode] of case "connection-read-timeout". -func ErrorCodeConnectionReadTimeout() ErrorCode { - var data struct{} - return cm.New[ErrorCode](9, data) -} - -// ConnectionReadTimeout returns true if [ErrorCode] represents the variant case "connection-read-timeout". -func (self *ErrorCode) ConnectionReadTimeout() bool { - return self.Tag() == 9 -} - -// ErrorCodeConnectionWriteTimeout returns a [ErrorCode] of case "connection-write-timeout". -func ErrorCodeConnectionWriteTimeout() ErrorCode { - var data struct{} - return cm.New[ErrorCode](10, data) -} - -// ConnectionWriteTimeout returns true if [ErrorCode] represents the variant case "connection-write-timeout". -func (self *ErrorCode) ConnectionWriteTimeout() bool { - return self.Tag() == 10 -} - -// ErrorCodeConnectionLimitReached returns a [ErrorCode] of case "connection-limit-reached". -func ErrorCodeConnectionLimitReached() ErrorCode { - var data struct{} - return cm.New[ErrorCode](11, data) -} - -// ConnectionLimitReached returns true if [ErrorCode] represents the variant case "connection-limit-reached". -func (self *ErrorCode) ConnectionLimitReached() bool { - return self.Tag() == 11 -} - -// ErrorCodeTLSProtocolError returns a [ErrorCode] of case "TLS-protocol-error". -func ErrorCodeTLSProtocolError() ErrorCode { - var data struct{} - return cm.New[ErrorCode](12, data) -} - -// TLSProtocolError returns true if [ErrorCode] represents the variant case "TLS-protocol-error". -func (self *ErrorCode) TLSProtocolError() bool { - return self.Tag() == 12 -} - -// ErrorCodeTLSCertificateError returns a [ErrorCode] of case "TLS-certificate-error". -func ErrorCodeTLSCertificateError() ErrorCode { - var data struct{} - return cm.New[ErrorCode](13, data) -} - -// TLSCertificateError returns true if [ErrorCode] represents the variant case "TLS-certificate-error". -func (self *ErrorCode) TLSCertificateError() bool { - return self.Tag() == 13 -} - -// ErrorCodeTLSAlertReceived returns a [ErrorCode] of case "TLS-alert-received". -func ErrorCodeTLSAlertReceived(data TLSAlertReceivedPayload) ErrorCode { - return cm.New[ErrorCode](14, data) -} - -// TLSAlertReceived returns a non-nil *[TLSAlertReceivedPayload] if [ErrorCode] represents the variant case "TLS-alert-received". -func (self *ErrorCode) TLSAlertReceived() *TLSAlertReceivedPayload { - return cm.Case[TLSAlertReceivedPayload](self, 14) -} - -// ErrorCodeHTTPRequestDenied returns a [ErrorCode] of case "HTTP-request-denied". -func ErrorCodeHTTPRequestDenied() ErrorCode { - var data struct{} - return cm.New[ErrorCode](15, data) -} - -// HTTPRequestDenied returns true if [ErrorCode] represents the variant case "HTTP-request-denied". -func (self *ErrorCode) HTTPRequestDenied() bool { - return self.Tag() == 15 -} - -// ErrorCodeHTTPRequestLengthRequired returns a [ErrorCode] of case "HTTP-request-length-required". -func ErrorCodeHTTPRequestLengthRequired() ErrorCode { - var data struct{} - return cm.New[ErrorCode](16, data) -} - -// HTTPRequestLengthRequired returns true if [ErrorCode] represents the variant case "HTTP-request-length-required". -func (self *ErrorCode) HTTPRequestLengthRequired() bool { - return self.Tag() == 16 -} - -// ErrorCodeHTTPRequestBodySize returns a [ErrorCode] of case "HTTP-request-body-size". -func ErrorCodeHTTPRequestBodySize(data cm.Option[uint64]) ErrorCode { - return cm.New[ErrorCode](17, data) -} - -// HTTPRequestBodySize returns a non-nil *[cm.Option[uint64]] if [ErrorCode] represents the variant case "HTTP-request-body-size". -func (self *ErrorCode) HTTPRequestBodySize() *cm.Option[uint64] { - return cm.Case[cm.Option[uint64]](self, 17) -} - -// ErrorCodeHTTPRequestMethodInvalid returns a [ErrorCode] of case "HTTP-request-method-invalid". -func ErrorCodeHTTPRequestMethodInvalid() ErrorCode { - var data struct{} - return cm.New[ErrorCode](18, data) -} - -// HTTPRequestMethodInvalid returns true if [ErrorCode] represents the variant case "HTTP-request-method-invalid". -func (self *ErrorCode) HTTPRequestMethodInvalid() bool { - return self.Tag() == 18 -} - -// ErrorCodeHTTPRequestURIInvalid returns a [ErrorCode] of case "HTTP-request-URI-invalid". -func ErrorCodeHTTPRequestURIInvalid() ErrorCode { - var data struct{} - return cm.New[ErrorCode](19, data) -} - -// HTTPRequestURIInvalid returns true if [ErrorCode] represents the variant case "HTTP-request-URI-invalid". -func (self *ErrorCode) HTTPRequestURIInvalid() bool { - return self.Tag() == 19 -} - -// ErrorCodeHTTPRequestURITooLong returns a [ErrorCode] of case "HTTP-request-URI-too-long". -func ErrorCodeHTTPRequestURITooLong() ErrorCode { - var data struct{} - return cm.New[ErrorCode](20, data) -} - -// HTTPRequestURITooLong returns true if [ErrorCode] represents the variant case "HTTP-request-URI-too-long". -func (self *ErrorCode) HTTPRequestURITooLong() bool { - return self.Tag() == 20 -} - -// ErrorCodeHTTPRequestHeaderSectionSize returns a [ErrorCode] of case "HTTP-request-header-section-size". -func ErrorCodeHTTPRequestHeaderSectionSize(data cm.Option[uint32]) ErrorCode { - return cm.New[ErrorCode](21, data) -} - -// HTTPRequestHeaderSectionSize returns a non-nil *[cm.Option[uint32]] if [ErrorCode] represents the variant case "HTTP-request-header-section-size". -func (self *ErrorCode) HTTPRequestHeaderSectionSize() *cm.Option[uint32] { - return cm.Case[cm.Option[uint32]](self, 21) -} - -// ErrorCodeHTTPRequestHeaderSize returns a [ErrorCode] of case "HTTP-request-header-size". -func ErrorCodeHTTPRequestHeaderSize(data cm.Option[FieldSizePayload]) ErrorCode { - return cm.New[ErrorCode](22, data) -} - -// HTTPRequestHeaderSize returns a non-nil *[cm.Option[FieldSizePayload]] if [ErrorCode] represents the variant case "HTTP-request-header-size". -func (self *ErrorCode) HTTPRequestHeaderSize() *cm.Option[FieldSizePayload] { - return cm.Case[cm.Option[FieldSizePayload]](self, 22) -} - -// ErrorCodeHTTPRequestTrailerSectionSize returns a [ErrorCode] of case "HTTP-request-trailer-section-size". -func ErrorCodeHTTPRequestTrailerSectionSize(data cm.Option[uint32]) ErrorCode { - return cm.New[ErrorCode](23, data) -} - -// HTTPRequestTrailerSectionSize returns a non-nil *[cm.Option[uint32]] if [ErrorCode] represents the variant case "HTTP-request-trailer-section-size". -func (self *ErrorCode) HTTPRequestTrailerSectionSize() *cm.Option[uint32] { - return cm.Case[cm.Option[uint32]](self, 23) -} - -// ErrorCodeHTTPRequestTrailerSize returns a [ErrorCode] of case "HTTP-request-trailer-size". -func ErrorCodeHTTPRequestTrailerSize(data FieldSizePayload) ErrorCode { - return cm.New[ErrorCode](24, data) -} - -// HTTPRequestTrailerSize returns a non-nil *[FieldSizePayload] if [ErrorCode] represents the variant case "HTTP-request-trailer-size". -func (self *ErrorCode) HTTPRequestTrailerSize() *FieldSizePayload { - return cm.Case[FieldSizePayload](self, 24) -} - -// ErrorCodeHTTPResponseIncomplete returns a [ErrorCode] of case "HTTP-response-incomplete". -func ErrorCodeHTTPResponseIncomplete() ErrorCode { - var data struct{} - return cm.New[ErrorCode](25, data) -} - -// HTTPResponseIncomplete returns true if [ErrorCode] represents the variant case "HTTP-response-incomplete". -func (self *ErrorCode) HTTPResponseIncomplete() bool { - return self.Tag() == 25 -} - -// ErrorCodeHTTPResponseHeaderSectionSize returns a [ErrorCode] of case "HTTP-response-header-section-size". -func ErrorCodeHTTPResponseHeaderSectionSize(data cm.Option[uint32]) ErrorCode { - return cm.New[ErrorCode](26, data) -} - -// HTTPResponseHeaderSectionSize returns a non-nil *[cm.Option[uint32]] if [ErrorCode] represents the variant case "HTTP-response-header-section-size". -func (self *ErrorCode) HTTPResponseHeaderSectionSize() *cm.Option[uint32] { - return cm.Case[cm.Option[uint32]](self, 26) -} - -// ErrorCodeHTTPResponseHeaderSize returns a [ErrorCode] of case "HTTP-response-header-size". -func ErrorCodeHTTPResponseHeaderSize(data FieldSizePayload) ErrorCode { - return cm.New[ErrorCode](27, data) -} - -// HTTPResponseHeaderSize returns a non-nil *[FieldSizePayload] if [ErrorCode] represents the variant case "HTTP-response-header-size". -func (self *ErrorCode) HTTPResponseHeaderSize() *FieldSizePayload { - return cm.Case[FieldSizePayload](self, 27) -} - -// ErrorCodeHTTPResponseBodySize returns a [ErrorCode] of case "HTTP-response-body-size". -func ErrorCodeHTTPResponseBodySize(data cm.Option[uint64]) ErrorCode { - return cm.New[ErrorCode](28, data) -} - -// HTTPResponseBodySize returns a non-nil *[cm.Option[uint64]] if [ErrorCode] represents the variant case "HTTP-response-body-size". -func (self *ErrorCode) HTTPResponseBodySize() *cm.Option[uint64] { - return cm.Case[cm.Option[uint64]](self, 28) -} - -// ErrorCodeHTTPResponseTrailerSectionSize returns a [ErrorCode] of case "HTTP-response-trailer-section-size". -func ErrorCodeHTTPResponseTrailerSectionSize(data cm.Option[uint32]) ErrorCode { - return cm.New[ErrorCode](29, data) -} - -// HTTPResponseTrailerSectionSize returns a non-nil *[cm.Option[uint32]] if [ErrorCode] represents the variant case "HTTP-response-trailer-section-size". -func (self *ErrorCode) HTTPResponseTrailerSectionSize() *cm.Option[uint32] { - return cm.Case[cm.Option[uint32]](self, 29) -} - -// ErrorCodeHTTPResponseTrailerSize returns a [ErrorCode] of case "HTTP-response-trailer-size". -func ErrorCodeHTTPResponseTrailerSize(data FieldSizePayload) ErrorCode { - return cm.New[ErrorCode](30, data) -} - -// HTTPResponseTrailerSize returns a non-nil *[FieldSizePayload] if [ErrorCode] represents the variant case "HTTP-response-trailer-size". -func (self *ErrorCode) HTTPResponseTrailerSize() *FieldSizePayload { - return cm.Case[FieldSizePayload](self, 30) -} - -// ErrorCodeHTTPResponseTransferCoding returns a [ErrorCode] of case "HTTP-response-transfer-coding". -func ErrorCodeHTTPResponseTransferCoding(data cm.Option[string]) ErrorCode { - return cm.New[ErrorCode](31, data) -} - -// HTTPResponseTransferCoding returns a non-nil *[cm.Option[string]] if [ErrorCode] represents the variant case "HTTP-response-transfer-coding". -func (self *ErrorCode) HTTPResponseTransferCoding() *cm.Option[string] { - return cm.Case[cm.Option[string]](self, 31) -} - -// ErrorCodeHTTPResponseContentCoding returns a [ErrorCode] of case "HTTP-response-content-coding". -func ErrorCodeHTTPResponseContentCoding(data cm.Option[string]) ErrorCode { - return cm.New[ErrorCode](32, data) -} - -// HTTPResponseContentCoding returns a non-nil *[cm.Option[string]] if [ErrorCode] represents the variant case "HTTP-response-content-coding". -func (self *ErrorCode) HTTPResponseContentCoding() *cm.Option[string] { - return cm.Case[cm.Option[string]](self, 32) -} - -// ErrorCodeHTTPResponseTimeout returns a [ErrorCode] of case "HTTP-response-timeout". -func ErrorCodeHTTPResponseTimeout() ErrorCode { - var data struct{} - return cm.New[ErrorCode](33, data) -} - -// HTTPResponseTimeout returns true if [ErrorCode] represents the variant case "HTTP-response-timeout". -func (self *ErrorCode) HTTPResponseTimeout() bool { - return self.Tag() == 33 -} - -// ErrorCodeHTTPUpgradeFailed returns a [ErrorCode] of case "HTTP-upgrade-failed". -func ErrorCodeHTTPUpgradeFailed() ErrorCode { - var data struct{} - return cm.New[ErrorCode](34, data) -} - -// HTTPUpgradeFailed returns true if [ErrorCode] represents the variant case "HTTP-upgrade-failed". -func (self *ErrorCode) HTTPUpgradeFailed() bool { - return self.Tag() == 34 -} - -// ErrorCodeHTTPProtocolError returns a [ErrorCode] of case "HTTP-protocol-error". -func ErrorCodeHTTPProtocolError() ErrorCode { - var data struct{} - return cm.New[ErrorCode](35, data) -} - -// HTTPProtocolError returns true if [ErrorCode] represents the variant case "HTTP-protocol-error". -func (self *ErrorCode) HTTPProtocolError() bool { - return self.Tag() == 35 -} - -// ErrorCodeLoopDetected returns a [ErrorCode] of case "loop-detected". -func ErrorCodeLoopDetected() ErrorCode { - var data struct{} - return cm.New[ErrorCode](36, data) -} - -// LoopDetected returns true if [ErrorCode] represents the variant case "loop-detected". -func (self *ErrorCode) LoopDetected() bool { - return self.Tag() == 36 -} - -// ErrorCodeConfigurationError returns a [ErrorCode] of case "configuration-error". -func ErrorCodeConfigurationError() ErrorCode { - var data struct{} - return cm.New[ErrorCode](37, data) -} - -// ConfigurationError returns true if [ErrorCode] represents the variant case "configuration-error". -func (self *ErrorCode) ConfigurationError() bool { - return self.Tag() == 37 -} - -// ErrorCodeInternalError returns a [ErrorCode] of case "internal-error". -// -// This is a catch-all error for anything that doesn't fit cleanly into a -// more specific case. It also includes an optional string for an -// unstructured description of the error. Users should not depend on the -// string for diagnosing errors, as it's not required to be consistent -// between implementations. -func ErrorCodeInternalError(data cm.Option[string]) ErrorCode { - return cm.New[ErrorCode](38, data) -} - -// InternalError returns a non-nil *[cm.Option[string]] if [ErrorCode] represents the variant case "internal-error". -func (self *ErrorCode) InternalError() *cm.Option[string] { - return cm.Case[cm.Option[string]](self, 38) -} - -var stringsErrorCode = [39]string{ - "DNS-timeout", - "DNS-error", - "destination-not-found", - "destination-unavailable", - "destination-IP-prohibited", - "destination-IP-unroutable", - "connection-refused", - "connection-terminated", - "connection-timeout", - "connection-read-timeout", - "connection-write-timeout", - "connection-limit-reached", - "TLS-protocol-error", - "TLS-certificate-error", - "TLS-alert-received", - "HTTP-request-denied", - "HTTP-request-length-required", - "HTTP-request-body-size", - "HTTP-request-method-invalid", - "HTTP-request-URI-invalid", - "HTTP-request-URI-too-long", - "HTTP-request-header-section-size", - "HTTP-request-header-size", - "HTTP-request-trailer-section-size", - "HTTP-request-trailer-size", - "HTTP-response-incomplete", - "HTTP-response-header-section-size", - "HTTP-response-header-size", - "HTTP-response-body-size", - "HTTP-response-trailer-section-size", - "HTTP-response-trailer-size", - "HTTP-response-transfer-coding", - "HTTP-response-content-coding", - "HTTP-response-timeout", - "HTTP-upgrade-failed", - "HTTP-protocol-error", - "loop-detected", - "configuration-error", - "internal-error", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v ErrorCode) String() string { - return stringsErrorCode[v.Tag()] -} - -// HeaderError represents the variant "wasi:http/types@0.2.0#header-error". -// -// This type enumerates the different kinds of errors that may occur when -// setting or appending to a `fields` resource. -// -// variant header-error { -// invalid-syntax, -// forbidden, -// immutable, -// } -type HeaderError uint8 - -const ( - // This error indicates that a `field-key` or `field-value` was - // syntactically invalid when used with an operation that sets headers in a - // `fields`. - HeaderErrorInvalidSyntax HeaderError = iota - - // This error indicates that a forbidden `field-key` was used when trying - // to set a header in a `fields`. - HeaderErrorForbidden - - // This error indicates that the operation on the `fields` was not - // permitted because the fields are immutable. - HeaderErrorImmutable -) - -var stringsHeaderError = [3]string{ - "invalid-syntax", - "forbidden", - "immutable", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e HeaderError) String() string { - return stringsHeaderError[e] -} - -// FieldKey represents the string "wasi:http/types@0.2.0#field-key". -// -// Field keys are always strings. -// -// type field-key = string -type FieldKey string - -// FieldValue represents the list "wasi:http/types@0.2.0#field-value". -// -// Field values should always be ASCII strings. However, in -// reality, HTTP implementations often have to interpret malformed values, -// so they are provided as a list of bytes. -// -// type field-value = list -type FieldValue cm.List[uint8] - -// Fields represents the imported resource "wasi:http/types@0.2.0#fields". -// -// This following block defines the `fields` resource which corresponds to -// HTTP standard Fields. Fields are a common representation used for both -// Headers and Trailers. -// -// A `fields` may be mutable or immutable. A `fields` created using the -// constructor, `from-list`, or `clone` will be mutable, but a `fields` -// resource given by other means (including, but not limited to, -// `incoming-request.headers`, `outgoing-request.headers`) might be be -// immutable. In an immutable fields, the `set`, `append`, and `delete` -// operations will fail with `header-error.immutable`. -// -// resource fields -type Fields cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "fields". -// -// Drops a resource handle. -// -//go:nosplit -func (self Fields) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FieldsResourceDrop((uint32)(self0)) - return -} - -// NewFields represents the imported constructor for resource "fields". -// -// Construct an empty HTTP Fields. -// -// The resulting `fields` is mutable. -// -// constructor() -// -//go:nosplit -func NewFields() { - wasmimport_NewFields() - return -} - -// FieldsFromList represents the imported static function "from-list". -// -// Construct an HTTP Fields. -// -// The resulting `fields` is mutable. -// -// The list represents each key-value pair in the Fields. Keys -// which have multiple values are represented by multiple entries in this -// list with the same key. -// -// The tuple is a pair of the field key, represented as a string, and -// Value, represented as a list of bytes. In a valid Fields, all keys -// and values are valid UTF-8 strings. However, values are not always -// well-formed, so they are represented as a raw list of bytes. -// -// An error result will be returned if any header or value was -// syntactically invalid, or if a header was forbidden. -// -// from-list: static func(entries: list>) -// -//go:nosplit -func FieldsFromList(entries cm.List[cm.Tuple[FieldKey, FieldValue]]) { - entries0, entries1 := cm.LowerList(entries) - wasmimport_FieldsFromList((*cm.Tuple[FieldKey, FieldValue])(entries0), (uint32)(entries1)) - return -} - -// Append represents the imported method "append". -// -// Append a value for a key. Does not change or delete any existing -// values for that key. -// -// Fails with `header-error.immutable` if the `fields` are immutable. -// -// append: func(name: field-key, value: field-value) -// -//go:nosplit -func (self Fields) Append(name FieldKey, value FieldValue) { - self0 := cm.Reinterpret[uint32](self) - name0, name1 := cm.LowerString(name) - value0, value1 := cm.LowerList(value) - wasmimport_FieldsAppend((uint32)(self0), (*uint8)(name0), (uint32)(name1), (*uint8)(value0), (uint32)(value1)) - return -} - -// Clone represents the imported method "clone". -// -// Make a deep copy of the Fields. Equivelant in behavior to calling the -// `fields` constructor on the return value of `entries`. The resulting -// `fields` is mutable. -// -// clone: func() -// -//go:nosplit -func (self Fields) Clone() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FieldsClone((uint32)(self0)) - return -} - -// Delete represents the imported method "delete". -// -// Delete all values for a key. Does nothing if no values for the key -// exist. -// -// Fails with `header-error.immutable` if the `fields` are immutable. -// -// delete: func(name: field-key) -// -//go:nosplit -func (self Fields) Delete(name FieldKey) { - self0 := cm.Reinterpret[uint32](self) - name0, name1 := cm.LowerString(name) - wasmimport_FieldsDelete((uint32)(self0), (*uint8)(name0), (uint32)(name1)) - return -} - -// Entries represents the imported method "entries". -// -// Retrieve the full set of keys and values in the Fields. Like the -// constructor, the list represents each key-value pair. -// -// The outer list represents each key-value pair in the Fields. Keys -// which have multiple values are represented by multiple entries in this -// list with the same key. -// -// entries: func() -// -//go:nosplit -func (self Fields) Entries() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FieldsEntries((uint32)(self0)) - return -} - -// Get represents the imported method "get". -// -// Get all of the values corresponding to a key. If the key is not present -// in this `fields`, an empty list is returned. However, if the key is -// present but empty, this is represented by a list with one or more -// empty field-values present. -// -// get: func(name: field-key) -// -//go:nosplit -func (self Fields) Get(name FieldKey) { - self0 := cm.Reinterpret[uint32](self) - name0, name1 := cm.LowerString(name) - wasmimport_FieldsGet((uint32)(self0), (*uint8)(name0), (uint32)(name1)) - return -} - -// Has represents the imported method "has". -// -// Returns `true` when the key is present in this `fields`. If the key is -// syntactically invalid, `false` is returned. -// -// has: func(name: field-key) -// -//go:nosplit -func (self Fields) Has(name FieldKey) { - self0 := cm.Reinterpret[uint32](self) - name0, name1 := cm.LowerString(name) - wasmimport_FieldsHas((uint32)(self0), (*uint8)(name0), (uint32)(name1)) - return -} - -// Set represents the imported method "set". -// -// Set all of the values for a key. Clears any existing values for that -// key, if they have been set. -// -// Fails with `header-error.immutable` if the `fields` are immutable. -// -// set: func(name: field-key, value: list) -// -//go:nosplit -func (self Fields) Set(name FieldKey, value cm.List[FieldValue]) { - self0 := cm.Reinterpret[uint32](self) - name0, name1 := cm.LowerString(name) - value0, value1 := cm.LowerList(value) - wasmimport_FieldsSet((uint32)(self0), (*uint8)(name0), (uint32)(name1), (*FieldValue)(value0), (uint32)(value1)) - return -} - -// Headers represents the imported type alias "wasi:http/types@0.2.0#headers". -// -// See [Fields] for more information. -type Headers = Fields - -// Trailers represents the imported type alias "wasi:http/types@0.2.0#trailers". -// -// See [Fields] for more information. -type Trailers = Fields - -// IncomingRequest represents the imported resource "wasi:http/types@0.2.0#incoming-request". -// -// Represents an incoming HTTP Request. -// -// resource incoming-request -type IncomingRequest cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "incoming-request". -// -// Drops a resource handle. -// -//go:nosplit -func (self IncomingRequest) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestResourceDrop((uint32)(self0)) - return -} - -// Authority represents the imported method "authority". -// -// Returns the authority from the request, if it was present. -// -// authority: func() -// -//go:nosplit -func (self IncomingRequest) Authority() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestAuthority((uint32)(self0)) - return -} - -// Consume represents the imported method "consume". -// -// Gives the `incoming-body` associated with this request. Will only -// return success at most once, and subsequent calls will return error. -// -// consume: func() -// -//go:nosplit -func (self IncomingRequest) Consume() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestConsume((uint32)(self0)) - return -} - -// Headers represents the imported method "headers". -// -// Get the `headers` associated with the request. -// -// The returned `headers` resource is immutable: `set`, `append`, and -// `delete` operations will fail with `header-error.immutable`. -// -// The `headers` returned are a child resource: it must be dropped before -// the parent `incoming-request` is dropped. Dropping this -// `incoming-request` before all children are dropped will trap. -// -// headers: func() -// -//go:nosplit -func (self IncomingRequest) Headers() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestHeaders((uint32)(self0)) - return -} - -// Method represents the imported method "method". -// -// Returns the method of the incoming request. -// -// method: func() -// -//go:nosplit -func (self IncomingRequest) Method() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestMethod((uint32)(self0)) - return -} - -// PathWithQuery represents the imported method "path-with-query". -// -// Returns the path with query parameters from the request, as a string. -// -// path-with-query: func() -// -//go:nosplit -func (self IncomingRequest) PathWithQuery() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestPathWithQuery((uint32)(self0)) - return -} - -// Scheme represents the imported method "scheme". -// -// Returns the protocol scheme from the request. -// -// scheme: func() -// -//go:nosplit -func (self IncomingRequest) Scheme() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestScheme((uint32)(self0)) - return -} - -// OutgoingRequest represents the imported resource "wasi:http/types@0.2.0#outgoing-request". -// -// Represents an outgoing HTTP Request. -// -// resource outgoing-request -type OutgoingRequest cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "outgoing-request". -// -// Drops a resource handle. -// -//go:nosplit -func (self OutgoingRequest) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestResourceDrop((uint32)(self0)) - return -} - -// NewOutgoingRequest represents the imported constructor for resource "outgoing-request". -// -// Construct a new `outgoing-request` with a default `method` of `GET`, and -// `none` values for `path-with-query`, `scheme`, and `authority`. -// -// * `headers` is the HTTP Headers for the Request. -// -// It is possible to construct, or manipulate with the accessor functions -// below, an `outgoing-request` with an invalid combination of `scheme` -// and `authority`, or `headers` which are not permitted to be sent. -// It is the obligation of the `outgoing-handler.handle` implementation -// to reject invalid constructions of `outgoing-request`. -// -// constructor(headers: headers) -// -//go:nosplit -func NewOutgoingRequest(headers Headers) { - headers0 := cm.Reinterpret[uint32](headers) - wasmimport_NewOutgoingRequest((uint32)(headers0)) - return -} - -// Authority represents the imported method "authority". -// -// Get the HTTP Authority for the Request. A value of `none` may be used -// with Related Schemes which do not require an Authority. The HTTP and -// HTTPS schemes always require an authority. -// -// authority: func() -// -//go:nosplit -func (self OutgoingRequest) Authority() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestAuthority((uint32)(self0)) - return -} - -// Body represents the imported method "body". -// -// Returns the resource corresponding to the outgoing Body for this -// Request. -// -// Returns success on the first call: the `outgoing-body` resource for -// this `outgoing-request` can be retrieved at most once. Subsequent -// calls will return error. -// -// body: func() -// -//go:nosplit -func (self OutgoingRequest) Body() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestBody((uint32)(self0)) - return -} - -// Headers represents the imported method "headers". -// -// Get the headers associated with the Request. -// -// The returned `headers` resource is immutable: `set`, `append`, and -// `delete` operations will fail with `header-error.immutable`. -// -// This headers resource is a child: it must be dropped before the parent -// `outgoing-request` is dropped, or its ownership is transfered to -// another component by e.g. `outgoing-handler.handle`. -// -// headers: func() -// -//go:nosplit -func (self OutgoingRequest) Headers() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestHeaders((uint32)(self0)) - return -} - -// Method represents the imported method "method". -// -// Get the Method for the Request. -// -// method: func() -// -//go:nosplit -func (self OutgoingRequest) Method() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestMethod((uint32)(self0)) - return -} - -// PathWithQuery represents the imported method "path-with-query". -// -// Get the combination of the HTTP Path and Query for the Request. -// When `none`, this represents an empty Path and empty Query. -// -// path-with-query: func() -// -//go:nosplit -func (self OutgoingRequest) PathWithQuery() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestPathWithQuery((uint32)(self0)) - return -} - -// Scheme represents the imported method "scheme". -// -// Get the HTTP Related Scheme for the Request. When `none`, the -// implementation may choose an appropriate default scheme. -// -// scheme: func() -// -//go:nosplit -func (self OutgoingRequest) Scheme() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestScheme((uint32)(self0)) - return -} - -// SetAuthority represents the imported method "set-authority". -// -// Set the HTTP Authority for the Request. A value of `none` may be used -// with Related Schemes which do not require an Authority. The HTTP and -// HTTPS schemes always require an authority. Fails if the string given is -// not a syntactically valid uri authority. -// -// set-authority: func(authority: option) -// -//go:nosplit -func (self OutgoingRequest) SetAuthority(authority cm.Option[string]) { - self0 := cm.Reinterpret[uint32](self) - authority0, authority1, authority2 := lower_OptionString(authority) - wasmimport_OutgoingRequestSetAuthority((uint32)(self0), (uint32)(authority0), (*uint8)(authority1), (uint32)(authority2)) - return -} - -// SetMethod represents the imported method "set-method". -// -// Set the Method for the Request. Fails if the string present in a -// `method.other` argument is not a syntactically valid method. -// -// set-method: func(method: method) -// -//go:nosplit -func (self OutgoingRequest) SetMethod(method Method) { - self0 := cm.Reinterpret[uint32](self) - method0, method1, method2 := lower_Method(method) - wasmimport_OutgoingRequestSetMethod((uint32)(self0), (uint32)(method0), (*uint8)(method1), (uint32)(method2)) - return -} - -// SetPathWithQuery represents the imported method "set-path-with-query". -// -// Set the combination of the HTTP Path and Query for the Request. -// When `none`, this represents an empty Path and empty Query. Fails is the -// string given is not a syntactically valid path and query uri component. -// -// set-path-with-query: func(path-with-query: option) -// -//go:nosplit -func (self OutgoingRequest) SetPathWithQuery(pathWithQuery cm.Option[string]) { - self0 := cm.Reinterpret[uint32](self) - pathWithQuery0, pathWithQuery1, pathWithQuery2 := lower_OptionString(pathWithQuery) - wasmimport_OutgoingRequestSetPathWithQuery((uint32)(self0), (uint32)(pathWithQuery0), (*uint8)(pathWithQuery1), (uint32)(pathWithQuery2)) - return -} - -// SetScheme represents the imported method "set-scheme". -// -// Set the HTTP Related Scheme for the Request. When `none`, the -// implementation may choose an appropriate default scheme. Fails if the -// string given is not a syntactically valid uri scheme. -// -// set-scheme: func(scheme: option) -// -//go:nosplit -func (self OutgoingRequest) SetScheme(scheme cm.Option[Scheme]) { - self0 := cm.Reinterpret[uint32](self) - scheme0, scheme1, scheme2, scheme3 := lower_OptionScheme(scheme) - wasmimport_OutgoingRequestSetScheme((uint32)(self0), (uint32)(scheme0), (uint32)(scheme1), (*uint8)(scheme2), (uint32)(scheme3)) - return -} - -// RequestOptions represents the imported resource "wasi:http/types@0.2.0#request-options". -// -// Parameters for making an HTTP Request. Each of these parameters is -// currently an optional timeout applicable to the transport layer of the -// HTTP protocol. -// -// These timeouts are separate from any the user may use to bound a -// blocking call to `wasi:io/poll.poll`. -// -// resource request-options -type RequestOptions cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "request-options". -// -// Drops a resource handle. -// -//go:nosplit -func (self RequestOptions) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsResourceDrop((uint32)(self0)) - return -} - -// NewRequestOptions represents the imported constructor for resource "request-options". -// -// Construct a default `request-options` value. -// -// constructor() -// -//go:nosplit -func NewRequestOptions() { - wasmimport_NewRequestOptions() - return -} - -// BetweenBytesTimeout represents the imported method "between-bytes-timeout". -// -// The timeout for receiving subsequent chunks of bytes in the Response -// body stream. -// -// between-bytes-timeout: func() -// -//go:nosplit -func (self RequestOptions) BetweenBytesTimeout() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsBetweenBytesTimeout((uint32)(self0)) - return -} - -// ConnectTimeout represents the imported method "connect-timeout". -// -// The timeout for the initial connect to the HTTP Server. -// -// connect-timeout: func() -// -//go:nosplit -func (self RequestOptions) ConnectTimeout() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsConnectTimeout((uint32)(self0)) - return -} - -// FirstByteTimeout represents the imported method "first-byte-timeout". -// -// The timeout for receiving the first byte of the Response body. -// -// first-byte-timeout: func() -// -//go:nosplit -func (self RequestOptions) FirstByteTimeout() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsFirstByteTimeout((uint32)(self0)) - return -} - -// SetBetweenBytesTimeout represents the imported method "set-between-bytes-timeout". -// -// Set the timeout for receiving subsequent chunks of bytes in the Response -// body stream. An error return value indicates that this timeout is not -// supported. -// -// set-between-bytes-timeout: func(duration: option) -// -//go:nosplit -func (self RequestOptions) SetBetweenBytesTimeout(duration cm.Option[Duration]) { - self0 := cm.Reinterpret[uint32](self) - duration0, duration1 := lower_OptionDuration(duration) - wasmimport_RequestOptionsSetBetweenBytesTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) - return -} - -// SetConnectTimeout represents the imported method "set-connect-timeout". -// -// Set the timeout for the initial connect to the HTTP Server. An error -// return value indicates that this timeout is not supported. -// -// set-connect-timeout: func(duration: option) -// -//go:nosplit -func (self RequestOptions) SetConnectTimeout(duration cm.Option[Duration]) { - self0 := cm.Reinterpret[uint32](self) - duration0, duration1 := lower_OptionDuration(duration) - wasmimport_RequestOptionsSetConnectTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) - return -} - -// SetFirstByteTimeout represents the imported method "set-first-byte-timeout". -// -// Set the timeout for receiving the first byte of the Response body. An -// error return value indicates that this timeout is not supported. -// -// set-first-byte-timeout: func(duration: option) -// -//go:nosplit -func (self RequestOptions) SetFirstByteTimeout(duration cm.Option[Duration]) { - self0 := cm.Reinterpret[uint32](self) - duration0, duration1 := lower_OptionDuration(duration) - wasmimport_RequestOptionsSetFirstByteTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) - return -} - -// ResponseOutparam represents the imported resource "wasi:http/types@0.2.0#response-outparam". -// -// Represents the ability to send an HTTP Response. -// -// This resource is used by the `wasi:http/incoming-handler` interface to -// allow a Response to be sent corresponding to the Request provided as the -// other argument to `incoming-handler.handle`. -// -// resource response-outparam -type ResponseOutparam cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "response-outparam". -// -// Drops a resource handle. -// -//go:nosplit -func (self ResponseOutparam) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_ResponseOutparamResourceDrop((uint32)(self0)) - return -} - -// ResponseOutparamSet represents the imported static function "set". -// -// Set the value of the `response-outparam` to either send a response, -// or indicate an error. -// -// This method consumes the `response-outparam` to ensure that it is -// called at most once. If it is never called, the implementation -// will respond with an error. -// -// The user may provide an `error` to `response` to allow the -// implementation determine how to respond with an HTTP error response. -// -// set: static func(param: response-outparam, response: result) -// -//go:nosplit -func ResponseOutparamSet(param ResponseOutparam, response cm.Result[ErrorCodeShape, OutgoingResponse, ErrorCode]) { - param0 := cm.Reinterpret[uint32](param) - response0, response1, response2, response3, response4, response5, response6, response7 := lower_ResultOutgoingResponseErrorCode(response) - wasmimport_ResponseOutparamSet((uint32)(param0), (uint32)(response0), (uint32)(response1), (uint32)(response2), (uint64)(response3), (uint32)(response4), (uint32)(response5), (uint32)(response6), (uint32)(response7)) - return -} - -// StatusCode represents the u16 "wasi:http/types@0.2.0#status-code". -// -// This type corresponds to the HTTP standard Status Code. -// -// type status-code = u16 -type StatusCode uint16 - -// IncomingResponse represents the imported resource "wasi:http/types@0.2.0#incoming-response". -// -// Represents an incoming HTTP Response. -// -// resource incoming-response -type IncomingResponse cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "incoming-response". -// -// Drops a resource handle. -// -//go:nosplit -func (self IncomingResponse) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingResponseResourceDrop((uint32)(self0)) - return -} - -// Consume represents the imported method "consume". -// -// Returns the incoming body. May be called at most once. Returns error -// if called additional times. -// -// consume: func() -// -//go:nosplit -func (self IncomingResponse) Consume() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingResponseConsume((uint32)(self0)) - return -} - -// Headers represents the imported method "headers". -// -// Returns the headers from the incoming response. -// -// The returned `headers` resource is immutable: `set`, `append`, and -// `delete` operations will fail with `header-error.immutable`. -// -// This headers resource is a child: it must be dropped before the parent -// `incoming-response` is dropped. -// -// headers: func() -// -//go:nosplit -func (self IncomingResponse) Headers() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingResponseHeaders((uint32)(self0)) - return -} - -// Status represents the imported method "status". -// -// Returns the status code from the incoming response. -// -// status: func() -// -//go:nosplit -func (self IncomingResponse) Status() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingResponseStatus((uint32)(self0)) - return -} - -// IncomingBody represents the imported resource "wasi:http/types@0.2.0#incoming-body". -// -// Represents an incoming HTTP Request or Response's Body. -// -// A body has both its contents - a stream of bytes - and a (possibly -// empty) set of trailers, indicating that the full contents of the -// body have been received. This resource represents the contents as -// an `input-stream` and the delivery of trailers as a `future-trailers`, -// and ensures that the user of this interface may only be consuming either -// the body contents or waiting on trailers at any given time. -// -// resource incoming-body -type IncomingBody cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "incoming-body". -// -// Drops a resource handle. -// -//go:nosplit -func (self IncomingBody) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingBodyResourceDrop((uint32)(self0)) - return -} - -// IncomingBodyFinish represents the imported static function "finish". -// -// Takes ownership of `incoming-body`, and returns a `future-trailers`. -// This function will trap if the `input-stream` child is still alive. -// -// finish: static func(this: incoming-body) -// -//go:nosplit -func IncomingBodyFinish(this IncomingBody) { - this0 := cm.Reinterpret[uint32](this) - wasmimport_IncomingBodyFinish((uint32)(this0)) - return -} - -// Stream represents the imported method "stream". -// -// Returns the contents of the body, as a stream of bytes. -// -// Returns success on first call: the stream representing the contents -// can be retrieved at most once. Subsequent calls will return error. -// -// The returned `input-stream` resource is a child: it must be dropped -// before the parent `incoming-body` is dropped, or consumed by -// `incoming-body.finish`. -// -// This invariant ensures that the implementation can determine whether -// the user is consuming the contents of the body, waiting on the -// `future-trailers` to be ready, or neither. This allows for network -// backpressure is to be applied when the user is consuming the body, -// and for that backpressure to not inhibit delivery of the trailers if -// the user does not read the entire body. -// -// %stream: func() -// -//go:nosplit -func (self IncomingBody) Stream() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingBodyStream((uint32)(self0)) - return -} - -// FutureTrailers represents the imported resource "wasi:http/types@0.2.0#future-trailers". -// -// Represents a future which may eventaully return trailers, or an error. -// -// In the case that the incoming HTTP Request or Response did not have any -// trailers, this future will resolve to the empty set of trailers once the -// complete Request or Response body has been received. -// -// resource future-trailers -type FutureTrailers cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "future-trailers". -// -// Drops a resource handle. -// -//go:nosplit -func (self FutureTrailers) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureTrailersResourceDrop((uint32)(self0)) - return -} - -// Get represents the imported method "get". -// -// Returns the contents of the trailers, or an error which occured, -// once the future is ready. -// -// The outer `option` represents future readiness. Users can wait on this -// `option` to become `some` using the `subscribe` method. -// -// The outer `result` is used to retrieve the trailers or error at most -// once. It will be success on the first call in which the outer option -// is `some`, and error on subsequent calls. -// -// The inner `result` represents that either the HTTP Request or Response -// body, as well as any trailers, were received successfully, or that an -// error occured receiving them. The optional `trailers` indicates whether -// or not trailers were present in the body. -// -// When some `trailers` are returned by this method, the `trailers` -// resource is immutable, and a child. Use of the `set`, `append`, or -// `delete` methods will return an error, and the resource must be -// dropped before the parent `future-trailers` is dropped. -// -// get: func() -// -//go:nosplit -func (self FutureTrailers) Get() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureTrailersGet((uint32)(self0)) - return -} - -// Subscribe represents the imported method "subscribe". -// -// Returns a pollable which becomes ready when either the trailers have -// been received, or an error has occured. When this pollable is ready, -// the `get` method will return `some`. -// -// subscribe: func() -// -//go:nosplit -func (self FutureTrailers) Subscribe() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureTrailersSubscribe((uint32)(self0)) - return -} - -// OutgoingResponse represents the imported resource "wasi:http/types@0.2.0#outgoing-response". -// -// Represents an outgoing HTTP Response. -// -// resource outgoing-response -type OutgoingResponse cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "outgoing-response". -// -// Drops a resource handle. -// -//go:nosplit -func (self OutgoingResponse) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingResponseResourceDrop((uint32)(self0)) - return -} - -// NewOutgoingResponse represents the imported constructor for resource "outgoing-response". -// -// Construct an `outgoing-response`, with a default `status-code` of `200`. -// If a different `status-code` is needed, it must be set via the -// `set-status-code` method. -// -// * `headers` is the HTTP Headers for the Response. -// -// constructor(headers: headers) -// -//go:nosplit -func NewOutgoingResponse(headers Headers) { - headers0 := cm.Reinterpret[uint32](headers) - wasmimport_NewOutgoingResponse((uint32)(headers0)) - return -} - -// Body represents the imported method "body". -// -// Returns the resource corresponding to the outgoing Body for this Response. -// -// Returns success on the first call: the `outgoing-body` resource for -// this `outgoing-response` can be retrieved at most once. Subsequent -// calls will return error. -// -// body: func() -// -//go:nosplit -func (self OutgoingResponse) Body() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingResponseBody((uint32)(self0)) - return -} - -// Headers represents the imported method "headers". -// -// Get the headers associated with the Request. -// -// The returned `headers` resource is immutable: `set`, `append`, and -// `delete` operations will fail with `header-error.immutable`. -// -// This headers resource is a child: it must be dropped before the parent -// `outgoing-request` is dropped, or its ownership is transfered to -// another component by e.g. `outgoing-handler.handle`. -// -// headers: func() -// -//go:nosplit -func (self OutgoingResponse) Headers() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingResponseHeaders((uint32)(self0)) - return -} - -// SetStatusCode represents the imported method "set-status-code". -// -// Set the HTTP Status Code for the Response. Fails if the status-code -// given is not a valid http status code. -// -// set-status-code: func(status-code: status-code) -// -//go:nosplit -func (self OutgoingResponse) SetStatusCode(statusCode StatusCode) { - self0 := cm.Reinterpret[uint32](self) - statusCode0 := (uint32)(statusCode) - wasmimport_OutgoingResponseSetStatusCode((uint32)(self0), (uint32)(statusCode0)) - return -} - -// StatusCode represents the imported method "status-code". -// -// Get the HTTP Status Code for the Response. -// -// status-code: func() -// -//go:nosplit -func (self OutgoingResponse) StatusCode() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingResponseStatusCode((uint32)(self0)) - return -} - -// OutgoingBody represents the imported resource "wasi:http/types@0.2.0#outgoing-body". -// -// Represents an outgoing HTTP Request or Response's Body. -// -// A body has both its contents - a stream of bytes - and a (possibly -// empty) set of trailers, inducating the full contents of the body -// have been sent. This resource represents the contents as an -// `output-stream` child resource, and the completion of the body (with -// optional trailers) with a static function that consumes the -// `outgoing-body` resource, and ensures that the user of this interface -// may not write to the body contents after the body has been finished. -// -// If the user code drops this resource, as opposed to calling the static -// method `finish`, the implementation should treat the body as incomplete, -// and that an error has occured. The implementation should propogate this -// error to the HTTP protocol by whatever means it has available, -// including: corrupting the body on the wire, aborting the associated -// Request, or sending a late status code for the Response. -// -// resource outgoing-body -type OutgoingBody cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "outgoing-body". -// -// Drops a resource handle. -// -//go:nosplit -func (self OutgoingBody) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingBodyResourceDrop((uint32)(self0)) - return -} - -// OutgoingBodyFinish represents the imported static function "finish". -// -// Finalize an outgoing body, optionally providing trailers. This must be -// called to signal that the response is complete. If the `outgoing-body` -// is dropped without calling `outgoing-body.finalize`, the implementation -// should treat the body as corrupted. -// -// Fails if the body's `outgoing-request` or `outgoing-response` was -// constructed with a Content-Length header, and the contents written -// to the body (via `write`) does not match the value given in the -// Content-Length. -// -// finish: static func(this: outgoing-body, trailers: option) -// -//go:nosplit -func OutgoingBodyFinish(this OutgoingBody, trailers cm.Option[Trailers]) { - this0 := cm.Reinterpret[uint32](this) - trailers0, trailers1 := lower_OptionTrailers(trailers) - wasmimport_OutgoingBodyFinish((uint32)(this0), (uint32)(trailers0), (uint32)(trailers1)) - return -} - -// Write represents the imported method "write". -// -// Returns a stream for writing the body contents. -// -// The returned `output-stream` is a child resource: it must be dropped -// before the parent `outgoing-body` resource is dropped (or finished), -// otherwise the `outgoing-body` drop or `finish` will trap. -// -// Returns success on the first call: the `output-stream` resource for -// this `outgoing-body` may be retrieved at most once. Subsequent calls -// will return error. -// -// write: func() -// -//go:nosplit -func (self OutgoingBody) Write() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingBodyWrite((uint32)(self0)) - return -} - -// FutureIncomingResponse represents the imported resource "wasi:http/types@0.2.0#future-incoming-response". -// -// Represents a future which may eventaully return an incoming HTTP -// Response, or an error. -// -// This resource is returned by the `wasi:http/outgoing-handler` interface to -// provide the HTTP Response corresponding to the sent Request. -// -// resource future-incoming-response -type FutureIncomingResponse cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "future-incoming-response". -// -// Drops a resource handle. -// -//go:nosplit -func (self FutureIncomingResponse) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureIncomingResponseResourceDrop((uint32)(self0)) - return -} - -// Get represents the imported method "get". -// -// Returns the incoming HTTP Response, or an error, once one is ready. -// -// The outer `option` represents future readiness. Users can wait on this -// `option` to become `some` using the `subscribe` method. -// -// The outer `result` is used to retrieve the response or error at most -// once. It will be success on the first call in which the outer option -// is `some`, and error on subsequent calls. -// -// The inner `result` represents that either the incoming HTTP Response -// status and headers have recieved successfully, or that an error -// occured. Errors may also occur while consuming the response body, -// but those will be reported by the `incoming-body` and its -// `output-stream` child. -// -// get: func() -// -//go:nosplit -func (self FutureIncomingResponse) Get() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureIncomingResponseGet((uint32)(self0)) - return -} - -// Subscribe represents the imported method "subscribe". -// -// Returns a pollable which becomes ready when either the Response has -// been received, or an error has occured. When this pollable is ready, -// the `get` method will return `some`. -// -// subscribe: func() -// -//go:nosplit -func (self FutureIncomingResponse) Subscribe() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureIncomingResponseSubscribe((uint32)(self0)) - return -} - -// HTTPErrorCode represents the imported function "http-error-code". -// -// Attempts to extract a http-related `error` from the wasi:io `error` -// provided. -// -// Stream operations which return -// `wasi:io/stream/stream-error::last-operation-failed` have a payload of -// type `wasi:io/error/error` with more information about the operation -// that failed. This payload can be passed through to this function to see -// if there's http-related information about the error to return. -// -// Note that this function is fallible because not all io-errors are -// http-related errors. -// -// http-error-code: func(err: borrow) -// -//go:nosplit -func HTTPErrorCode(err IOError) { - err0 := cm.Reinterpret[uint32](err) - wasmimport_HTTPErrorCode((uint32)(err0)) - return -} diff --git a/examples/component/http-password-checker/gen/wasi/io/error/empty.s b/examples/component/http-password-checker/gen/wasi/io/error/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/io/error/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/io/error/error.wit.go b/examples/component/http-password-checker/gen/wasi/io/error/error.wit.go deleted file mode 100755 index a7ebc7e4..00000000 --- a/examples/component/http-password-checker/gen/wasi/io/error/error.wit.go +++ /dev/null @@ -1,35 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package ioerror represents the imported interface "wasi:io/error@0.2.0". -package ioerror - -import ( - "go.bytecodealliance.org/cm" -) - -// Error represents the imported resource "wasi:io/error@0.2.0#error". -// -// resource error -type Error cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "error". -// -// Drops a resource handle. -// -//go:nosplit -func (self Error) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_ErrorResourceDrop((uint32)(self0)) - return -} - -// ToDebugString represents the imported method "to-debug-string". -// -// to-debug-string: func() -// -//go:nosplit -func (self Error) ToDebugString() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_ErrorToDebugString((uint32)(self0)) - return -} diff --git a/examples/component/http-password-checker/gen/wasi/io/error/ioerror.wasm.go b/examples/component/http-password-checker/gen/wasi/io/error/ioerror.wasm.go deleted file mode 100755 index 96c77c65..00000000 --- a/examples/component/http-password-checker/gen/wasi/io/error/ioerror.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package ioerror - -// This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". - -//go:wasmimport wasi:io/error@0.2.0 [resource-drop]error -//go:noescape -func wasmimport_ErrorResourceDrop(self0 uint32) - -//go:wasmimport wasi:io/error@0.2.0 [method]error.to-debug-string -//go:noescape -func wasmimport_ErrorToDebugString(self0 uint32) diff --git a/examples/component/http-password-checker/gen/wasi/io/poll/empty.s b/examples/component/http-password-checker/gen/wasi/io/poll/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/io/poll/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/io/poll/poll.wasm.go b/examples/component/http-password-checker/gen/wasi/io/poll/poll.wasm.go deleted file mode 100755 index d89a9926..00000000 --- a/examples/component/http-password-checker/gen/wasi/io/poll/poll.wasm.go +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package poll - -// This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". - -//go:wasmimport wasi:io/poll@0.2.0 [resource-drop]pollable -//go:noescape -func wasmimport_PollableResourceDrop(self0 uint32) - -//go:wasmimport wasi:io/poll@0.2.0 [method]pollable.block -//go:noescape -func wasmimport_PollableBlock(self0 uint32) - -//go:wasmimport wasi:io/poll@0.2.0 [method]pollable.ready -//go:noescape -func wasmimport_PollableReady(self0 uint32) - -//go:wasmimport wasi:io/poll@0.2.0 poll -//go:noescape -func wasmimport_Poll(in0 *Pollable, in1 uint32) diff --git a/examples/component/http-password-checker/gen/wasi/io/poll/poll.wit.go b/examples/component/http-password-checker/gen/wasi/io/poll/poll.wit.go deleted file mode 100755 index 4a952ecf..00000000 --- a/examples/component/http-password-checker/gen/wasi/io/poll/poll.wit.go +++ /dev/null @@ -1,57 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package poll represents the imported interface "wasi:io/poll@0.2.0". -package poll - -import ( - "go.bytecodealliance.org/cm" -) - -// Pollable represents the imported resource "wasi:io/poll@0.2.0#pollable". -// -// resource pollable -type Pollable cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "pollable". -// -// Drops a resource handle. -// -//go:nosplit -func (self Pollable) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_PollableResourceDrop((uint32)(self0)) - return -} - -// Block represents the imported method "block". -// -// block: func() -// -//go:nosplit -func (self Pollable) Block() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_PollableBlock((uint32)(self0)) - return -} - -// Ready represents the imported method "ready". -// -// ready: func() -// -//go:nosplit -func (self Pollable) Ready() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_PollableReady((uint32)(self0)) - return -} - -// Poll represents the imported function "poll". -// -// poll: func(in: list>) -// -//go:nosplit -func Poll(in cm.List[Pollable]) { - in0, in1 := cm.LowerList(in) - wasmimport_Poll((*Pollable)(in0), (uint32)(in1)) - return -} diff --git a/examples/component/http-password-checker/gen/wasi/io/streams/empty.s b/examples/component/http-password-checker/gen/wasi/io/streams/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/io/streams/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/io/streams/streams.wasm.go b/examples/component/http-password-checker/gen/wasi/io/streams/streams.wasm.go deleted file mode 100755 index 98543c56..00000000 --- a/examples/component/http-password-checker/gen/wasi/io/streams/streams.wasm.go +++ /dev/null @@ -1,73 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package streams - -// This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". - -//go:wasmimport wasi:io/streams@0.2.0 [resource-drop]input-stream -//go:noescape -func wasmimport_InputStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.blocking-read -//go:noescape -func wasmimport_InputStreamBlockingRead(self0 uint32, len0 uint64) - -//go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.blocking-skip -//go:noescape -func wasmimport_InputStreamBlockingSkip(self0 uint32, len0 uint64) - -//go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.read -//go:noescape -func wasmimport_InputStreamRead(self0 uint32, len0 uint64) - -//go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.skip -//go:noescape -func wasmimport_InputStreamSkip(self0 uint32, len0 uint64) - -//go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.subscribe -//go:noescape -func wasmimport_InputStreamSubscribe(self0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [resource-drop]output-stream -//go:noescape -func wasmimport_OutputStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-flush -//go:noescape -func wasmimport_OutputStreamBlockingFlush(self0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-splice -//go:noescape -func wasmimport_OutputStreamBlockingSplice(self0 uint32, src0 uint32, len0 uint64) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-write-and-flush -//go:noescape -func wasmimport_OutputStreamBlockingWriteAndFlush(self0 uint32, contents0 *uint8, contents1 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-write-zeroes-and-flush -//go:noescape -func wasmimport_OutputStreamBlockingWriteZeroesAndFlush(self0 uint32, len0 uint64) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.check-write -//go:noescape -func wasmimport_OutputStreamCheckWrite(self0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.flush -//go:noescape -func wasmimport_OutputStreamFlush(self0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.splice -//go:noescape -func wasmimport_OutputStreamSplice(self0 uint32, src0 uint32, len0 uint64) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.subscribe -//go:noescape -func wasmimport_OutputStreamSubscribe(self0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.write -//go:noescape -func wasmimport_OutputStreamWrite(self0 uint32, contents0 *uint8, contents1 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.write-zeroes -//go:noescape -func wasmimport_OutputStreamWriteZeroes(self0 uint32, len0 uint64) diff --git a/examples/component/http-password-checker/gen/wasi/io/streams/streams.wit.go b/examples/component/http-password-checker/gen/wasi/io/streams/streams.wit.go deleted file mode 100755 index 8183977d..00000000 --- a/examples/component/http-password-checker/gen/wasi/io/streams/streams.wit.go +++ /dev/null @@ -1,268 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package streams represents the imported interface "wasi:io/streams@0.2.0". -package streams - -import ( - "go.bytecodealliance.org/cm" - ioerror "http-password-checker/gen/wasi/io/error" - "http-password-checker/gen/wasi/io/poll" -) - -// Error represents the imported type alias "wasi:io/streams@0.2.0#error". -// -// See [ioerror.Error] for more information. -type Error = ioerror.Error - -// Pollable represents the imported type alias "wasi:io/streams@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// StreamError represents the imported variant "wasi:io/streams@0.2.0#stream-error". -// -// variant stream-error { -// last-operation-failed(error), -// closed, -// } -type StreamError cm.Variant[uint8, Error, Error] - -// StreamErrorLastOperationFailed returns a [StreamError] of case "last-operation-failed". -func StreamErrorLastOperationFailed(data Error) StreamError { - return cm.New[StreamError](0, data) -} - -// LastOperationFailed returns a non-nil *[Error] if [StreamError] represents the variant case "last-operation-failed". -func (self *StreamError) LastOperationFailed() *Error { - return cm.Case[Error](self, 0) -} - -// StreamErrorClosed returns a [StreamError] of case "closed". -func StreamErrorClosed() StreamError { - var data struct{} - return cm.New[StreamError](1, data) -} - -// Closed returns true if [StreamError] represents the variant case "closed". -func (self *StreamError) Closed() bool { - return self.Tag() == 1 -} - -var stringsStreamError = [2]string{ - "last-operation-failed", - "closed", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v StreamError) String() string { - return stringsStreamError[v.Tag()] -} - -// InputStream represents the imported resource "wasi:io/streams@0.2.0#input-stream". -// -// resource input-stream -type InputStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "input-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self InputStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_InputStreamResourceDrop((uint32)(self0)) - return -} - -// BlockingRead represents the imported method "blocking-read". -// -// blocking-read: func(len: u64) -// -//go:nosplit -func (self InputStream) BlockingRead(len_ uint64) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_InputStreamBlockingRead((uint32)(self0), (uint64)(len0)) - return -} - -// BlockingSkip represents the imported method "blocking-skip". -// -// blocking-skip: func(len: u64) -// -//go:nosplit -func (self InputStream) BlockingSkip(len_ uint64) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_InputStreamBlockingSkip((uint32)(self0), (uint64)(len0)) - return -} - -// Read represents the imported method "read". -// -// read: func(len: u64) -// -//go:nosplit -func (self InputStream) Read(len_ uint64) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_InputStreamRead((uint32)(self0), (uint64)(len0)) - return -} - -// Skip represents the imported method "skip". -// -// skip: func(len: u64) -// -//go:nosplit -func (self InputStream) Skip(len_ uint64) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_InputStreamSkip((uint32)(self0), (uint64)(len0)) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -// -//go:nosplit -func (self InputStream) Subscribe() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_InputStreamSubscribe((uint32)(self0)) - return -} - -// OutputStream represents the imported resource "wasi:io/streams@0.2.0#output-stream". -// -// resource output-stream -type OutputStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "output-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self OutputStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamResourceDrop((uint32)(self0)) - return -} - -// BlockingFlush represents the imported method "blocking-flush". -// -// blocking-flush: func() -// -//go:nosplit -func (self OutputStream) BlockingFlush() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamBlockingFlush((uint32)(self0)) - return -} - -// BlockingSplice represents the imported method "blocking-splice". -// -// blocking-splice: func(src: borrow, len: u64) -// -//go:nosplit -func (self OutputStream) BlockingSplice(src InputStream, len_ uint64) { - self0 := cm.Reinterpret[uint32](self) - src0 := cm.Reinterpret[uint32](src) - len0 := (uint64)(len_) - wasmimport_OutputStreamBlockingSplice((uint32)(self0), (uint32)(src0), (uint64)(len0)) - return -} - -// BlockingWriteAndFlush represents the imported method "blocking-write-and-flush". -// -// blocking-write-and-flush: func(contents: list) -// -//go:nosplit -func (self OutputStream) BlockingWriteAndFlush(contents cm.List[uint8]) { - self0 := cm.Reinterpret[uint32](self) - contents0, contents1 := cm.LowerList(contents) - wasmimport_OutputStreamBlockingWriteAndFlush((uint32)(self0), (*uint8)(contents0), (uint32)(contents1)) - return -} - -// BlockingWriteZeroesAndFlush represents the imported method "blocking-write-zeroes-and-flush". -// -// blocking-write-zeroes-and-flush: func(len: u64) -// -//go:nosplit -func (self OutputStream) BlockingWriteZeroesAndFlush(len_ uint64) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_OutputStreamBlockingWriteZeroesAndFlush((uint32)(self0), (uint64)(len0)) - return -} - -// CheckWrite represents the imported method "check-write". -// -// check-write: func() -// -//go:nosplit -func (self OutputStream) CheckWrite() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamCheckWrite((uint32)(self0)) - return -} - -// Flush represents the imported method "flush". -// -// flush: func() -// -//go:nosplit -func (self OutputStream) Flush() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamFlush((uint32)(self0)) - return -} - -// Splice represents the imported method "splice". -// -// splice: func(src: borrow, len: u64) -// -//go:nosplit -func (self OutputStream) Splice(src InputStream, len_ uint64) { - self0 := cm.Reinterpret[uint32](self) - src0 := cm.Reinterpret[uint32](src) - len0 := (uint64)(len_) - wasmimport_OutputStreamSplice((uint32)(self0), (uint32)(src0), (uint64)(len0)) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -// -//go:nosplit -func (self OutputStream) Subscribe() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamSubscribe((uint32)(self0)) - return -} - -// Write represents the imported method "write". -// -// write: func(contents: list) -// -//go:nosplit -func (self OutputStream) Write(contents cm.List[uint8]) { - self0 := cm.Reinterpret[uint32](self) - contents0, contents1 := cm.LowerList(contents) - wasmimport_OutputStreamWrite((uint32)(self0), (*uint8)(contents0), (uint32)(contents1)) - return -} - -// WriteZeroes represents the imported method "write-zeroes". -// -// write-zeroes: func(len: u64) -// -//go:nosplit -func (self OutputStream) WriteZeroes(len_ uint64) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_OutputStreamWriteZeroes((uint32)(self0), (uint64)(len0)) - return -} diff --git a/examples/component/http-password-checker/gen/wasi/logging/logging/empty.s b/examples/component/http-password-checker/gen/wasi/logging/logging/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/logging/logging/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/logging/logging/logging.wasm.go b/examples/component/http-password-checker/gen/wasi/logging/logging/logging.wasm.go deleted file mode 100755 index d2d27098..00000000 --- a/examples/component/http-password-checker/gen/wasi/logging/logging/logging.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package logging - -// This file contains wasmimport and wasmexport declarations for "wasi:logging@0.1.0-draft". - -//go:wasmimport wasi:logging/logging@0.1.0-draft log -//go:noescape -func wasmimport_Log(level0 uint32, context0 *uint8, context1 uint32, message0 *uint8, message1 uint32) diff --git a/examples/component/http-password-checker/gen/wasi/logging/logging/logging.wit.go b/examples/component/http-password-checker/gen/wasi/logging/logging/logging.wit.go deleted file mode 100755 index 96e406ed..00000000 --- a/examples/component/http-password-checker/gen/wasi/logging/logging/logging.wit.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package logging represents the imported interface "wasi:logging/logging@0.1.0-draft". -package logging - -import ( - "go.bytecodealliance.org/cm" -) - -// Level represents the enum "wasi:logging/logging@0.1.0-draft#level". -// -// enum level { -// trace, -// debug, -// info, -// warn, -// error, -// critical -// } -type Level uint8 - -const ( - LevelTrace Level = iota - LevelDebug - LevelInfo - LevelWarn - LevelError - LevelCritical -) - -var stringsLevel = [6]string{ - "trace", - "debug", - "info", - "warn", - "error", - "critical", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e Level) String() string { - return stringsLevel[e] -} - -// Log represents the imported function "log". -// -// log: func(level: level, context: string, message: string) -// -//go:nosplit -func Log(level Level, context string, message string) { - level0 := (uint32)(level) - context0, context1 := cm.LowerString(context) - message0, message1 := cm.LowerString(message) - wasmimport_Log((uint32)(level0), (*uint8)(context0), (uint32)(context1), (*uint8)(message0), (uint32)(message1)) - return -} diff --git a/examples/component/http-password-checker/gen/wasi/random/insecure-seed/empty.s b/examples/component/http-password-checker/gen/wasi/random/insecure-seed/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/random/insecure-seed/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/random/insecure-seed/insecure-seed.wit.go b/examples/component/http-password-checker/gen/wasi/random/insecure-seed/insecure-seed.wit.go deleted file mode 100755 index 6b9afd75..00000000 --- a/examples/component/http-password-checker/gen/wasi/random/insecure-seed/insecure-seed.wit.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package insecureseed represents the imported interface "wasi:random/insecure-seed@0.2.0". -package insecureseed - -// InsecureSeed represents the imported function "insecure-seed". -// -// insecure-seed: func() -// -//go:nosplit -func InsecureSeed() { - wasmimport_InsecureSeed() - return -} diff --git a/examples/component/http-password-checker/gen/wasi/random/insecure-seed/insecureseed.wasm.go b/examples/component/http-password-checker/gen/wasi/random/insecure-seed/insecureseed.wasm.go deleted file mode 100755 index 6dc19c0b..00000000 --- a/examples/component/http-password-checker/gen/wasi/random/insecure-seed/insecureseed.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package insecureseed - -// This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". - -//go:wasmimport wasi:random/insecure-seed@0.2.0 insecure-seed -//go:noescape -func wasmimport_InsecureSeed() diff --git a/examples/component/http-password-checker/gen/wasi/random/insecure/empty.s b/examples/component/http-password-checker/gen/wasi/random/insecure/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/random/insecure/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/random/insecure/insecure.wasm.go b/examples/component/http-password-checker/gen/wasi/random/insecure/insecure.wasm.go deleted file mode 100755 index 41ffb551..00000000 --- a/examples/component/http-password-checker/gen/wasi/random/insecure/insecure.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package insecure - -// This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". - -//go:wasmimport wasi:random/insecure@0.2.0 get-insecure-random-bytes -//go:noescape -func wasmimport_GetInsecureRandomBytes(len0 uint64) - -//go:wasmimport wasi:random/insecure@0.2.0 get-insecure-random-u64 -//go:noescape -func wasmimport_GetInsecureRandomU64() diff --git a/examples/component/http-password-checker/gen/wasi/random/insecure/insecure.wit.go b/examples/component/http-password-checker/gen/wasi/random/insecure/insecure.wit.go deleted file mode 100755 index add35465..00000000 --- a/examples/component/http-password-checker/gen/wasi/random/insecure/insecure.wit.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package insecure represents the imported interface "wasi:random/insecure@0.2.0". -package insecure - -// GetInsecureRandomBytes represents the imported function "get-insecure-random-bytes". -// -// get-insecure-random-bytes: func(len: u64) -// -//go:nosplit -func GetInsecureRandomBytes(len_ uint64) { - len0 := (uint64)(len_) - wasmimport_GetInsecureRandomBytes((uint64)(len0)) - return -} - -// GetInsecureRandomU64 represents the imported function "get-insecure-random-u64". -// -// get-insecure-random-u64: func() -// -//go:nosplit -func GetInsecureRandomU64() { - wasmimport_GetInsecureRandomU64() - return -} diff --git a/examples/component/http-password-checker/gen/wasi/random/random/empty.s b/examples/component/http-password-checker/gen/wasi/random/random/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/random/random/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/random/random/random.wasm.go b/examples/component/http-password-checker/gen/wasi/random/random/random.wasm.go deleted file mode 100755 index 512ee826..00000000 --- a/examples/component/http-password-checker/gen/wasi/random/random/random.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package random - -// This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". - -//go:wasmimport wasi:random/random@0.2.0 get-random-bytes -//go:noescape -func wasmimport_GetRandomBytes(len0 uint64) - -//go:wasmimport wasi:random/random@0.2.0 get-random-u64 -//go:noescape -func wasmimport_GetRandomU64() diff --git a/examples/component/http-password-checker/gen/wasi/random/random/random.wit.go b/examples/component/http-password-checker/gen/wasi/random/random/random.wit.go deleted file mode 100755 index f11f988d..00000000 --- a/examples/component/http-password-checker/gen/wasi/random/random/random.wit.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package random represents the imported interface "wasi:random/random@0.2.0". -package random - -// GetRandomBytes represents the imported function "get-random-bytes". -// -// get-random-bytes: func(len: u64) -// -//go:nosplit -func GetRandomBytes(len_ uint64) { - len0 := (uint64)(len_) - wasmimport_GetRandomBytes((uint64)(len0)) - return -} - -// GetRandomU64 represents the imported function "get-random-u64". -// -// get-random-u64: func() -// -//go:nosplit -func GetRandomU64() { - wasmimport_GetRandomU64() - return -} diff --git a/examples/component/http-password-checker/gen/wasi/sockets/instance-network/empty.s b/examples/component/http-password-checker/gen/wasi/sockets/instance-network/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/sockets/instance-network/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/sockets/instance-network/instance-network.wit.go b/examples/component/http-password-checker/gen/wasi/sockets/instance-network/instance-network.wit.go deleted file mode 100755 index 46426da3..00000000 --- a/examples/component/http-password-checker/gen/wasi/sockets/instance-network/instance-network.wit.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package instancenetwork represents the imported interface "wasi:sockets/instance-network@0.2.0". -package instancenetwork - -import ( - "http-password-checker/gen/wasi/sockets/network" -) - -// Network represents the imported type alias "wasi:sockets/instance-network@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// InstanceNetwork represents the imported function "instance-network". -// -// instance-network: func() -// -//go:nosplit -func InstanceNetwork() { - wasmimport_InstanceNetwork() - return -} diff --git a/examples/component/http-password-checker/gen/wasi/sockets/instance-network/instancenetwork.wasm.go b/examples/component/http-password-checker/gen/wasi/sockets/instance-network/instancenetwork.wasm.go deleted file mode 100755 index 01fc4839..00000000 --- a/examples/component/http-password-checker/gen/wasi/sockets/instance-network/instancenetwork.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package instancenetwork - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/instance-network@0.2.0 instance-network -//go:noescape -func wasmimport_InstanceNetwork() diff --git a/examples/component/http-password-checker/gen/wasi/sockets/ip-name-lookup/abi.go b/examples/component/http-password-checker/gen/wasi/sockets/ip-name-lookup/abi.go deleted file mode 100755 index a63f0d01..00000000 --- a/examples/component/http-password-checker/gen/wasi/sockets/ip-name-lookup/abi.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package ipnamelookup - -import ( - "go.bytecodealliance.org/cm" - "unsafe" -) - -// OptionIPAddressShape is used for storage in variant or result types. -type OptionIPAddressShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Option[IPAddress]{})]byte -} diff --git a/examples/component/http-password-checker/gen/wasi/sockets/ip-name-lookup/empty.s b/examples/component/http-password-checker/gen/wasi/sockets/ip-name-lookup/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/sockets/ip-name-lookup/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go b/examples/component/http-password-checker/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go deleted file mode 100755 index df1313b5..00000000 --- a/examples/component/http-password-checker/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package ipnamelookup represents the imported interface "wasi:sockets/ip-name-lookup@0.2.0". -package ipnamelookup - -import ( - "go.bytecodealliance.org/cm" - "http-password-checker/gen/wasi/io/poll" - "http-password-checker/gen/wasi/sockets/network" -) - -// Pollable represents the imported type alias "wasi:sockets/ip-name-lookup@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// Network represents the imported type alias "wasi:sockets/ip-name-lookup@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// ErrorCode represents the type alias "wasi:sockets/ip-name-lookup@0.2.0#error-code". -// -// See [network.ErrorCode] for more information. -type ErrorCode = network.ErrorCode - -// IPAddress represents the type alias "wasi:sockets/ip-name-lookup@0.2.0#ip-address". -// -// See [network.IPAddress] for more information. -type IPAddress = network.IPAddress - -// ResolveAddressStream represents the imported resource "wasi:sockets/ip-name-lookup@0.2.0#resolve-address-stream". -// -// resource resolve-address-stream -type ResolveAddressStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "resolve-address-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self ResolveAddressStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_ResolveAddressStreamResourceDrop((uint32)(self0)) - return -} - -// ResolveNextAddress represents the imported method "resolve-next-address". -// -// resolve-next-address: func() -// -//go:nosplit -func (self ResolveAddressStream) ResolveNextAddress() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_ResolveAddressStreamResolveNextAddress((uint32)(self0)) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -// -//go:nosplit -func (self ResolveAddressStream) Subscribe() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_ResolveAddressStreamSubscribe((uint32)(self0)) - return -} - -// ResolveAddresses represents the imported function "resolve-addresses". -// -// resolve-addresses: func(network: borrow, name: string) -// -//go:nosplit -func ResolveAddresses(network_ Network, name string) { - network0 := cm.Reinterpret[uint32](network_) - name0, name1 := cm.LowerString(name) - wasmimport_ResolveAddresses((uint32)(network0), (*uint8)(name0), (uint32)(name1)) - return -} diff --git a/examples/component/http-password-checker/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go b/examples/component/http-password-checker/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go deleted file mode 100755 index df4d85bc..00000000 --- a/examples/component/http-password-checker/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package ipnamelookup - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 [resource-drop]resolve-address-stream -//go:noescape -func wasmimport_ResolveAddressStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 [method]resolve-address-stream.resolve-next-address -//go:noescape -func wasmimport_ResolveAddressStreamResolveNextAddress(self0 uint32) - -//go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 [method]resolve-address-stream.subscribe -//go:noescape -func wasmimport_ResolveAddressStreamSubscribe(self0 uint32) - -//go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 resolve-addresses -//go:noescape -func wasmimport_ResolveAddresses(network0 uint32, name0 *uint8, name1 uint32) diff --git a/examples/component/http-password-checker/gen/wasi/sockets/network/abi.go b/examples/component/http-password-checker/gen/wasi/sockets/network/abi.go deleted file mode 100755 index a088bd1d..00000000 --- a/examples/component/http-password-checker/gen/wasi/sockets/network/abi.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package network - -import ( - "go.bytecodealliance.org/cm" - "unsafe" -) - -// IPv6SocketAddressShape is used for storage in variant or result types. -type IPv6SocketAddressShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(IPv6SocketAddress{})]byte -} diff --git a/examples/component/http-password-checker/gen/wasi/sockets/network/empty.s b/examples/component/http-password-checker/gen/wasi/sockets/network/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/sockets/network/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/sockets/network/network.wasm.go b/examples/component/http-password-checker/gen/wasi/sockets/network/network.wasm.go deleted file mode 100755 index 012a79ff..00000000 --- a/examples/component/http-password-checker/gen/wasi/sockets/network/network.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package network - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/network@0.2.0 [resource-drop]network -//go:noescape -func wasmimport_NetworkResourceDrop(self0 uint32) diff --git a/examples/component/http-password-checker/gen/wasi/sockets/network/network.wit.go b/examples/component/http-password-checker/gen/wasi/sockets/network/network.wit.go deleted file mode 100755 index f0fb7eef..00000000 --- a/examples/component/http-password-checker/gen/wasi/sockets/network/network.wit.go +++ /dev/null @@ -1,241 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package network represents the imported interface "wasi:sockets/network@0.2.0". -package network - -import ( - "go.bytecodealliance.org/cm" -) - -// Network represents the imported resource "wasi:sockets/network@0.2.0#network". -// -// resource network -type Network cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "network". -// -// Drops a resource handle. -// -//go:nosplit -func (self Network) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_NetworkResourceDrop((uint32)(self0)) - return -} - -// ErrorCode represents the enum "wasi:sockets/network@0.2.0#error-code". -// -// enum error-code { -// unknown, -// access-denied, -// not-supported, -// invalid-argument, -// out-of-memory, -// timeout, -// concurrency-conflict, -// not-in-progress, -// would-block, -// invalid-state, -// new-socket-limit, -// address-not-bindable, -// address-in-use, -// remote-unreachable, -// connection-refused, -// connection-reset, -// connection-aborted, -// datagram-too-large, -// name-unresolvable, -// temporary-resolver-failure, -// permanent-resolver-failure -// } -type ErrorCode uint8 - -const ( - ErrorCodeUnknown ErrorCode = iota - ErrorCodeAccessDenied - ErrorCodeNotSupported - ErrorCodeInvalidArgument - ErrorCodeOutOfMemory - ErrorCodeTimeout - ErrorCodeConcurrencyConflict - ErrorCodeNotInProgress - ErrorCodeWouldBlock - ErrorCodeInvalidState - ErrorCodeNewSocketLimit - ErrorCodeAddressNotBindable - ErrorCodeAddressInUse - ErrorCodeRemoteUnreachable - ErrorCodeConnectionRefused - ErrorCodeConnectionReset - ErrorCodeConnectionAborted - ErrorCodeDatagramTooLarge - ErrorCodeNameUnresolvable - ErrorCodeTemporaryResolverFailure - ErrorCodePermanentResolverFailure -) - -var stringsErrorCode = [21]string{ - "unknown", - "access-denied", - "not-supported", - "invalid-argument", - "out-of-memory", - "timeout", - "concurrency-conflict", - "not-in-progress", - "would-block", - "invalid-state", - "new-socket-limit", - "address-not-bindable", - "address-in-use", - "remote-unreachable", - "connection-refused", - "connection-reset", - "connection-aborted", - "datagram-too-large", - "name-unresolvable", - "temporary-resolver-failure", - "permanent-resolver-failure", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e ErrorCode) String() string { - return stringsErrorCode[e] -} - -// IPAddressFamily represents the enum "wasi:sockets/network@0.2.0#ip-address-family". -// -// enum ip-address-family { -// ipv4, -// ipv6 -// } -type IPAddressFamily uint8 - -const ( - IPAddressFamilyIPv4 IPAddressFamily = iota - IPAddressFamilyIPv6 -) - -var stringsIPAddressFamily = [2]string{ - "ipv4", - "ipv6", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e IPAddressFamily) String() string { - return stringsIPAddressFamily[e] -} - -// IPv4Address represents the tuple "wasi:sockets/network@0.2.0#ipv4-address". -// -// type ipv4-address = tuple -type IPv4Address [4]uint8 - -// IPv6Address represents the tuple "wasi:sockets/network@0.2.0#ipv6-address". -// -// type ipv6-address = tuple -type IPv6Address [8]uint16 - -// IPAddress represents the variant "wasi:sockets/network@0.2.0#ip-address". -// -// variant ip-address { -// ipv4(ipv4-address), -// ipv6(ipv6-address), -// } -type IPAddress cm.Variant[uint8, IPv6Address, IPv6Address] - -// IPAddressIPv4 returns a [IPAddress] of case "ipv4". -func IPAddressIPv4(data IPv4Address) IPAddress { - return cm.New[IPAddress](0, data) -} - -// IPv4 returns a non-nil *[IPv4Address] if [IPAddress] represents the variant case "ipv4". -func (self *IPAddress) IPv4() *IPv4Address { - return cm.Case[IPv4Address](self, 0) -} - -// IPAddressIPv6 returns a [IPAddress] of case "ipv6". -func IPAddressIPv6(data IPv6Address) IPAddress { - return cm.New[IPAddress](1, data) -} - -// IPv6 returns a non-nil *[IPv6Address] if [IPAddress] represents the variant case "ipv6". -func (self *IPAddress) IPv6() *IPv6Address { - return cm.Case[IPv6Address](self, 1) -} - -var stringsIPAddress = [2]string{ - "ipv4", - "ipv6", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v IPAddress) String() string { - return stringsIPAddress[v.Tag()] -} - -// IPv4SocketAddress represents the record "wasi:sockets/network@0.2.0#ipv4-socket-address". -// -// record ipv4-socket-address { -// port: u16, -// address: ipv4-address, -// } -type IPv4SocketAddress struct { - _ cm.HostLayout - Port uint16 - Address IPv4Address -} - -// IPv6SocketAddress represents the record "wasi:sockets/network@0.2.0#ipv6-socket-address". -// -// record ipv6-socket-address { -// port: u16, -// flow-info: u32, -// address: ipv6-address, -// scope-id: u32, -// } -type IPv6SocketAddress struct { - _ cm.HostLayout - Port uint16 - FlowInfo uint32 - Address IPv6Address - ScopeID uint32 -} - -// IPSocketAddress represents the variant "wasi:sockets/network@0.2.0#ip-socket-address". -// -// variant ip-socket-address { -// ipv4(ipv4-socket-address), -// ipv6(ipv6-socket-address), -// } -type IPSocketAddress cm.Variant[uint8, IPv6SocketAddressShape, IPv6SocketAddress] - -// IPSocketAddressIPv4 returns a [IPSocketAddress] of case "ipv4". -func IPSocketAddressIPv4(data IPv4SocketAddress) IPSocketAddress { - return cm.New[IPSocketAddress](0, data) -} - -// IPv4 returns a non-nil *[IPv4SocketAddress] if [IPSocketAddress] represents the variant case "ipv4". -func (self *IPSocketAddress) IPv4() *IPv4SocketAddress { - return cm.Case[IPv4SocketAddress](self, 0) -} - -// IPSocketAddressIPv6 returns a [IPSocketAddress] of case "ipv6". -func IPSocketAddressIPv6(data IPv6SocketAddress) IPSocketAddress { - return cm.New[IPSocketAddress](1, data) -} - -// IPv6 returns a non-nil *[IPv6SocketAddress] if [IPSocketAddress] represents the variant case "ipv6". -func (self *IPSocketAddress) IPv6() *IPv6SocketAddress { - return cm.Case[IPv6SocketAddress](self, 1) -} - -var stringsIPSocketAddress = [2]string{ - "ipv4", - "ipv6", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v IPSocketAddress) String() string { - return stringsIPSocketAddress[v.Tag()] -} diff --git a/examples/component/http-password-checker/gen/wasi/sockets/tcp-create-socket/empty.s b/examples/component/http-password-checker/gen/wasi/sockets/tcp-create-socket/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/sockets/tcp-create-socket/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go b/examples/component/http-password-checker/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go deleted file mode 100755 index edefdb57..00000000 --- a/examples/component/http-password-checker/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package tcpcreatesocket represents the imported interface "wasi:sockets/tcp-create-socket@0.2.0". -package tcpcreatesocket - -import ( - "http-password-checker/gen/wasi/sockets/network" - "http-password-checker/gen/wasi/sockets/tcp" -) - -// Network represents the imported type alias "wasi:sockets/tcp-create-socket@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// ErrorCode represents the type alias "wasi:sockets/tcp-create-socket@0.2.0#error-code". -// -// See [network.ErrorCode] for more information. -type ErrorCode = network.ErrorCode - -// IPAddressFamily represents the type alias "wasi:sockets/tcp-create-socket@0.2.0#ip-address-family". -// -// See [network.IPAddressFamily] for more information. -type IPAddressFamily = network.IPAddressFamily - -// TCPSocket represents the imported type alias "wasi:sockets/tcp-create-socket@0.2.0#tcp-socket". -// -// See [tcp.TCPSocket] for more information. -type TCPSocket = tcp.TCPSocket - -// CreateTCPSocket represents the imported function "create-tcp-socket". -// -// create-tcp-socket: func(address-family: ip-address-family) -// -//go:nosplit -func CreateTCPSocket(addressFamily IPAddressFamily) { - addressFamily0 := (uint32)(addressFamily) - wasmimport_CreateTCPSocket((uint32)(addressFamily0)) - return -} diff --git a/examples/component/http-password-checker/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go b/examples/component/http-password-checker/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go deleted file mode 100755 index 48d9b113..00000000 --- a/examples/component/http-password-checker/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package tcpcreatesocket - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/tcp-create-socket@0.2.0 create-tcp-socket -//go:noescape -func wasmimport_CreateTCPSocket(addressFamily0 uint32) diff --git a/examples/component/http-password-checker/gen/wasi/sockets/tcp/abi.go b/examples/component/http-password-checker/gen/wasi/sockets/tcp/abi.go deleted file mode 100755 index 89b1a288..00000000 --- a/examples/component/http-password-checker/gen/wasi/sockets/tcp/abi.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package tcp - -import ( - "go.bytecodealliance.org/cm" - "http-password-checker/gen/wasi/sockets/network" -) - -func lower_IPv4Address(v network.IPv4Address) (f0 uint32, f1 uint32, f2 uint32, f3 uint32) { - f0 = (uint32)(v[0]) - f1 = (uint32)(v[1]) - f2 = (uint32)(v[2]) - f3 = (uint32)(v[3]) - return -} - -func lower_IPv4SocketAddress(v network.IPv4SocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32) { - f0 = (uint32)(v.Port) - f1, f2, f3, f4 = lower_IPv4Address(v.Address) - return -} - -func lower_IPv6Address(v network.IPv6Address) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32) { - f0 = (uint32)(v[0]) - f1 = (uint32)(v[1]) - f2 = (uint32)(v[2]) - f3 = (uint32)(v[3]) - f4 = (uint32)(v[4]) - f5 = (uint32)(v[5]) - f6 = (uint32)(v[6]) - f7 = (uint32)(v[7]) - return -} - -func lower_IPv6SocketAddress(v network.IPv6SocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32) { - f0 = (uint32)(v.Port) - f1 = (uint32)(v.FlowInfo) - f2, f3, f4, f5, f6, f7, f8, f9 = lower_IPv6Address(v.Address) - f10 = (uint32)(v.ScopeID) - return -} - -func lower_IPSocketAddress(v network.IPSocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32, f11 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 0: // ipv4 - v1, v2, v3, v4, v5 := lower_IPv4SocketAddress(*cm.Case[network.IPv4SocketAddress](&v, 0)) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 1: // ipv6 - v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11 := lower_IPv6SocketAddress(*cm.Case[network.IPv6SocketAddress](&v, 1)) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - f6 = (uint32)(v6) - f7 = (uint32)(v7) - f8 = (uint32)(v8) - f9 = (uint32)(v9) - f10 = (uint32)(v10) - f11 = (uint32)(v11) - } - return -} diff --git a/examples/component/http-password-checker/gen/wasi/sockets/tcp/empty.s b/examples/component/http-password-checker/gen/wasi/sockets/tcp/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/sockets/tcp/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/sockets/tcp/tcp.wasm.go b/examples/component/http-password-checker/gen/wasi/sockets/tcp/tcp.wasm.go deleted file mode 100755 index 3d3553be..00000000 --- a/examples/component/http-password-checker/gen/wasi/sockets/tcp/tcp.wasm.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package tcp - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/tcp@0.2.0 [resource-drop]tcp-socket -//go:noescape -func wasmimport_TCPSocketResourceDrop(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.accept -//go:noescape -func wasmimport_TCPSocketAccept(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.address-family -//go:noescape -func wasmimport_TCPSocketAddressFamily(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-bind -//go:noescape -func wasmimport_TCPSocketFinishBind(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-connect -//go:noescape -func wasmimport_TCPSocketFinishConnect(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-listen -//go:noescape -func wasmimport_TCPSocketFinishListen(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.hop-limit -//go:noescape -func wasmimport_TCPSocketHopLimit(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.is-listening -//go:noescape -func wasmimport_TCPSocketIsListening(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-count -//go:noescape -func wasmimport_TCPSocketKeepAliveCount(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-enabled -//go:noescape -func wasmimport_TCPSocketKeepAliveEnabled(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-idle-time -//go:noescape -func wasmimport_TCPSocketKeepAliveIdleTime(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-interval -//go:noescape -func wasmimport_TCPSocketKeepAliveInterval(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.local-address -//go:noescape -func wasmimport_TCPSocketLocalAddress(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.receive-buffer-size -//go:noescape -func wasmimport_TCPSocketReceiveBufferSize(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.remote-address -//go:noescape -func wasmimport_TCPSocketRemoteAddress(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.send-buffer-size -//go:noescape -func wasmimport_TCPSocketSendBufferSize(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-hop-limit -//go:noescape -func wasmimport_TCPSocketSetHopLimit(self0 uint32, value0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-count -//go:noescape -func wasmimport_TCPSocketSetKeepAliveCount(self0 uint32, value0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-enabled -//go:noescape -func wasmimport_TCPSocketSetKeepAliveEnabled(self0 uint32, value0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-idle-time -//go:noescape -func wasmimport_TCPSocketSetKeepAliveIdleTime(self0 uint32, value0 uint64) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-interval -//go:noescape -func wasmimport_TCPSocketSetKeepAliveInterval(self0 uint32, value0 uint64) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-listen-backlog-size -//go:noescape -func wasmimport_TCPSocketSetListenBacklogSize(self0 uint32, value0 uint64) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-receive-buffer-size -//go:noescape -func wasmimport_TCPSocketSetReceiveBufferSize(self0 uint32, value0 uint64) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-send-buffer-size -//go:noescape -func wasmimport_TCPSocketSetSendBufferSize(self0 uint32, value0 uint64) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.shutdown -//go:noescape -func wasmimport_TCPSocketShutdown(self0 uint32, shutdownType0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-bind -//go:noescape -func wasmimport_TCPSocketStartBind(self0 uint32, network0 uint32, localAddress0 uint32, localAddress1 uint32, localAddress2 uint32, localAddress3 uint32, localAddress4 uint32, localAddress5 uint32, localAddress6 uint32, localAddress7 uint32, localAddress8 uint32, localAddress9 uint32, localAddress10 uint32, localAddress11 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-connect -//go:noescape -func wasmimport_TCPSocketStartConnect(self0 uint32, network0 uint32, remoteAddress0 uint32, remoteAddress1 uint32, remoteAddress2 uint32, remoteAddress3 uint32, remoteAddress4 uint32, remoteAddress5 uint32, remoteAddress6 uint32, remoteAddress7 uint32, remoteAddress8 uint32, remoteAddress9 uint32, remoteAddress10 uint32, remoteAddress11 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-listen -//go:noescape -func wasmimport_TCPSocketStartListen(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.subscribe -//go:noescape -func wasmimport_TCPSocketSubscribe(self0 uint32) diff --git a/examples/component/http-password-checker/gen/wasi/sockets/tcp/tcp.wit.go b/examples/component/http-password-checker/gen/wasi/sockets/tcp/tcp.wit.go deleted file mode 100755 index 737969cc..00000000 --- a/examples/component/http-password-checker/gen/wasi/sockets/tcp/tcp.wit.go +++ /dev/null @@ -1,415 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package tcp represents the imported interface "wasi:sockets/tcp@0.2.0". -package tcp - -import ( - "go.bytecodealliance.org/cm" - monotonicclock "http-password-checker/gen/wasi/clocks/monotonic-clock" - "http-password-checker/gen/wasi/io/poll" - "http-password-checker/gen/wasi/io/streams" - "http-password-checker/gen/wasi/sockets/network" -) - -// InputStream represents the imported type alias "wasi:sockets/tcp@0.2.0#input-stream". -// -// See [streams.InputStream] for more information. -type InputStream = streams.InputStream - -// OutputStream represents the imported type alias "wasi:sockets/tcp@0.2.0#output-stream". -// -// See [streams.OutputStream] for more information. -type OutputStream = streams.OutputStream - -// Pollable represents the imported type alias "wasi:sockets/tcp@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// Duration represents the type alias "wasi:sockets/tcp@0.2.0#duration". -// -// See [monotonicclock.Duration] for more information. -type Duration = monotonicclock.Duration - -// Network represents the imported type alias "wasi:sockets/tcp@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// ErrorCode represents the type alias "wasi:sockets/tcp@0.2.0#error-code". -// -// See [network.ErrorCode] for more information. -type ErrorCode = network.ErrorCode - -// IPSocketAddress represents the type alias "wasi:sockets/tcp@0.2.0#ip-socket-address". -// -// See [network.IPSocketAddress] for more information. -type IPSocketAddress = network.IPSocketAddress - -// IPAddressFamily represents the type alias "wasi:sockets/tcp@0.2.0#ip-address-family". -// -// See [network.IPAddressFamily] for more information. -type IPAddressFamily = network.IPAddressFamily - -// ShutdownType represents the enum "wasi:sockets/tcp@0.2.0#shutdown-type". -// -// enum shutdown-type { -// receive, -// send, -// both -// } -type ShutdownType uint8 - -const ( - ShutdownTypeReceive ShutdownType = iota - ShutdownTypeSend - ShutdownTypeBoth -) - -var stringsShutdownType = [3]string{ - "receive", - "send", - "both", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e ShutdownType) String() string { - return stringsShutdownType[e] -} - -// TCPSocket represents the imported resource "wasi:sockets/tcp@0.2.0#tcp-socket". -// -// resource tcp-socket -type TCPSocket cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "tcp-socket". -// -// Drops a resource handle. -// -//go:nosplit -func (self TCPSocket) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketResourceDrop((uint32)(self0)) - return -} - -// Accept represents the imported method "accept". -// -// accept: func() -// -//go:nosplit -func (self TCPSocket) Accept() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketAccept((uint32)(self0)) - return -} - -// AddressFamily represents the imported method "address-family". -// -// address-family: func() -// -//go:nosplit -func (self TCPSocket) AddressFamily() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketAddressFamily((uint32)(self0)) - return -} - -// FinishBind represents the imported method "finish-bind". -// -// finish-bind: func() -// -//go:nosplit -func (self TCPSocket) FinishBind() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketFinishBind((uint32)(self0)) - return -} - -// FinishConnect represents the imported method "finish-connect". -// -// finish-connect: func() -// -//go:nosplit -func (self TCPSocket) FinishConnect() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketFinishConnect((uint32)(self0)) - return -} - -// FinishListen represents the imported method "finish-listen". -// -// finish-listen: func() -// -//go:nosplit -func (self TCPSocket) FinishListen() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketFinishListen((uint32)(self0)) - return -} - -// HopLimit represents the imported method "hop-limit". -// -// hop-limit: func() -// -//go:nosplit -func (self TCPSocket) HopLimit() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketHopLimit((uint32)(self0)) - return -} - -// IsListening represents the imported method "is-listening". -// -// is-listening: func() -// -//go:nosplit -func (self TCPSocket) IsListening() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketIsListening((uint32)(self0)) - return -} - -// KeepAliveCount represents the imported method "keep-alive-count". -// -// keep-alive-count: func() -// -//go:nosplit -func (self TCPSocket) KeepAliveCount() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveCount((uint32)(self0)) - return -} - -// KeepAliveEnabled represents the imported method "keep-alive-enabled". -// -// keep-alive-enabled: func() -// -//go:nosplit -func (self TCPSocket) KeepAliveEnabled() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveEnabled((uint32)(self0)) - return -} - -// KeepAliveIdleTime represents the imported method "keep-alive-idle-time". -// -// keep-alive-idle-time: func() -// -//go:nosplit -func (self TCPSocket) KeepAliveIdleTime() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveIdleTime((uint32)(self0)) - return -} - -// KeepAliveInterval represents the imported method "keep-alive-interval". -// -// keep-alive-interval: func() -// -//go:nosplit -func (self TCPSocket) KeepAliveInterval() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveInterval((uint32)(self0)) - return -} - -// LocalAddress represents the imported method "local-address". -// -// local-address: func() -// -//go:nosplit -func (self TCPSocket) LocalAddress() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketLocalAddress((uint32)(self0)) - return -} - -// ReceiveBufferSize represents the imported method "receive-buffer-size". -// -// receive-buffer-size: func() -// -//go:nosplit -func (self TCPSocket) ReceiveBufferSize() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketReceiveBufferSize((uint32)(self0)) - return -} - -// RemoteAddress represents the imported method "remote-address". -// -// remote-address: func() -// -//go:nosplit -func (self TCPSocket) RemoteAddress() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketRemoteAddress((uint32)(self0)) - return -} - -// SendBufferSize represents the imported method "send-buffer-size". -// -// send-buffer-size: func() -// -//go:nosplit -func (self TCPSocket) SendBufferSize() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketSendBufferSize((uint32)(self0)) - return -} - -// SetHopLimit represents the imported method "set-hop-limit". -// -// set-hop-limit: func(value: u8) -// -//go:nosplit -func (self TCPSocket) SetHopLimit(value uint8) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint32)(value) - wasmimport_TCPSocketSetHopLimit((uint32)(self0), (uint32)(value0)) - return -} - -// SetKeepAliveCount represents the imported method "set-keep-alive-count". -// -// set-keep-alive-count: func(value: u32) -// -//go:nosplit -func (self TCPSocket) SetKeepAliveCount(value uint32) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint32)(value) - wasmimport_TCPSocketSetKeepAliveCount((uint32)(self0), (uint32)(value0)) - return -} - -// SetKeepAliveEnabled represents the imported method "set-keep-alive-enabled". -// -// set-keep-alive-enabled: func(value: bool) -// -//go:nosplit -func (self TCPSocket) SetKeepAliveEnabled(value bool) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint32)(cm.BoolToU32(value)) - wasmimport_TCPSocketSetKeepAliveEnabled((uint32)(self0), (uint32)(value0)) - return -} - -// SetKeepAliveIdleTime represents the imported method "set-keep-alive-idle-time". -// -// set-keep-alive-idle-time: func(value: duration) -// -//go:nosplit -func (self TCPSocket) SetKeepAliveIdleTime(value Duration) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_TCPSocketSetKeepAliveIdleTime((uint32)(self0), (uint64)(value0)) - return -} - -// SetKeepAliveInterval represents the imported method "set-keep-alive-interval". -// -// set-keep-alive-interval: func(value: duration) -// -//go:nosplit -func (self TCPSocket) SetKeepAliveInterval(value Duration) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_TCPSocketSetKeepAliveInterval((uint32)(self0), (uint64)(value0)) - return -} - -// SetListenBacklogSize represents the imported method "set-listen-backlog-size". -// -// set-listen-backlog-size: func(value: u64) -// -//go:nosplit -func (self TCPSocket) SetListenBacklogSize(value uint64) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_TCPSocketSetListenBacklogSize((uint32)(self0), (uint64)(value0)) - return -} - -// SetReceiveBufferSize represents the imported method "set-receive-buffer-size". -// -// set-receive-buffer-size: func(value: u64) -// -//go:nosplit -func (self TCPSocket) SetReceiveBufferSize(value uint64) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_TCPSocketSetReceiveBufferSize((uint32)(self0), (uint64)(value0)) - return -} - -// SetSendBufferSize represents the imported method "set-send-buffer-size". -// -// set-send-buffer-size: func(value: u64) -// -//go:nosplit -func (self TCPSocket) SetSendBufferSize(value uint64) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_TCPSocketSetSendBufferSize((uint32)(self0), (uint64)(value0)) - return -} - -// Shutdown represents the imported method "shutdown". -// -// shutdown: func(shutdown-type: shutdown-type) -// -//go:nosplit -func (self TCPSocket) Shutdown(shutdownType ShutdownType) { - self0 := cm.Reinterpret[uint32](self) - shutdownType0 := (uint32)(shutdownType) - wasmimport_TCPSocketShutdown((uint32)(self0), (uint32)(shutdownType0)) - return -} - -// StartBind represents the imported method "start-bind". -// -// start-bind: func(network: borrow, local-address: ip-socket-address) -// -//go:nosplit -func (self TCPSocket) StartBind(network_ Network, localAddress IPSocketAddress) { - self0 := cm.Reinterpret[uint32](self) - network0 := cm.Reinterpret[uint32](network_) - localAddress0, localAddress1, localAddress2, localAddress3, localAddress4, localAddress5, localAddress6, localAddress7, localAddress8, localAddress9, localAddress10, localAddress11 := lower_IPSocketAddress(localAddress) - wasmimport_TCPSocketStartBind((uint32)(self0), (uint32)(network0), (uint32)(localAddress0), (uint32)(localAddress1), (uint32)(localAddress2), (uint32)(localAddress3), (uint32)(localAddress4), (uint32)(localAddress5), (uint32)(localAddress6), (uint32)(localAddress7), (uint32)(localAddress8), (uint32)(localAddress9), (uint32)(localAddress10), (uint32)(localAddress11)) - return -} - -// StartConnect represents the imported method "start-connect". -// -// start-connect: func(network: borrow, remote-address: ip-socket-address) -// -//go:nosplit -func (self TCPSocket) StartConnect(network_ Network, remoteAddress IPSocketAddress) { - self0 := cm.Reinterpret[uint32](self) - network0 := cm.Reinterpret[uint32](network_) - remoteAddress0, remoteAddress1, remoteAddress2, remoteAddress3, remoteAddress4, remoteAddress5, remoteAddress6, remoteAddress7, remoteAddress8, remoteAddress9, remoteAddress10, remoteAddress11 := lower_IPSocketAddress(remoteAddress) - wasmimport_TCPSocketStartConnect((uint32)(self0), (uint32)(network0), (uint32)(remoteAddress0), (uint32)(remoteAddress1), (uint32)(remoteAddress2), (uint32)(remoteAddress3), (uint32)(remoteAddress4), (uint32)(remoteAddress5), (uint32)(remoteAddress6), (uint32)(remoteAddress7), (uint32)(remoteAddress8), (uint32)(remoteAddress9), (uint32)(remoteAddress10), (uint32)(remoteAddress11)) - return -} - -// StartListen represents the imported method "start-listen". -// -// start-listen: func() -// -//go:nosplit -func (self TCPSocket) StartListen() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketStartListen((uint32)(self0)) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -// -//go:nosplit -func (self TCPSocket) Subscribe() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketSubscribe((uint32)(self0)) - return -} diff --git a/examples/component/http-password-checker/gen/wasi/sockets/udp-create-socket/empty.s b/examples/component/http-password-checker/gen/wasi/sockets/udp-create-socket/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/sockets/udp-create-socket/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go b/examples/component/http-password-checker/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go deleted file mode 100755 index 693307e4..00000000 --- a/examples/component/http-password-checker/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package udpcreatesocket represents the imported interface "wasi:sockets/udp-create-socket@0.2.0". -package udpcreatesocket - -import ( - "http-password-checker/gen/wasi/sockets/network" - "http-password-checker/gen/wasi/sockets/udp" -) - -// Network represents the imported type alias "wasi:sockets/udp-create-socket@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// ErrorCode represents the type alias "wasi:sockets/udp-create-socket@0.2.0#error-code". -// -// See [network.ErrorCode] for more information. -type ErrorCode = network.ErrorCode - -// IPAddressFamily represents the type alias "wasi:sockets/udp-create-socket@0.2.0#ip-address-family". -// -// See [network.IPAddressFamily] for more information. -type IPAddressFamily = network.IPAddressFamily - -// UDPSocket represents the imported type alias "wasi:sockets/udp-create-socket@0.2.0#udp-socket". -// -// See [udp.UDPSocket] for more information. -type UDPSocket = udp.UDPSocket - -// CreateUDPSocket represents the imported function "create-udp-socket". -// -// create-udp-socket: func(address-family: ip-address-family) -// -//go:nosplit -func CreateUDPSocket(addressFamily IPAddressFamily) { - addressFamily0 := (uint32)(addressFamily) - wasmimport_CreateUDPSocket((uint32)(addressFamily0)) - return -} diff --git a/examples/component/http-password-checker/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go b/examples/component/http-password-checker/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go deleted file mode 100755 index dfe49e18..00000000 --- a/examples/component/http-password-checker/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package udpcreatesocket - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/udp-create-socket@0.2.0 create-udp-socket -//go:noescape -func wasmimport_CreateUDPSocket(addressFamily0 uint32) diff --git a/examples/component/http-password-checker/gen/wasi/sockets/udp/abi.go b/examples/component/http-password-checker/gen/wasi/sockets/udp/abi.go deleted file mode 100755 index b1537c04..00000000 --- a/examples/component/http-password-checker/gen/wasi/sockets/udp/abi.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package udp - -import ( - "go.bytecodealliance.org/cm" - "http-password-checker/gen/wasi/sockets/network" -) - -func lower_IPv4Address(v network.IPv4Address) (f0 uint32, f1 uint32, f2 uint32, f3 uint32) { - f0 = (uint32)(v[0]) - f1 = (uint32)(v[1]) - f2 = (uint32)(v[2]) - f3 = (uint32)(v[3]) - return -} - -func lower_IPv4SocketAddress(v network.IPv4SocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32) { - f0 = (uint32)(v.Port) - f1, f2, f3, f4 = lower_IPv4Address(v.Address) - return -} - -func lower_IPv6Address(v network.IPv6Address) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32) { - f0 = (uint32)(v[0]) - f1 = (uint32)(v[1]) - f2 = (uint32)(v[2]) - f3 = (uint32)(v[3]) - f4 = (uint32)(v[4]) - f5 = (uint32)(v[5]) - f6 = (uint32)(v[6]) - f7 = (uint32)(v[7]) - return -} - -func lower_IPv6SocketAddress(v network.IPv6SocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32) { - f0 = (uint32)(v.Port) - f1 = (uint32)(v.FlowInfo) - f2, f3, f4, f5, f6, f7, f8, f9 = lower_IPv6Address(v.Address) - f10 = (uint32)(v.ScopeID) - return -} - -func lower_IPSocketAddress(v network.IPSocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32, f11 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 0: // ipv4 - v1, v2, v3, v4, v5 := lower_IPv4SocketAddress(*cm.Case[network.IPv4SocketAddress](&v, 0)) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 1: // ipv6 - v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11 := lower_IPv6SocketAddress(*cm.Case[network.IPv6SocketAddress](&v, 1)) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - f6 = (uint32)(v6) - f7 = (uint32)(v7) - f8 = (uint32)(v8) - f9 = (uint32)(v9) - f10 = (uint32)(v10) - f11 = (uint32)(v11) - } - return -} - -func lower_OptionIPSocketAddress(v cm.Option[IPSocketAddress]) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32, f11 uint32, f12 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12 := lower_IPSocketAddress(*some) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - f6 = (uint32)(v6) - f7 = (uint32)(v7) - f8 = (uint32)(v8) - f9 = (uint32)(v9) - f10 = (uint32)(v10) - f11 = (uint32)(v11) - f12 = (uint32)(v12) - } - return -} diff --git a/examples/component/http-password-checker/gen/wasi/sockets/udp/empty.s b/examples/component/http-password-checker/gen/wasi/sockets/udp/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasi/sockets/udp/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasi/sockets/udp/udp.wasm.go b/examples/component/http-password-checker/gen/wasi/sockets/udp/udp.wasm.go deleted file mode 100755 index 0b0fd6ba..00000000 --- a/examples/component/http-password-checker/gen/wasi/sockets/udp/udp.wasm.go +++ /dev/null @@ -1,89 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package udp - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/udp@0.2.0 [resource-drop]udp-socket -//go:noescape -func wasmimport_UDPSocketResourceDrop(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.address-family -//go:noescape -func wasmimport_UDPSocketAddressFamily(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.finish-bind -//go:noescape -func wasmimport_UDPSocketFinishBind(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.local-address -//go:noescape -func wasmimport_UDPSocketLocalAddress(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.receive-buffer-size -//go:noescape -func wasmimport_UDPSocketReceiveBufferSize(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.remote-address -//go:noescape -func wasmimport_UDPSocketRemoteAddress(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.send-buffer-size -//go:noescape -func wasmimport_UDPSocketSendBufferSize(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.set-receive-buffer-size -//go:noescape -func wasmimport_UDPSocketSetReceiveBufferSize(self0 uint32, value0 uint64) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.set-send-buffer-size -//go:noescape -func wasmimport_UDPSocketSetSendBufferSize(self0 uint32, value0 uint64) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.set-unicast-hop-limit -//go:noescape -func wasmimport_UDPSocketSetUnicastHopLimit(self0 uint32, value0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.start-bind -//go:noescape -func wasmimport_UDPSocketStartBind(self0 uint32, network0 uint32, localAddress0 uint32, localAddress1 uint32, localAddress2 uint32, localAddress3 uint32, localAddress4 uint32, localAddress5 uint32, localAddress6 uint32, localAddress7 uint32, localAddress8 uint32, localAddress9 uint32, localAddress10 uint32, localAddress11 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.stream -//go:noescape -func wasmimport_UDPSocketStream(self0 uint32, remoteAddress0 uint32, remoteAddress1 uint32, remoteAddress2 uint32, remoteAddress3 uint32, remoteAddress4 uint32, remoteAddress5 uint32, remoteAddress6 uint32, remoteAddress7 uint32, remoteAddress8 uint32, remoteAddress9 uint32, remoteAddress10 uint32, remoteAddress11 uint32, remoteAddress12 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.subscribe -//go:noescape -func wasmimport_UDPSocketSubscribe(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.unicast-hop-limit -//go:noescape -func wasmimport_UDPSocketUnicastHopLimit(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [resource-drop]incoming-datagram-stream -//go:noescape -func wasmimport_IncomingDatagramStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]incoming-datagram-stream.receive -//go:noescape -func wasmimport_IncomingDatagramStreamReceive(self0 uint32, maxResults0 uint64) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]incoming-datagram-stream.subscribe -//go:noescape -func wasmimport_IncomingDatagramStreamSubscribe(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [resource-drop]outgoing-datagram-stream -//go:noescape -func wasmimport_OutgoingDatagramStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]outgoing-datagram-stream.check-send -//go:noescape -func wasmimport_OutgoingDatagramStreamCheckSend(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]outgoing-datagram-stream.send -//go:noescape -func wasmimport_OutgoingDatagramStreamSend(self0 uint32, datagrams0 *OutgoingDatagram, datagrams1 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]outgoing-datagram-stream.subscribe -//go:noescape -func wasmimport_OutgoingDatagramStreamSubscribe(self0 uint32) diff --git a/examples/component/http-password-checker/gen/wasi/sockets/udp/udp.wit.go b/examples/component/http-password-checker/gen/wasi/sockets/udp/udp.wit.go deleted file mode 100755 index 92595d42..00000000 --- a/examples/component/http-password-checker/gen/wasi/sockets/udp/udp.wit.go +++ /dev/null @@ -1,313 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package udp represents the imported interface "wasi:sockets/udp@0.2.0". -package udp - -import ( - "go.bytecodealliance.org/cm" - "http-password-checker/gen/wasi/io/poll" - "http-password-checker/gen/wasi/sockets/network" -) - -// Pollable represents the imported type alias "wasi:sockets/udp@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// Network represents the imported type alias "wasi:sockets/udp@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// ErrorCode represents the type alias "wasi:sockets/udp@0.2.0#error-code". -// -// See [network.ErrorCode] for more information. -type ErrorCode = network.ErrorCode - -// IPSocketAddress represents the type alias "wasi:sockets/udp@0.2.0#ip-socket-address". -// -// See [network.IPSocketAddress] for more information. -type IPSocketAddress = network.IPSocketAddress - -// IPAddressFamily represents the type alias "wasi:sockets/udp@0.2.0#ip-address-family". -// -// See [network.IPAddressFamily] for more information. -type IPAddressFamily = network.IPAddressFamily - -// IncomingDatagram represents the record "wasi:sockets/udp@0.2.0#incoming-datagram". -// -// record incoming-datagram { -// data: list, -// remote-address: ip-socket-address, -// } -type IncomingDatagram struct { - _ cm.HostLayout - Data cm.List[uint8] - RemoteAddress IPSocketAddress -} - -// OutgoingDatagram represents the record "wasi:sockets/udp@0.2.0#outgoing-datagram". -// -// record outgoing-datagram { -// data: list, -// remote-address: option, -// } -type OutgoingDatagram struct { - _ cm.HostLayout - Data cm.List[uint8] - RemoteAddress cm.Option[IPSocketAddress] -} - -// UDPSocket represents the imported resource "wasi:sockets/udp@0.2.0#udp-socket". -// -// resource udp-socket -type UDPSocket cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "udp-socket". -// -// Drops a resource handle. -// -//go:nosplit -func (self UDPSocket) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketResourceDrop((uint32)(self0)) - return -} - -// AddressFamily represents the imported method "address-family". -// -// address-family: func() -// -//go:nosplit -func (self UDPSocket) AddressFamily() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketAddressFamily((uint32)(self0)) - return -} - -// FinishBind represents the imported method "finish-bind". -// -// finish-bind: func() -// -//go:nosplit -func (self UDPSocket) FinishBind() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketFinishBind((uint32)(self0)) - return -} - -// LocalAddress represents the imported method "local-address". -// -// local-address: func() -// -//go:nosplit -func (self UDPSocket) LocalAddress() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketLocalAddress((uint32)(self0)) - return -} - -// ReceiveBufferSize represents the imported method "receive-buffer-size". -// -// receive-buffer-size: func() -// -//go:nosplit -func (self UDPSocket) ReceiveBufferSize() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketReceiveBufferSize((uint32)(self0)) - return -} - -// RemoteAddress represents the imported method "remote-address". -// -// remote-address: func() -// -//go:nosplit -func (self UDPSocket) RemoteAddress() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketRemoteAddress((uint32)(self0)) - return -} - -// SendBufferSize represents the imported method "send-buffer-size". -// -// send-buffer-size: func() -// -//go:nosplit -func (self UDPSocket) SendBufferSize() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketSendBufferSize((uint32)(self0)) - return -} - -// SetReceiveBufferSize represents the imported method "set-receive-buffer-size". -// -// set-receive-buffer-size: func(value: u64) -// -//go:nosplit -func (self UDPSocket) SetReceiveBufferSize(value uint64) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_UDPSocketSetReceiveBufferSize((uint32)(self0), (uint64)(value0)) - return -} - -// SetSendBufferSize represents the imported method "set-send-buffer-size". -// -// set-send-buffer-size: func(value: u64) -// -//go:nosplit -func (self UDPSocket) SetSendBufferSize(value uint64) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_UDPSocketSetSendBufferSize((uint32)(self0), (uint64)(value0)) - return -} - -// SetUnicastHopLimit represents the imported method "set-unicast-hop-limit". -// -// set-unicast-hop-limit: func(value: u8) -// -//go:nosplit -func (self UDPSocket) SetUnicastHopLimit(value uint8) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint32)(value) - wasmimport_UDPSocketSetUnicastHopLimit((uint32)(self0), (uint32)(value0)) - return -} - -// StartBind represents the imported method "start-bind". -// -// start-bind: func(network: borrow, local-address: ip-socket-address) -// -//go:nosplit -func (self UDPSocket) StartBind(network_ Network, localAddress IPSocketAddress) { - self0 := cm.Reinterpret[uint32](self) - network0 := cm.Reinterpret[uint32](network_) - localAddress0, localAddress1, localAddress2, localAddress3, localAddress4, localAddress5, localAddress6, localAddress7, localAddress8, localAddress9, localAddress10, localAddress11 := lower_IPSocketAddress(localAddress) - wasmimport_UDPSocketStartBind((uint32)(self0), (uint32)(network0), (uint32)(localAddress0), (uint32)(localAddress1), (uint32)(localAddress2), (uint32)(localAddress3), (uint32)(localAddress4), (uint32)(localAddress5), (uint32)(localAddress6), (uint32)(localAddress7), (uint32)(localAddress8), (uint32)(localAddress9), (uint32)(localAddress10), (uint32)(localAddress11)) - return -} - -// Stream represents the imported method "stream". -// -// %stream: func(remote-address: option) -// -//go:nosplit -func (self UDPSocket) Stream(remoteAddress cm.Option[IPSocketAddress]) { - self0 := cm.Reinterpret[uint32](self) - remoteAddress0, remoteAddress1, remoteAddress2, remoteAddress3, remoteAddress4, remoteAddress5, remoteAddress6, remoteAddress7, remoteAddress8, remoteAddress9, remoteAddress10, remoteAddress11, remoteAddress12 := lower_OptionIPSocketAddress(remoteAddress) - wasmimport_UDPSocketStream((uint32)(self0), (uint32)(remoteAddress0), (uint32)(remoteAddress1), (uint32)(remoteAddress2), (uint32)(remoteAddress3), (uint32)(remoteAddress4), (uint32)(remoteAddress5), (uint32)(remoteAddress6), (uint32)(remoteAddress7), (uint32)(remoteAddress8), (uint32)(remoteAddress9), (uint32)(remoteAddress10), (uint32)(remoteAddress11), (uint32)(remoteAddress12)) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -// -//go:nosplit -func (self UDPSocket) Subscribe() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketSubscribe((uint32)(self0)) - return -} - -// UnicastHopLimit represents the imported method "unicast-hop-limit". -// -// unicast-hop-limit: func() -// -//go:nosplit -func (self UDPSocket) UnicastHopLimit() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketUnicastHopLimit((uint32)(self0)) - return -} - -// IncomingDatagramStream represents the imported resource "wasi:sockets/udp@0.2.0#incoming-datagram-stream". -// -// resource incoming-datagram-stream -type IncomingDatagramStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "incoming-datagram-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self IncomingDatagramStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingDatagramStreamResourceDrop((uint32)(self0)) - return -} - -// Receive represents the imported method "receive". -// -// receive: func(max-results: u64) -// -//go:nosplit -func (self IncomingDatagramStream) Receive(maxResults uint64) { - self0 := cm.Reinterpret[uint32](self) - maxResults0 := (uint64)(maxResults) - wasmimport_IncomingDatagramStreamReceive((uint32)(self0), (uint64)(maxResults0)) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -// -//go:nosplit -func (self IncomingDatagramStream) Subscribe() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingDatagramStreamSubscribe((uint32)(self0)) - return -} - -// OutgoingDatagramStream represents the imported resource "wasi:sockets/udp@0.2.0#outgoing-datagram-stream". -// -// resource outgoing-datagram-stream -type OutgoingDatagramStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "outgoing-datagram-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self OutgoingDatagramStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingDatagramStreamResourceDrop((uint32)(self0)) - return -} - -// CheckSend represents the imported method "check-send". -// -// check-send: func() -// -//go:nosplit -func (self OutgoingDatagramStream) CheckSend() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingDatagramStreamCheckSend((uint32)(self0)) - return -} - -// Send represents the imported method "send". -// -// send: func(datagrams: list) -// -//go:nosplit -func (self OutgoingDatagramStream) Send(datagrams cm.List[OutgoingDatagram]) { - self0 := cm.Reinterpret[uint32](self) - datagrams0, datagrams1 := cm.LowerList(datagrams) - wasmimport_OutgoingDatagramStreamSend((uint32)(self0), (*OutgoingDatagram)(datagrams0), (uint32)(datagrams1)) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -// -//go:nosplit -func (self OutgoingDatagramStream) Subscribe() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingDatagramStreamSubscribe((uint32)(self0)) - return -} diff --git a/examples/component/http-password-checker/gen/wasmcloud/bus/lattice/empty.s b/examples/component/http-password-checker/gen/wasmcloud/bus/lattice/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasmcloud/bus/lattice/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasmcloud/bus/lattice/lattice.wasm.go b/examples/component/http-password-checker/gen/wasmcloud/bus/lattice/lattice.wasm.go deleted file mode 100755 index 6c044549..00000000 --- a/examples/component/http-password-checker/gen/wasmcloud/bus/lattice/lattice.wasm.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package lattice - -// This file contains wasmimport and wasmexport declarations for "wasmcloud:bus@1.0.0". - -//go:wasmimport wasmcloud:bus/lattice@1.0.0 [resource-drop]call-target-interface -//go:noescape -func wasmimport_CallTargetInterfaceResourceDrop(self0 uint32) - -//go:wasmimport wasmcloud:bus/lattice@1.0.0 [constructor]call-target-interface -//go:noescape -func wasmimport_NewCallTargetInterface(namespace0 *uint8, namespace1 uint32, package0 *uint8, package1 uint32, interface0 *uint8, interface1 uint32) - -//go:wasmimport wasmcloud:bus/lattice@1.0.0 set-link-name -//go:noescape -func wasmimport_SetLinkName(name0 *uint8, name1 uint32, interfaces0 *CallTargetInterface, interfaces1 uint32) diff --git a/examples/component/http-password-checker/gen/wasmcloud/bus/lattice/lattice.wit.go b/examples/component/http-password-checker/gen/wasmcloud/bus/lattice/lattice.wit.go deleted file mode 100755 index af5d44b6..00000000 --- a/examples/component/http-password-checker/gen/wasmcloud/bus/lattice/lattice.wit.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package lattice represents the imported interface "wasmcloud:bus/lattice@1.0.0". -package lattice - -import ( - "go.bytecodealliance.org/cm" -) - -// CallTargetInterface represents the imported resource "wasmcloud:bus/lattice@1.0.0#call-target-interface". -// -// resource call-target-interface -type CallTargetInterface cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "call-target-interface". -// -// Drops a resource handle. -// -//go:nosplit -func (self CallTargetInterface) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_CallTargetInterfaceResourceDrop((uint32)(self0)) - return -} - -// NewCallTargetInterface represents the imported constructor for resource "call-target-interface". -// -// constructor(namespace: string, %package: string, %interface: string) -// -//go:nosplit -func NewCallTargetInterface(namespace string, package_ string, interface_ string) { - namespace0, namespace1 := cm.LowerString(namespace) - package0, package1 := cm.LowerString(package_) - interface0, interface1 := cm.LowerString(interface_) - wasmimport_NewCallTargetInterface((*uint8)(namespace0), (uint32)(namespace1), (*uint8)(package0), (uint32)(package1), (*uint8)(interface0), (uint32)(interface1)) - return -} - -// SetLinkName represents the imported function "set-link-name". -// -// set-link-name: func(name: string, interfaces: list) -// -//go:nosplit -func SetLinkName(name string, interfaces cm.List[CallTargetInterface]) { - name0, name1 := cm.LowerString(name) - interfaces0, interfaces1 := cm.LowerList(interfaces) - wasmimport_SetLinkName((*uint8)(name0), (uint32)(name1), (*CallTargetInterface)(interfaces0), (uint32)(interfaces1)) - return -} diff --git a/examples/component/http-password-checker/gen/wasmcloud/password-checker/password-checker/password-checker.wit.go b/examples/component/http-password-checker/gen/wasmcloud/password-checker/password-checker/password-checker.wit.go deleted file mode 100755 index d02d4608..00000000 --- a/examples/component/http-password-checker/gen/wasmcloud/password-checker/password-checker/password-checker.wit.go +++ /dev/null @@ -1,4 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package passwordchecker represents the world "wasmcloud:password-checker/password-checker". -package passwordchecker diff --git a/examples/component/http-password-checker/gen/wasmcloud/secrets/reveal/empty.s b/examples/component/http-password-checker/gen/wasmcloud/secrets/reveal/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasmcloud/secrets/reveal/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasmcloud/secrets/reveal/reveal.wasm.go b/examples/component/http-password-checker/gen/wasmcloud/secrets/reveal/reveal.wasm.go deleted file mode 100755 index a6d83174..00000000 --- a/examples/component/http-password-checker/gen/wasmcloud/secrets/reveal/reveal.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package reveal - -// This file contains wasmimport and wasmexport declarations for "wasmcloud:secrets@0.1.0-draft". - -//go:wasmimport wasmcloud:secrets/reveal@0.1.0-draft reveal -//go:noescape -func wasmimport_Reveal(s0 uint32) diff --git a/examples/component/http-password-checker/gen/wasmcloud/secrets/reveal/reveal.wit.go b/examples/component/http-password-checker/gen/wasmcloud/secrets/reveal/reveal.wit.go deleted file mode 100755 index 419f0e1c..00000000 --- a/examples/component/http-password-checker/gen/wasmcloud/secrets/reveal/reveal.wit.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package reveal represents the imported interface "wasmcloud:secrets/reveal@0.1.0-draft". -package reveal - -import ( - "go.bytecodealliance.org/cm" - "http-password-checker/gen/wasmcloud/secrets/store" -) - -// Secret represents the imported type alias "wasmcloud:secrets/reveal@0.1.0-draft#secret". -// -// See [store.Secret] for more information. -type Secret = store.Secret - -// SecretValue represents the type alias "wasmcloud:secrets/reveal@0.1.0-draft#secret-value". -// -// See [store.SecretValue] for more information. -type SecretValue = store.SecretValue - -// Reveal represents the imported function "reveal". -// -// reveal: func(s: borrow) -// -//go:nosplit -func Reveal(s Secret) { - s0 := cm.Reinterpret[uint32](s) - wasmimport_Reveal((uint32)(s0)) - return -} diff --git a/examples/component/http-password-checker/gen/wasmcloud/secrets/store/abi.go b/examples/component/http-password-checker/gen/wasmcloud/secrets/store/abi.go deleted file mode 100755 index 20affd6c..00000000 --- a/examples/component/http-password-checker/gen/wasmcloud/secrets/store/abi.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package store - -import ( - "go.bytecodealliance.org/cm" - "unsafe" -) - -// SecretsErrorShape is used for storage in variant or result types. -type SecretsErrorShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(SecretsError{})]byte -} diff --git a/examples/component/http-password-checker/gen/wasmcloud/secrets/store/empty.s b/examples/component/http-password-checker/gen/wasmcloud/secrets/store/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-password-checker/gen/wasmcloud/secrets/store/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-password-checker/gen/wasmcloud/secrets/store/store.wasm.go b/examples/component/http-password-checker/gen/wasmcloud/secrets/store/store.wasm.go deleted file mode 100755 index 4ef43490..00000000 --- a/examples/component/http-password-checker/gen/wasmcloud/secrets/store/store.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package store - -// This file contains wasmimport and wasmexport declarations for "wasmcloud:secrets@0.1.0-draft". - -//go:wasmimport wasmcloud:secrets/store@0.1.0-draft [resource-drop]secret -//go:noescape -func wasmimport_SecretResourceDrop(self0 uint32) - -//go:wasmimport wasmcloud:secrets/store@0.1.0-draft get -//go:noescape -func wasmimport_Get(key0 *uint8, key1 uint32) diff --git a/examples/component/http-password-checker/gen/wasmcloud/secrets/store/store.wit.go b/examples/component/http-password-checker/gen/wasmcloud/secrets/store/store.wit.go deleted file mode 100755 index 405555fa..00000000 --- a/examples/component/http-password-checker/gen/wasmcloud/secrets/store/store.wit.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package store represents the imported interface "wasmcloud:secrets/store@0.1.0-draft". -package store - -import ( - "go.bytecodealliance.org/cm" -) - -// SecretsError represents the variant "wasmcloud:secrets/store@0.1.0-draft#secrets-error". -// -// variant secrets-error { -// upstream(string), -// io(string), -// not-found, -// } -type SecretsError cm.Variant[uint8, string, string] - -// SecretsErrorUpstream returns a [SecretsError] of case "upstream". -func SecretsErrorUpstream(data string) SecretsError { - return cm.New[SecretsError](0, data) -} - -// Upstream returns a non-nil *[string] if [SecretsError] represents the variant case "upstream". -func (self *SecretsError) Upstream() *string { - return cm.Case[string](self, 0) -} - -// SecretsErrorIO returns a [SecretsError] of case "io". -func SecretsErrorIO(data string) SecretsError { - return cm.New[SecretsError](1, data) -} - -// IO returns a non-nil *[string] if [SecretsError] represents the variant case "io". -func (self *SecretsError) IO() *string { - return cm.Case[string](self, 1) -} - -// SecretsErrorNotFound returns a [SecretsError] of case "not-found". -func SecretsErrorNotFound() SecretsError { - var data struct{} - return cm.New[SecretsError](2, data) -} - -// NotFound returns true if [SecretsError] represents the variant case "not-found". -func (self *SecretsError) NotFound() bool { - return self.Tag() == 2 -} - -var stringsSecretsError = [3]string{ - "upstream", - "io", - "not-found", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v SecretsError) String() string { - return stringsSecretsError[v.Tag()] -} - -// SecretValue represents the variant "wasmcloud:secrets/store@0.1.0-draft#secret-value". -// -// variant secret-value { -// %string(string), -// bytes(list), -// } -type SecretValue cm.Variant[uint8, string, cm.List[uint8]] - -// SecretValueString_ returns a [SecretValue] of case "string". -func SecretValueString_(data string) SecretValue { - return cm.New[SecretValue](0, data) -} - -// String_ returns a non-nil *[string] if [SecretValue] represents the variant case "string". -func (self *SecretValue) String_() *string { - return cm.Case[string](self, 0) -} - -// SecretValueBytes returns a [SecretValue] of case "bytes". -func SecretValueBytes(data cm.List[uint8]) SecretValue { - return cm.New[SecretValue](1, data) -} - -// Bytes returns a non-nil *[cm.List[uint8]] if [SecretValue] represents the variant case "bytes". -func (self *SecretValue) Bytes() *cm.List[uint8] { - return cm.Case[cm.List[uint8]](self, 1) -} - -var stringsSecretValue = [2]string{ - "string", - "bytes", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v SecretValue) String() string { - return stringsSecretValue[v.Tag()] -} - -// Secret represents the imported resource "wasmcloud:secrets/store@0.1.0-draft#secret". -// -// resource secret -type Secret cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "secret". -// -// Drops a resource handle. -// -//go:nosplit -func (self Secret) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_SecretResourceDrop((uint32)(self0)) - return -} - -// Get represents the imported function "get". -// -// get: func(key: string) -// -//go:nosplit -func Get(key string) { - key0, key1 := cm.LowerString(key) - wasmimport_Get((*uint8)(key0), (uint32)(key1)) - return -} diff --git a/examples/component/http-server/.gitignore b/examples/component/http-server/.gitignore index e69de29b..eaec1317 100644 --- a/examples/component/http-server/.gitignore +++ b/examples/component/http-server/.gitignore @@ -0,0 +1,2 @@ +gen/* +build/* \ No newline at end of file diff --git a/examples/component/http-server/gen/example/http-server/example/example.wit b/examples/component/http-server/gen/example/http-server/example/example.wit deleted file mode 100755 index a41117b5..00000000 --- a/examples/component/http-server/gen/example/http-server/example/example.wit +++ /dev/null @@ -1,1132 +0,0 @@ -package example:http-server; - -world example { - import wasi:logging/logging@0.1.0-draft; - import wasi:config/runtime@0.2.0-draft; - import wasi:io/poll@0.2.0; - import wasi:clocks/monotonic-clock@0.2.0; - import wasi:io/error@0.2.0; - import wasi:io/streams@0.2.0; - import wasi:http/types@0.2.0; - import wasi:http/outgoing-handler@0.2.0; - import wasmcloud:bus/lattice@1.0.0; - import wasmcloud:secrets/store@0.1.0-draft; - import wasmcloud:secrets/reveal@0.1.0-draft; - import wasi:cli/environment@0.2.0; - import wasi:cli/exit@0.2.0; - import wasi:cli/stdin@0.2.0; - import wasi:cli/stdout@0.2.0; - import wasi:cli/stderr@0.2.0; - import wasi:cli/terminal-input@0.2.0; - import wasi:cli/terminal-output@0.2.0; - import wasi:cli/terminal-stdin@0.2.0; - import wasi:cli/terminal-stdout@0.2.0; - import wasi:cli/terminal-stderr@0.2.0; - import wasi:clocks/wall-clock@0.2.0; - import wasi:filesystem/types@0.2.0; - import wasi:filesystem/preopens@0.2.0; - import wasi:sockets/network@0.2.0; - import wasi:sockets/instance-network@0.2.0; - import wasi:sockets/udp@0.2.0; - import wasi:sockets/udp-create-socket@0.2.0; - import wasi:sockets/tcp@0.2.0; - import wasi:sockets/tcp-create-socket@0.2.0; - import wasi:sockets/ip-name-lookup@0.2.0; - import wasi:random/random@0.2.0; - import wasi:random/insecure@0.2.0; - import wasi:random/insecure-seed@0.2.0; - export wasi:http/incoming-handler@0.2.0; -} - -package wasi:cli@0.2.0 { - interface stdout { - use wasi:io/streams@0.2.0.{output-stream}; - get-stdout: func() -> output-stream; - } - - interface stderr { - use wasi:io/streams@0.2.0.{output-stream}; - get-stderr: func() -> output-stream; - } - - interface stdin { - use wasi:io/streams@0.2.0.{input-stream}; - get-stdin: func() -> input-stream; - } - - interface environment { - get-environment: func() -> list>; - get-arguments: func() -> list; - initial-cwd: func() -> option; - } - - interface exit { - exit: func(status: result); - } - - interface terminal-input { - resource terminal-input; - } - - interface terminal-output { - resource terminal-output; - } - - interface terminal-stdin { - use terminal-input.{terminal-input}; - get-terminal-stdin: func() -> option; - } - - interface terminal-stdout { - use terminal-output.{terminal-output}; - get-terminal-stdout: func() -> option; - } - - interface terminal-stderr { - use terminal-output.{terminal-output}; - get-terminal-stderr: func() -> option; - } -} - -package wasi:clocks@0.2.0 { - interface monotonic-clock { - use wasi:io/poll@0.2.0.{pollable}; - type instant = u64; - type duration = u64; - now: func() -> instant; - resolution: func() -> duration; - subscribe-instant: func(when: instant) -> pollable; - subscribe-duration: func(when: duration) -> pollable; - } - - interface wall-clock { - record datetime { - seconds: u64, - nanoseconds: u32, - } - now: func() -> datetime; - resolution: func() -> datetime; - } -} - -package wasi:config@0.2.0-draft { - interface runtime { - variant config-error { - upstream(string), - io(string), - } - get: func(key: string) -> result, config-error>; - get-all: func() -> result>, config-error>; - } -} - -package wasi:filesystem@0.2.0 { - interface types { - use wasi:io/streams@0.2.0.{input-stream}; - use wasi:io/streams@0.2.0.{output-stream}; - use wasi:io/streams@0.2.0.{error}; - use wasi:clocks/wall-clock@0.2.0.{datetime}; - type filesize = u64; - enum descriptor-type { - unknown, - block-device, - character-device, - directory, - fifo, - symbolic-link, - regular-file, - socket - } - flags descriptor-flags { - read, - write, - file-integrity-sync, - data-integrity-sync, - requested-write-sync, - mutate-directory, - } - flags path-flags { symlink-follow } - flags open-flags { - create, - directory, - exclusive, - truncate, - } - type link-count = u64; - record descriptor-stat { - %type: descriptor-type, - link-count: link-count, - size: filesize, - data-access-timestamp: option, - data-modification-timestamp: option, - status-change-timestamp: option, - } - variant new-timestamp { - no-change, - now, - timestamp(datetime), - } - record directory-entry { - %type: descriptor-type, - name: string, - } - enum error-code { - access, - would-block, - already, - bad-descriptor, - busy, - deadlock, - quota, - exist, - file-too-large, - illegal-byte-sequence, - in-progress, - interrupted, - invalid, - io, - is-directory, - loop, - too-many-links, - message-size, - name-too-long, - no-device, - no-entry, - no-lock, - insufficient-memory, - insufficient-space, - not-directory, - not-empty, - not-recoverable, - unsupported, - no-tty, - no-such-device, - overflow, - not-permitted, - pipe, - read-only, - invalid-seek, - text-file-busy, - cross-device - } - enum advice { - normal, - sequential, - random, - will-need, - dont-need, - no-reuse - } - record metadata-hash-value { - lower: u64, - upper: u64, - } - resource descriptor { - advise: func(offset: filesize, length: filesize, advice: advice) -> result<_, error-code>; - append-via-stream: func() -> result; - create-directory-at: func(path: string) -> result<_, error-code>; - get-flags: func() -> result; - get-type: func() -> result; - is-same-object: func(other: borrow) -> bool; - link-at: func(old-path-flags: path-flags, old-path: string, new-descriptor: borrow, new-path: string) -> result<_, error-code>; - metadata-hash: func() -> result; - metadata-hash-at: func(path-flags: path-flags, path: string) -> result; - open-at: func(path-flags: path-flags, path: string, open-flags: open-flags, %flags: descriptor-flags) -> result; - read: func(length: filesize, offset: filesize) -> result, bool>, error-code>; - read-directory: func() -> result; - read-via-stream: func(offset: filesize) -> result; - readlink-at: func(path: string) -> result; - remove-directory-at: func(path: string) -> result<_, error-code>; - rename-at: func(old-path: string, new-descriptor: borrow, new-path: string) -> result<_, error-code>; - set-size: func(size: filesize) -> result<_, error-code>; - set-times: func(data-access-timestamp: new-timestamp, data-modification-timestamp: new-timestamp) -> result<_, error-code>; - set-times-at: func(path-flags: path-flags, path: string, data-access-timestamp: new-timestamp, data-modification-timestamp: new-timestamp) -> result<_, error-code>; - stat: func() -> result; - stat-at: func(path-flags: path-flags, path: string) -> result; - symlink-at: func(old-path: string, new-path: string) -> result<_, error-code>; - sync: func() -> result<_, error-code>; - sync-data: func() -> result<_, error-code>; - unlink-file-at: func(path: string) -> result<_, error-code>; - write: func(buffer: list, offset: filesize) -> result; - write-via-stream: func(offset: filesize) -> result; - } - resource directory-entry-stream { - read-directory-entry: func() -> result, error-code>; - } - filesystem-error-code: func(err: borrow) -> option; - } - - interface preopens { - use types.{descriptor}; - get-directories: func() -> list>; - } -} - -package wasi:http@0.2.0 { - /// This interface defines all of the types and methods for implementing - /// HTTP Requests and Responses, both incoming and outgoing, as well as - /// their headers, trailers, and bodies. - interface types { - use wasi:clocks/monotonic-clock@0.2.0.{duration}; - use wasi:io/streams@0.2.0.{input-stream}; - use wasi:io/streams@0.2.0.{output-stream}; - use wasi:io/error@0.2.0.{error as io-error}; - use wasi:io/poll@0.2.0.{pollable}; - - /// This type corresponds to HTTP standard Methods. - variant method { - get, - head, - post, - put, - delete, - connect, - options, - trace, - patch, - other(string), - } - - /// This type corresponds to HTTP standard Related Schemes. - variant scheme { HTTP, HTTPS, other(string) } - - /// Defines the case payload type for `DNS-error` above: - record DNS-error-payload { - rcode: option, - info-code: option, - } - - /// Defines the case payload type for `TLS-alert-received` above: - record TLS-alert-received-payload { - alert-id: option, - alert-message: option, - } - - /// Defines the case payload type for `HTTP-response-{header,trailer}-size` above: - record field-size-payload { - field-name: option, - field-size: option, - } - - /// These cases are inspired by the IANA HTTP Proxy Error Types: - /// https://www.iana.org/assignments/http-proxy-status/http-proxy-status.xhtml#table-http-proxy-error-types - variant error-code { - DNS-timeout, - DNS-error(DNS-error-payload), - destination-not-found, - destination-unavailable, - destination-IP-prohibited, - destination-IP-unroutable, - connection-refused, - connection-terminated, - connection-timeout, - connection-read-timeout, - connection-write-timeout, - connection-limit-reached, - TLS-protocol-error, - TLS-certificate-error, - TLS-alert-received(TLS-alert-received-payload), - HTTP-request-denied, - HTTP-request-length-required, - HTTP-request-body-size(option), - HTTP-request-method-invalid, - HTTP-request-URI-invalid, - HTTP-request-URI-too-long, - HTTP-request-header-section-size(option), - HTTP-request-header-size(option), - HTTP-request-trailer-section-size(option), - HTTP-request-trailer-size(field-size-payload), - HTTP-response-incomplete, - HTTP-response-header-section-size(option), - HTTP-response-header-size(field-size-payload), - HTTP-response-body-size(option), - HTTP-response-trailer-section-size(option), - HTTP-response-trailer-size(field-size-payload), - HTTP-response-transfer-coding(option), - HTTP-response-content-coding(option), - HTTP-response-timeout, - HTTP-upgrade-failed, - HTTP-protocol-error, - loop-detected, - configuration-error, - /// This is a catch-all error for anything that doesn't fit cleanly into a - /// more specific case. It also includes an optional string for an - /// unstructured description of the error. Users should not depend on the - /// string for diagnosing errors, as it's not required to be consistent - /// between implementations. - internal-error(option), - } - - /// This type enumerates the different kinds of errors that may occur when - /// setting or appending to a `fields` resource. - variant header-error { - /// This error indicates that a `field-key` or `field-value` was - /// syntactically invalid when used with an operation that sets headers in a - /// `fields`. - invalid-syntax, - /// This error indicates that a forbidden `field-key` was used when trying - /// to set a header in a `fields`. - forbidden, - /// This error indicates that the operation on the `fields` was not - /// permitted because the fields are immutable. - immutable, - } - - /// Field keys are always strings. - type field-key = string; - - /// Field values should always be ASCII strings. However, in - /// reality, HTTP implementations often have to interpret malformed values, - /// so they are provided as a list of bytes. - type field-value = list; - - /// This following block defines the `fields` resource which corresponds to - /// HTTP standard Fields. Fields are a common representation used for both - /// Headers and Trailers. - /// - /// A `fields` may be mutable or immutable. A `fields` created using the - /// constructor, `from-list`, or `clone` will be mutable, but a `fields` - /// resource given by other means (including, but not limited to, - /// `incoming-request.headers`, `outgoing-request.headers`) might be be - /// immutable. In an immutable fields, the `set`, `append`, and `delete` - /// operations will fail with `header-error.immutable`. - resource fields { - /// Construct an empty HTTP Fields. - /// - /// The resulting `fields` is mutable. - constructor(); - - /// Append a value for a key. Does not change or delete any existing - /// values for that key. - /// - /// Fails with `header-error.immutable` if the `fields` are immutable. - append: func(name: field-key, value: field-value) -> result<_, header-error>; - - /// Make a deep copy of the Fields. Equivelant in behavior to calling the - /// `fields` constructor on the return value of `entries`. The resulting - /// `fields` is mutable. - clone: func() -> fields; - - /// Delete all values for a key. Does nothing if no values for the key - /// exist. - /// - /// Fails with `header-error.immutable` if the `fields` are immutable. - delete: func(name: field-key) -> result<_, header-error>; - - /// Retrieve the full set of keys and values in the Fields. Like the - /// constructor, the list represents each key-value pair. - /// - /// The outer list represents each key-value pair in the Fields. Keys - /// which have multiple values are represented by multiple entries in this - /// list with the same key. - entries: func() -> list>; - - /// Get all of the values corresponding to a key. If the key is not present - /// in this `fields`, an empty list is returned. However, if the key is - /// present but empty, this is represented by a list with one or more - /// empty field-values present. - get: func(name: field-key) -> list; - - /// Returns `true` when the key is present in this `fields`. If the key is - /// syntactically invalid, `false` is returned. - has: func(name: field-key) -> bool; - - /// Set all of the values for a key. Clears any existing values for that - /// key, if they have been set. - /// - /// Fails with `header-error.immutable` if the `fields` are immutable. - set: func(name: field-key, value: list) -> result<_, header-error>; - - /// Construct an HTTP Fields. - /// - /// The resulting `fields` is mutable. - /// - /// The list represents each key-value pair in the Fields. Keys - /// which have multiple values are represented by multiple entries in this - /// list with the same key. - /// - /// The tuple is a pair of the field key, represented as a string, and - /// Value, represented as a list of bytes. In a valid Fields, all keys - /// and values are valid UTF-8 strings. However, values are not always - /// well-formed, so they are represented as a raw list of bytes. - /// - /// An error result will be returned if any header or value was - /// syntactically invalid, or if a header was forbidden. - from-list: static func(entries: list>) -> result; - } - - /// Headers is an alias for Fields. - type headers = fields; - - /// Trailers is an alias for Fields. - type trailers = fields; - - /// Represents an incoming HTTP Request. - resource incoming-request { - - /// Returns the authority from the request, if it was present. - authority: func() -> option; - - /// Gives the `incoming-body` associated with this request. Will only - /// return success at most once, and subsequent calls will return error. - consume: func() -> result; - - /// Get the `headers` associated with the request. - /// - /// The returned `headers` resource is immutable: `set`, `append`, and - /// `delete` operations will fail with `header-error.immutable`. - /// - /// The `headers` returned are a child resource: it must be dropped before - /// the parent `incoming-request` is dropped. Dropping this - /// `incoming-request` before all children are dropped will trap. - headers: func() -> headers; - - /// Returns the method of the incoming request. - method: func() -> method; - - /// Returns the path with query parameters from the request, as a string. - path-with-query: func() -> option; - - /// Returns the protocol scheme from the request. - scheme: func() -> option; - } - - /// Represents an outgoing HTTP Request. - resource outgoing-request { - /// Construct a new `outgoing-request` with a default `method` of `GET`, and - /// `none` values for `path-with-query`, `scheme`, and `authority`. - /// - /// * `headers` is the HTTP Headers for the Request. - /// - /// It is possible to construct, or manipulate with the accessor functions - /// below, an `outgoing-request` with an invalid combination of `scheme` - /// and `authority`, or `headers` which are not permitted to be sent. - /// It is the obligation of the `outgoing-handler.handle` implementation - /// to reject invalid constructions of `outgoing-request`. - constructor(headers: headers); - - /// Get the HTTP Authority for the Request. A value of `none` may be used - /// with Related Schemes which do not require an Authority. The HTTP and - /// HTTPS schemes always require an authority. - authority: func() -> option; - - /// Returns the resource corresponding to the outgoing Body for this - /// Request. - /// - /// Returns success on the first call: the `outgoing-body` resource for - /// this `outgoing-request` can be retrieved at most once. Subsequent - /// calls will return error. - body: func() -> result; - - /// Get the headers associated with the Request. - /// - /// The returned `headers` resource is immutable: `set`, `append`, and - /// `delete` operations will fail with `header-error.immutable`. - /// - /// This headers resource is a child: it must be dropped before the parent - /// `outgoing-request` is dropped, or its ownership is transfered to - /// another component by e.g. `outgoing-handler.handle`. - headers: func() -> headers; - - /// Get the Method for the Request. - method: func() -> method; - - /// Get the combination of the HTTP Path and Query for the Request. - /// When `none`, this represents an empty Path and empty Query. - path-with-query: func() -> option; - - /// Get the HTTP Related Scheme for the Request. When `none`, the - /// implementation may choose an appropriate default scheme. - scheme: func() -> option; - - /// Set the HTTP Authority for the Request. A value of `none` may be used - /// with Related Schemes which do not require an Authority. The HTTP and - /// HTTPS schemes always require an authority. Fails if the string given is - /// not a syntactically valid uri authority. - set-authority: func(authority: option) -> result; - - /// Set the Method for the Request. Fails if the string present in a - /// `method.other` argument is not a syntactically valid method. - set-method: func(method: method) -> result; - - /// Set the combination of the HTTP Path and Query for the Request. - /// When `none`, this represents an empty Path and empty Query. Fails is the - /// string given is not a syntactically valid path and query uri component. - set-path-with-query: func(path-with-query: option) -> result; - - /// Set the HTTP Related Scheme for the Request. When `none`, the - /// implementation may choose an appropriate default scheme. Fails if the - /// string given is not a syntactically valid uri scheme. - set-scheme: func(scheme: option) -> result; - } - - /// Parameters for making an HTTP Request. Each of these parameters is - /// currently an optional timeout applicable to the transport layer of the - /// HTTP protocol. - /// - /// These timeouts are separate from any the user may use to bound a - /// blocking call to `wasi:io/poll.poll`. - resource request-options { - /// Construct a default `request-options` value. - constructor(); - - /// The timeout for receiving subsequent chunks of bytes in the Response - /// body stream. - between-bytes-timeout: func() -> option; - - /// The timeout for the initial connect to the HTTP Server. - connect-timeout: func() -> option; - - /// The timeout for receiving the first byte of the Response body. - first-byte-timeout: func() -> option; - - /// Set the timeout for receiving subsequent chunks of bytes in the Response - /// body stream. An error return value indicates that this timeout is not - /// supported. - set-between-bytes-timeout: func(duration: option) -> result; - - /// Set the timeout for the initial connect to the HTTP Server. An error - /// return value indicates that this timeout is not supported. - set-connect-timeout: func(duration: option) -> result; - - /// Set the timeout for receiving the first byte of the Response body. An - /// error return value indicates that this timeout is not supported. - set-first-byte-timeout: func(duration: option) -> result; - } - - /// Represents the ability to send an HTTP Response. - /// - /// This resource is used by the `wasi:http/incoming-handler` interface to - /// allow a Response to be sent corresponding to the Request provided as the - /// other argument to `incoming-handler.handle`. - resource response-outparam { - - /// Set the value of the `response-outparam` to either send a response, - /// or indicate an error. - /// - /// This method consumes the `response-outparam` to ensure that it is - /// called at most once. If it is never called, the implementation - /// will respond with an error. - /// - /// The user may provide an `error` to `response` to allow the - /// implementation determine how to respond with an HTTP error response. - set: static func(param: response-outparam, response: result); - } - - /// This type corresponds to the HTTP standard Status Code. - type status-code = u16; - - /// Represents an incoming HTTP Response. - resource incoming-response { - - /// Returns the incoming body. May be called at most once. Returns error - /// if called additional times. - consume: func() -> result; - - /// Returns the headers from the incoming response. - /// - /// The returned `headers` resource is immutable: `set`, `append`, and - /// `delete` operations will fail with `header-error.immutable`. - /// - /// This headers resource is a child: it must be dropped before the parent - /// `incoming-response` is dropped. - headers: func() -> headers; - - /// Returns the status code from the incoming response. - status: func() -> status-code; - } - - /// Represents an incoming HTTP Request or Response's Body. - /// - /// A body has both its contents - a stream of bytes - and a (possibly - /// empty) set of trailers, indicating that the full contents of the - /// body have been received. This resource represents the contents as - /// an `input-stream` and the delivery of trailers as a `future-trailers`, - /// and ensures that the user of this interface may only be consuming either - /// the body contents or waiting on trailers at any given time. - resource incoming-body { - - /// Returns the contents of the body, as a stream of bytes. - /// - /// Returns success on first call: the stream representing the contents - /// can be retrieved at most once. Subsequent calls will return error. - /// - /// The returned `input-stream` resource is a child: it must be dropped - /// before the parent `incoming-body` is dropped, or consumed by - /// `incoming-body.finish`. - /// - /// This invariant ensures that the implementation can determine whether - /// the user is consuming the contents of the body, waiting on the - /// `future-trailers` to be ready, or neither. This allows for network - /// backpressure is to be applied when the user is consuming the body, - /// and for that backpressure to not inhibit delivery of the trailers if - /// the user does not read the entire body. - %stream: func() -> result; - - /// Takes ownership of `incoming-body`, and returns a `future-trailers`. - /// This function will trap if the `input-stream` child is still alive. - finish: static func(this: incoming-body) -> future-trailers; - } - - /// Represents a future which may eventaully return trailers, or an error. - /// - /// In the case that the incoming HTTP Request or Response did not have any - /// trailers, this future will resolve to the empty set of trailers once the - /// complete Request or Response body has been received. - resource future-trailers { - - /// Returns the contents of the trailers, or an error which occured, - /// once the future is ready. - /// - /// The outer `option` represents future readiness. Users can wait on this - /// `option` to become `some` using the `subscribe` method. - /// - /// The outer `result` is used to retrieve the trailers or error at most - /// once. It will be success on the first call in which the outer option - /// is `some`, and error on subsequent calls. - /// - /// The inner `result` represents that either the HTTP Request or Response - /// body, as well as any trailers, were received successfully, or that an - /// error occured receiving them. The optional `trailers` indicates whether - /// or not trailers were present in the body. - /// - /// When some `trailers` are returned by this method, the `trailers` - /// resource is immutable, and a child. Use of the `set`, `append`, or - /// `delete` methods will return an error, and the resource must be - /// dropped before the parent `future-trailers` is dropped. - get: func() -> option, error-code>>>; - - /// Returns a pollable which becomes ready when either the trailers have - /// been received, or an error has occured. When this pollable is ready, - /// the `get` method will return `some`. - subscribe: func() -> pollable; - } - - /// Represents an outgoing HTTP Response. - resource outgoing-response { - /// Construct an `outgoing-response`, with a default `status-code` of `200`. - /// If a different `status-code` is needed, it must be set via the - /// `set-status-code` method. - /// - /// * `headers` is the HTTP Headers for the Response. - constructor(headers: headers); - - /// Returns the resource corresponding to the outgoing Body for this Response. - /// - /// Returns success on the first call: the `outgoing-body` resource for - /// this `outgoing-response` can be retrieved at most once. Subsequent - /// calls will return error. - body: func() -> result; - - /// Get the headers associated with the Request. - /// - /// The returned `headers` resource is immutable: `set`, `append`, and - /// `delete` operations will fail with `header-error.immutable`. - /// - /// This headers resource is a child: it must be dropped before the parent - /// `outgoing-request` is dropped, or its ownership is transfered to - /// another component by e.g. `outgoing-handler.handle`. - headers: func() -> headers; - - /// Set the HTTP Status Code for the Response. Fails if the status-code - /// given is not a valid http status code. - set-status-code: func(status-code: status-code) -> result; - - /// Get the HTTP Status Code for the Response. - status-code: func() -> status-code; - } - - /// Represents an outgoing HTTP Request or Response's Body. - /// - /// A body has both its contents - a stream of bytes - and a (possibly - /// empty) set of trailers, inducating the full contents of the body - /// have been sent. This resource represents the contents as an - /// `output-stream` child resource, and the completion of the body (with - /// optional trailers) with a static function that consumes the - /// `outgoing-body` resource, and ensures that the user of this interface - /// may not write to the body contents after the body has been finished. - /// - /// If the user code drops this resource, as opposed to calling the static - /// method `finish`, the implementation should treat the body as incomplete, - /// and that an error has occured. The implementation should propogate this - /// error to the HTTP protocol by whatever means it has available, - /// including: corrupting the body on the wire, aborting the associated - /// Request, or sending a late status code for the Response. - resource outgoing-body { - - /// Returns a stream for writing the body contents. - /// - /// The returned `output-stream` is a child resource: it must be dropped - /// before the parent `outgoing-body` resource is dropped (or finished), - /// otherwise the `outgoing-body` drop or `finish` will trap. - /// - /// Returns success on the first call: the `output-stream` resource for - /// this `outgoing-body` may be retrieved at most once. Subsequent calls - /// will return error. - write: func() -> result; - - /// Finalize an outgoing body, optionally providing trailers. This must be - /// called to signal that the response is complete. If the `outgoing-body` - /// is dropped without calling `outgoing-body.finalize`, the implementation - /// should treat the body as corrupted. - /// - /// Fails if the body's `outgoing-request` or `outgoing-response` was - /// constructed with a Content-Length header, and the contents written - /// to the body (via `write`) does not match the value given in the - /// Content-Length. - finish: static func(this: outgoing-body, trailers: option) -> result<_, error-code>; - } - - /// Represents a future which may eventaully return an incoming HTTP - /// Response, or an error. - /// - /// This resource is returned by the `wasi:http/outgoing-handler` interface to - /// provide the HTTP Response corresponding to the sent Request. - resource future-incoming-response { - - /// Returns the incoming HTTP Response, or an error, once one is ready. - /// - /// The outer `option` represents future readiness. Users can wait on this - /// `option` to become `some` using the `subscribe` method. - /// - /// The outer `result` is used to retrieve the response or error at most - /// once. It will be success on the first call in which the outer option - /// is `some`, and error on subsequent calls. - /// - /// The inner `result` represents that either the incoming HTTP Response - /// status and headers have recieved successfully, or that an error - /// occured. Errors may also occur while consuming the response body, - /// but those will be reported by the `incoming-body` and its - /// `output-stream` child. - get: func() -> option>>; - - /// Returns a pollable which becomes ready when either the Response has - /// been received, or an error has occured. When this pollable is ready, - /// the `get` method will return `some`. - subscribe: func() -> pollable; - } - - /// Attempts to extract a http-related `error` from the wasi:io `error` - /// provided. - /// - /// Stream operations which return - /// `wasi:io/stream/stream-error::last-operation-failed` have a payload of - /// type `wasi:io/error/error` with more information about the operation - /// that failed. This payload can be passed through to this function to see - /// if there's http-related information about the error to return. - /// - /// Note that this function is fallible because not all io-errors are - /// http-related errors. - http-error-code: func(err: borrow) -> option; - } - - /// This interface defines a handler of incoming HTTP Requests. It should - /// be exported by components which can respond to HTTP Requests. - interface incoming-handler { - use types.{incoming-request}; - use types.{response-outparam}; - - /// This function is invoked with an incoming HTTP Request, and a resource - /// `response-outparam` which provides the capability to reply with an HTTP - /// Response. The response is sent by calling the `response-outparam.set` - /// method, which allows execution to continue after the response has been - /// sent. This enables both streaming to the response body, and performing other - /// work. - /// - /// The implementor of this function must write a response to the - /// `response-outparam` before returning, or else the caller will respond - /// with an error on its behalf. - handle: func(request: incoming-request, response-out: response-outparam); - } - - /// This interface defines a handler of outgoing HTTP Requests. It should be - /// imported by components which wish to make HTTP Requests. - interface outgoing-handler { - use types.{outgoing-request}; - use types.{request-options}; - use types.{future-incoming-response}; - use types.{error-code}; - - /// This function is invoked with an outgoing HTTP Request, and it returns - /// a resource `future-incoming-response` which represents an HTTP Response - /// which may arrive in the future. - /// - /// The `options` argument accepts optional parameters for the HTTP - /// protocol's transport layer. - /// - /// This function may return an error if the `outgoing-request` is invalid - /// or not allowed to be made. Otherwise, protocol errors are reported - /// through the `future-incoming-response`. - handle: func(request: outgoing-request, options: option) -> result; - } -} - -package wasi:io@0.2.0 { - interface poll { - resource pollable { - block: func(); - ready: func() -> bool; - } - poll: func(in: list>) -> list; - } - - interface error { - resource error { - to-debug-string: func() -> string; - } - } - - interface streams { - use error.{error}; - use poll.{pollable}; - variant stream-error { - last-operation-failed(error), - closed, - } - resource input-stream { - blocking-read: func(len: u64) -> result, stream-error>; - blocking-skip: func(len: u64) -> result; - read: func(len: u64) -> result, stream-error>; - skip: func(len: u64) -> result; - subscribe: func() -> pollable; - } - resource output-stream { - blocking-flush: func() -> result<_, stream-error>; - blocking-splice: func(src: borrow, len: u64) -> result; - blocking-write-and-flush: func(contents: list) -> result<_, stream-error>; - blocking-write-zeroes-and-flush: func(len: u64) -> result<_, stream-error>; - check-write: func() -> result; - flush: func() -> result<_, stream-error>; - splice: func(src: borrow, len: u64) -> result; - subscribe: func() -> pollable; - write: func(contents: list) -> result<_, stream-error>; - write-zeroes: func(len: u64) -> result<_, stream-error>; - } - } -} - -package wasi:logging@0.1.0-draft { - interface logging { - enum level { - trace, - debug, - info, - warn, - error, - critical - } - log: func(level: level, context: string, message: string); - } -} - -package wasi:random@0.2.0 { - interface random { - get-random-bytes: func(len: u64) -> list; - get-random-u64: func() -> u64; - } - - interface insecure { - get-insecure-random-bytes: func(len: u64) -> list; - get-insecure-random-u64: func() -> u64; - } - - interface insecure-seed { - insecure-seed: func() -> tuple; - } -} - -package wasi:sockets@0.2.0 { - interface network { - resource network; - enum error-code { - unknown, - access-denied, - not-supported, - invalid-argument, - out-of-memory, - timeout, - concurrency-conflict, - not-in-progress, - would-block, - invalid-state, - new-socket-limit, - address-not-bindable, - address-in-use, - remote-unreachable, - connection-refused, - connection-reset, - connection-aborted, - datagram-too-large, - name-unresolvable, - temporary-resolver-failure, - permanent-resolver-failure - } - enum ip-address-family { ipv4, ipv6 } - type ipv4-address = tuple; - type ipv6-address = tuple; - variant ip-address { - ipv4(ipv4-address), - ipv6(ipv6-address), - } - record ipv4-socket-address { - port: u16, - address: ipv4-address, - } - record ipv6-socket-address { - port: u16, - flow-info: u32, - address: ipv6-address, - scope-id: u32, - } - variant ip-socket-address { - ipv4(ipv4-socket-address), - ipv6(ipv6-socket-address), - } - } - - interface instance-network { - use network.{network}; - instance-network: func() -> network; - } - - interface udp { - use wasi:io/poll@0.2.0.{pollable}; - use network.{network}; - use network.{error-code}; - use network.{ip-socket-address}; - use network.{ip-address-family}; - record incoming-datagram { - data: list, - remote-address: ip-socket-address, - } - record outgoing-datagram { - data: list, - remote-address: option, - } - resource udp-socket { - address-family: func() -> ip-address-family; - finish-bind: func() -> result<_, error-code>; - local-address: func() -> result; - receive-buffer-size: func() -> result; - remote-address: func() -> result; - send-buffer-size: func() -> result; - set-receive-buffer-size: func(value: u64) -> result<_, error-code>; - set-send-buffer-size: func(value: u64) -> result<_, error-code>; - set-unicast-hop-limit: func(value: u8) -> result<_, error-code>; - start-bind: func(network: borrow, local-address: ip-socket-address) -> result<_, error-code>; - %stream: func(remote-address: option) -> result, error-code>; - subscribe: func() -> pollable; - unicast-hop-limit: func() -> result; - } - resource incoming-datagram-stream { - receive: func(max-results: u64) -> result, error-code>; - subscribe: func() -> pollable; - } - resource outgoing-datagram-stream { - check-send: func() -> result; - send: func(datagrams: list) -> result; - subscribe: func() -> pollable; - } - } - - interface udp-create-socket { - use network.{network}; - use network.{error-code}; - use network.{ip-address-family}; - use udp.{udp-socket}; - create-udp-socket: func(address-family: ip-address-family) -> result; - } - - interface tcp { - use wasi:io/streams@0.2.0.{input-stream}; - use wasi:io/streams@0.2.0.{output-stream}; - use wasi:io/poll@0.2.0.{pollable}; - use wasi:clocks/monotonic-clock@0.2.0.{duration}; - use network.{network}; - use network.{error-code}; - use network.{ip-socket-address}; - use network.{ip-address-family}; - enum shutdown-type { receive, send, both } - resource tcp-socket { - accept: func() -> result, error-code>; - address-family: func() -> ip-address-family; - finish-bind: func() -> result<_, error-code>; - finish-connect: func() -> result, error-code>; - finish-listen: func() -> result<_, error-code>; - hop-limit: func() -> result; - is-listening: func() -> bool; - keep-alive-count: func() -> result; - keep-alive-enabled: func() -> result; - keep-alive-idle-time: func() -> result; - keep-alive-interval: func() -> result; - local-address: func() -> result; - receive-buffer-size: func() -> result; - remote-address: func() -> result; - send-buffer-size: func() -> result; - set-hop-limit: func(value: u8) -> result<_, error-code>; - set-keep-alive-count: func(value: u32) -> result<_, error-code>; - set-keep-alive-enabled: func(value: bool) -> result<_, error-code>; - set-keep-alive-idle-time: func(value: duration) -> result<_, error-code>; - set-keep-alive-interval: func(value: duration) -> result<_, error-code>; - set-listen-backlog-size: func(value: u64) -> result<_, error-code>; - set-receive-buffer-size: func(value: u64) -> result<_, error-code>; - set-send-buffer-size: func(value: u64) -> result<_, error-code>; - shutdown: func(shutdown-type: shutdown-type) -> result<_, error-code>; - start-bind: func(network: borrow, local-address: ip-socket-address) -> result<_, error-code>; - start-connect: func(network: borrow, remote-address: ip-socket-address) -> result<_, error-code>; - start-listen: func() -> result<_, error-code>; - subscribe: func() -> pollable; - } - } - - interface tcp-create-socket { - use network.{network}; - use network.{error-code}; - use network.{ip-address-family}; - use tcp.{tcp-socket}; - create-tcp-socket: func(address-family: ip-address-family) -> result; - } - - interface ip-name-lookup { - use wasi:io/poll@0.2.0.{pollable}; - use network.{network}; - use network.{error-code}; - use network.{ip-address}; - resource resolve-address-stream { - resolve-next-address: func() -> result, error-code>; - subscribe: func() -> pollable; - } - resolve-addresses: func(network: borrow, name: string) -> result; - } -} - -package wasmcloud:bus@1.0.0 { - interface lattice { - resource call-target-interface { - constructor(namespace: string, %package: string, %interface: string); - } - set-link-name: func(name: string, interfaces: list); - } -} - -package wasmcloud:secrets@0.1.0-draft { - interface store { - variant secrets-error { - upstream(string), - io(string), - not-found, - } - variant secret-value { - %string(string), - bytes(list), - } - resource secret; - get: func(key: string) -> result; - } - - interface reveal { - use store.{secret}; - use store.{secret-value}; - reveal: func(s: borrow) -> secret-value; - } -} diff --git a/examples/component/http-server/gen/example/http-server/example/example.wit.go b/examples/component/http-server/gen/example/http-server/example/example.wit.go deleted file mode 100755 index 7368b9bd..00000000 --- a/examples/component/http-server/gen/example/http-server/example/example.wit.go +++ /dev/null @@ -1,4 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package example represents the world "example:http-server/example". -package example diff --git a/examples/component/http-server/gen/wasi/cli/environment/empty.s b/examples/component/http-server/gen/wasi/cli/environment/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/cli/environment/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/cli/environment/environment.wasm.go b/examples/component/http-server/gen/wasi/cli/environment/environment.wasm.go deleted file mode 100755 index b4c02ba4..00000000 --- a/examples/component/http-server/gen/wasi/cli/environment/environment.wasm.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package environment - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/environment@0.2.0 get-environment -//go:noescape -func wasmimport_GetEnvironment() - -//go:wasmimport wasi:cli/environment@0.2.0 get-arguments -//go:noescape -func wasmimport_GetArguments() - -//go:wasmimport wasi:cli/environment@0.2.0 initial-cwd -//go:noescape -func wasmimport_InitialCWD() diff --git a/examples/component/http-server/gen/wasi/cli/environment/environment.wit.go b/examples/component/http-server/gen/wasi/cli/environment/environment.wit.go deleted file mode 100755 index 7d1f8133..00000000 --- a/examples/component/http-server/gen/wasi/cli/environment/environment.wit.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package environment represents the imported interface "wasi:cli/environment@0.2.0". -package environment - -// GetEnvironment represents the imported function "get-environment". -// -// get-environment: func() -// -//go:nosplit -func GetEnvironment() { - wasmimport_GetEnvironment() - return -} - -// GetArguments represents the imported function "get-arguments". -// -// get-arguments: func() -// -//go:nosplit -func GetArguments() { - wasmimport_GetArguments() - return -} - -// InitialCWD represents the imported function "initial-cwd". -// -// initial-cwd: func() -// -//go:nosplit -func InitialCWD() { - wasmimport_InitialCWD() - return -} diff --git a/examples/component/http-server/gen/wasi/cli/exit/empty.s b/examples/component/http-server/gen/wasi/cli/exit/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/cli/exit/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/cli/exit/exit.wasm.go b/examples/component/http-server/gen/wasi/cli/exit/exit.wasm.go deleted file mode 100755 index 849d5f50..00000000 --- a/examples/component/http-server/gen/wasi/cli/exit/exit.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package exit - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/exit@0.2.0 exit -//go:noescape -func wasmimport_Exit(status0 uint32) diff --git a/examples/component/http-server/gen/wasi/cli/exit/exit.wit.go b/examples/component/http-server/gen/wasi/cli/exit/exit.wit.go deleted file mode 100755 index 7a347b60..00000000 --- a/examples/component/http-server/gen/wasi/cli/exit/exit.wit.go +++ /dev/null @@ -1,19 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package exit represents the imported interface "wasi:cli/exit@0.2.0". -package exit - -import ( - "go.bytecodealliance.org/cm" -) - -// Exit represents the imported function "exit". -// -// exit: func(status: result) -// -//go:nosplit -func Exit(status cm.BoolResult) { - status0 := (uint32)(cm.BoolToU32(status)) - wasmimport_Exit((uint32)(status0)) - return -} diff --git a/examples/component/http-server/gen/wasi/cli/stderr/empty.s b/examples/component/http-server/gen/wasi/cli/stderr/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/cli/stderr/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/cli/stderr/stderr.wasm.go b/examples/component/http-server/gen/wasi/cli/stderr/stderr.wasm.go deleted file mode 100755 index 9c5bcdb9..00000000 --- a/examples/component/http-server/gen/wasi/cli/stderr/stderr.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package stderr - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/stderr@0.2.0 get-stderr -//go:noescape -func wasmimport_GetStderr() diff --git a/examples/component/http-server/gen/wasi/cli/stderr/stderr.wit.go b/examples/component/http-server/gen/wasi/cli/stderr/stderr.wit.go deleted file mode 100755 index e8ba9eba..00000000 --- a/examples/component/http-server/gen/wasi/cli/stderr/stderr.wit.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package stderr represents the imported interface "wasi:cli/stderr@0.2.0". -package stderr - -import ( - "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/io/streams" -) - -// OutputStream represents the imported type alias "wasi:cli/stderr@0.2.0#output-stream". -// -// See [streams.OutputStream] for more information. -type OutputStream = streams.OutputStream - -// GetStderr represents the imported function "get-stderr". -// -// get-stderr: func() -// -//go:nosplit -func GetStderr() { - wasmimport_GetStderr() - return -} diff --git a/examples/component/http-server/gen/wasi/cli/stdin/empty.s b/examples/component/http-server/gen/wasi/cli/stdin/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/cli/stdin/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/cli/stdin/stdin.wasm.go b/examples/component/http-server/gen/wasi/cli/stdin/stdin.wasm.go deleted file mode 100755 index 090f2e31..00000000 --- a/examples/component/http-server/gen/wasi/cli/stdin/stdin.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package stdin - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/stdin@0.2.0 get-stdin -//go:noescape -func wasmimport_GetStdin() diff --git a/examples/component/http-server/gen/wasi/cli/stdin/stdin.wit.go b/examples/component/http-server/gen/wasi/cli/stdin/stdin.wit.go deleted file mode 100755 index 64af9b07..00000000 --- a/examples/component/http-server/gen/wasi/cli/stdin/stdin.wit.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package stdin represents the imported interface "wasi:cli/stdin@0.2.0". -package stdin - -import ( - "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/io/streams" -) - -// InputStream represents the imported type alias "wasi:cli/stdin@0.2.0#input-stream". -// -// See [streams.InputStream] for more information. -type InputStream = streams.InputStream - -// GetStdin represents the imported function "get-stdin". -// -// get-stdin: func() -// -//go:nosplit -func GetStdin() { - wasmimport_GetStdin() - return -} diff --git a/examples/component/http-server/gen/wasi/cli/stdout/empty.s b/examples/component/http-server/gen/wasi/cli/stdout/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/cli/stdout/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/cli/stdout/stdout.wasm.go b/examples/component/http-server/gen/wasi/cli/stdout/stdout.wasm.go deleted file mode 100755 index 1a1a2650..00000000 --- a/examples/component/http-server/gen/wasi/cli/stdout/stdout.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package stdout - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/stdout@0.2.0 get-stdout -//go:noescape -func wasmimport_GetStdout() diff --git a/examples/component/http-server/gen/wasi/cli/stdout/stdout.wit.go b/examples/component/http-server/gen/wasi/cli/stdout/stdout.wit.go deleted file mode 100755 index ac8463a0..00000000 --- a/examples/component/http-server/gen/wasi/cli/stdout/stdout.wit.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package stdout represents the imported interface "wasi:cli/stdout@0.2.0". -package stdout - -import ( - "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/io/streams" -) - -// OutputStream represents the imported type alias "wasi:cli/stdout@0.2.0#output-stream". -// -// See [streams.OutputStream] for more information. -type OutputStream = streams.OutputStream - -// GetStdout represents the imported function "get-stdout". -// -// get-stdout: func() -// -//go:nosplit -func GetStdout() { - wasmimport_GetStdout() - return -} diff --git a/examples/component/http-server/gen/wasi/cli/terminal-input/empty.s b/examples/component/http-server/gen/wasi/cli/terminal-input/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/cli/terminal-input/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/cli/terminal-input/terminal-input.wit.go b/examples/component/http-server/gen/wasi/cli/terminal-input/terminal-input.wit.go deleted file mode 100755 index 18b9a9d7..00000000 --- a/examples/component/http-server/gen/wasi/cli/terminal-input/terminal-input.wit.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package terminalinput represents the imported interface "wasi:cli/terminal-input@0.2.0". -package terminalinput - -import ( - "go.bytecodealliance.org/cm" -) - -// TerminalInput represents the imported resource "wasi:cli/terminal-input@0.2.0#terminal-input". -// -// resource terminal-input -type TerminalInput cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "terminal-input". -// -// Drops a resource handle. -// -//go:nosplit -func (self TerminalInput) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TerminalInputResourceDrop((uint32)(self0)) - return -} diff --git a/examples/component/http-server/gen/wasi/cli/terminal-input/terminalinput.wasm.go b/examples/component/http-server/gen/wasi/cli/terminal-input/terminalinput.wasm.go deleted file mode 100755 index 1df3794f..00000000 --- a/examples/component/http-server/gen/wasi/cli/terminal-input/terminalinput.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package terminalinput - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/terminal-input@0.2.0 [resource-drop]terminal-input -//go:noescape -func wasmimport_TerminalInputResourceDrop(self0 uint32) diff --git a/examples/component/http-server/gen/wasi/cli/terminal-output/empty.s b/examples/component/http-server/gen/wasi/cli/terminal-output/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/cli/terminal-output/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/cli/terminal-output/terminal-output.wit.go b/examples/component/http-server/gen/wasi/cli/terminal-output/terminal-output.wit.go deleted file mode 100755 index 823aaf52..00000000 --- a/examples/component/http-server/gen/wasi/cli/terminal-output/terminal-output.wit.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package terminaloutput represents the imported interface "wasi:cli/terminal-output@0.2.0". -package terminaloutput - -import ( - "go.bytecodealliance.org/cm" -) - -// TerminalOutput represents the imported resource "wasi:cli/terminal-output@0.2.0#terminal-output". -// -// resource terminal-output -type TerminalOutput cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "terminal-output". -// -// Drops a resource handle. -// -//go:nosplit -func (self TerminalOutput) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TerminalOutputResourceDrop((uint32)(self0)) - return -} diff --git a/examples/component/http-server/gen/wasi/cli/terminal-output/terminaloutput.wasm.go b/examples/component/http-server/gen/wasi/cli/terminal-output/terminaloutput.wasm.go deleted file mode 100755 index fb35fc41..00000000 --- a/examples/component/http-server/gen/wasi/cli/terminal-output/terminaloutput.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package terminaloutput - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/terminal-output@0.2.0 [resource-drop]terminal-output -//go:noescape -func wasmimport_TerminalOutputResourceDrop(self0 uint32) diff --git a/examples/component/http-server/gen/wasi/cli/terminal-stderr/empty.s b/examples/component/http-server/gen/wasi/cli/terminal-stderr/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/cli/terminal-stderr/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go b/examples/component/http-server/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go deleted file mode 100755 index 74325c62..00000000 --- a/examples/component/http-server/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package terminalstderr represents the imported interface "wasi:cli/terminal-stderr@0.2.0". -package terminalstderr - -import ( - terminaloutput "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/cli/terminal-output" -) - -// TerminalOutput represents the imported type alias "wasi:cli/terminal-stderr@0.2.0#terminal-output". -// -// See [terminaloutput.TerminalOutput] for more information. -type TerminalOutput = terminaloutput.TerminalOutput - -// GetTerminalStderr represents the imported function "get-terminal-stderr". -// -// get-terminal-stderr: func() -// -//go:nosplit -func GetTerminalStderr() { - wasmimport_GetTerminalStderr() - return -} diff --git a/examples/component/http-server/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go b/examples/component/http-server/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go deleted file mode 100755 index 03cbe909..00000000 --- a/examples/component/http-server/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package terminalstderr - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/terminal-stderr@0.2.0 get-terminal-stderr -//go:noescape -func wasmimport_GetTerminalStderr() diff --git a/examples/component/http-server/gen/wasi/cli/terminal-stdin/empty.s b/examples/component/http-server/gen/wasi/cli/terminal-stdin/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/cli/terminal-stdin/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go b/examples/component/http-server/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go deleted file mode 100755 index 4bb86337..00000000 --- a/examples/component/http-server/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package terminalstdin represents the imported interface "wasi:cli/terminal-stdin@0.2.0". -package terminalstdin - -import ( - terminalinput "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/cli/terminal-input" -) - -// TerminalInput represents the imported type alias "wasi:cli/terminal-stdin@0.2.0#terminal-input". -// -// See [terminalinput.TerminalInput] for more information. -type TerminalInput = terminalinput.TerminalInput - -// GetTerminalStdin represents the imported function "get-terminal-stdin". -// -// get-terminal-stdin: func() -// -//go:nosplit -func GetTerminalStdin() { - wasmimport_GetTerminalStdin() - return -} diff --git a/examples/component/http-server/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go b/examples/component/http-server/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go deleted file mode 100755 index 1a59d9fd..00000000 --- a/examples/component/http-server/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package terminalstdin - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/terminal-stdin@0.2.0 get-terminal-stdin -//go:noescape -func wasmimport_GetTerminalStdin() diff --git a/examples/component/http-server/gen/wasi/cli/terminal-stdout/empty.s b/examples/component/http-server/gen/wasi/cli/terminal-stdout/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/cli/terminal-stdout/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go b/examples/component/http-server/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go deleted file mode 100755 index 17e4d7da..00000000 --- a/examples/component/http-server/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package terminalstdout represents the imported interface "wasi:cli/terminal-stdout@0.2.0". -package terminalstdout - -import ( - terminaloutput "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/cli/terminal-output" -) - -// TerminalOutput represents the imported type alias "wasi:cli/terminal-stdout@0.2.0#terminal-output". -// -// See [terminaloutput.TerminalOutput] for more information. -type TerminalOutput = terminaloutput.TerminalOutput - -// GetTerminalStdout represents the imported function "get-terminal-stdout". -// -// get-terminal-stdout: func() -// -//go:nosplit -func GetTerminalStdout() { - wasmimport_GetTerminalStdout() - return -} diff --git a/examples/component/http-server/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go b/examples/component/http-server/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go deleted file mode 100755 index c45db1d2..00000000 --- a/examples/component/http-server/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package terminalstdout - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/terminal-stdout@0.2.0 get-terminal-stdout -//go:noescape -func wasmimport_GetTerminalStdout() diff --git a/examples/component/http-server/gen/wasi/clocks/monotonic-clock/empty.s b/examples/component/http-server/gen/wasi/clocks/monotonic-clock/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/clocks/monotonic-clock/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go b/examples/component/http-server/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go deleted file mode 100755 index ef5072ba..00000000 --- a/examples/component/http-server/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package monotonicclock represents the imported interface "wasi:clocks/monotonic-clock@0.2.0". -package monotonicclock - -import ( - "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/io/poll" -) - -// Pollable represents the imported type alias "wasi:clocks/monotonic-clock@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// Instant represents the u64 "wasi:clocks/monotonic-clock@0.2.0#instant". -// -// type instant = u64 -type Instant uint64 - -// Duration represents the u64 "wasi:clocks/monotonic-clock@0.2.0#duration". -// -// type duration = u64 -type Duration uint64 - -// Now represents the imported function "now". -// -// now: func() -// -//go:nosplit -func Now() { - wasmimport_Now() - return -} - -// Resolution represents the imported function "resolution". -// -// resolution: func() -// -//go:nosplit -func Resolution() { - wasmimport_Resolution() - return -} - -// SubscribeInstant represents the imported function "subscribe-instant". -// -// subscribe-instant: func(when: instant) -// -//go:nosplit -func SubscribeInstant(when Instant) { - when0 := (uint64)(when) - wasmimport_SubscribeInstant((uint64)(when0)) - return -} - -// SubscribeDuration represents the imported function "subscribe-duration". -// -// subscribe-duration: func(when: duration) -// -//go:nosplit -func SubscribeDuration(when Duration) { - when0 := (uint64)(when) - wasmimport_SubscribeDuration((uint64)(when0)) - return -} diff --git a/examples/component/http-server/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go b/examples/component/http-server/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go deleted file mode 100755 index 4494c61a..00000000 --- a/examples/component/http-server/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package monotonicclock - -// This file contains wasmimport and wasmexport declarations for "wasi:clocks@0.2.0". - -//go:wasmimport wasi:clocks/monotonic-clock@0.2.0 now -//go:noescape -func wasmimport_Now() - -//go:wasmimport wasi:clocks/monotonic-clock@0.2.0 resolution -//go:noescape -func wasmimport_Resolution() - -//go:wasmimport wasi:clocks/monotonic-clock@0.2.0 subscribe-instant -//go:noescape -func wasmimport_SubscribeInstant(when0 uint64) - -//go:wasmimport wasi:clocks/monotonic-clock@0.2.0 subscribe-duration -//go:noescape -func wasmimport_SubscribeDuration(when0 uint64) diff --git a/examples/component/http-server/gen/wasi/clocks/wall-clock/empty.s b/examples/component/http-server/gen/wasi/clocks/wall-clock/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/clocks/wall-clock/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/clocks/wall-clock/wall-clock.wit.go b/examples/component/http-server/gen/wasi/clocks/wall-clock/wall-clock.wit.go deleted file mode 100755 index 308f0910..00000000 --- a/examples/component/http-server/gen/wasi/clocks/wall-clock/wall-clock.wit.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package wallclock represents the imported interface "wasi:clocks/wall-clock@0.2.0". -package wallclock - -import ( - "go.bytecodealliance.org/cm" -) - -// DateTime represents the record "wasi:clocks/wall-clock@0.2.0#datetime". -// -// record datetime { -// seconds: u64, -// nanoseconds: u32, -// } -type DateTime struct { - _ cm.HostLayout - Seconds uint64 - Nanoseconds uint32 -} - -// Now represents the imported function "now". -// -// now: func() -// -//go:nosplit -func Now() { - wasmimport_Now() - return -} - -// Resolution represents the imported function "resolution". -// -// resolution: func() -// -//go:nosplit -func Resolution() { - wasmimport_Resolution() - return -} diff --git a/examples/component/http-server/gen/wasi/clocks/wall-clock/wallclock.wasm.go b/examples/component/http-server/gen/wasi/clocks/wall-clock/wallclock.wasm.go deleted file mode 100755 index 4efbaf84..00000000 --- a/examples/component/http-server/gen/wasi/clocks/wall-clock/wallclock.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package wallclock - -// This file contains wasmimport and wasmexport declarations for "wasi:clocks@0.2.0". - -//go:wasmimport wasi:clocks/wall-clock@0.2.0 now -//go:noescape -func wasmimport_Now() - -//go:wasmimport wasi:clocks/wall-clock@0.2.0 resolution -//go:noescape -func wasmimport_Resolution() diff --git a/examples/component/http-server/gen/wasi/config/runtime/abi.go b/examples/component/http-server/gen/wasi/config/runtime/abi.go deleted file mode 100755 index 61412cbe..00000000 --- a/examples/component/http-server/gen/wasi/config/runtime/abi.go +++ /dev/null @@ -1,20 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package runtime - -import ( - "go.bytecodealliance.org/cm" - "unsafe" -) - -// OptionStringShape is used for storage in variant or result types. -type OptionStringShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Option[string]{})]byte -} - -// ConfigErrorShape is used for storage in variant or result types. -type ConfigErrorShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(ConfigError{})]byte -} diff --git a/examples/component/http-server/gen/wasi/config/runtime/empty.s b/examples/component/http-server/gen/wasi/config/runtime/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/config/runtime/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/config/runtime/runtime.wasm.go b/examples/component/http-server/gen/wasi/config/runtime/runtime.wasm.go deleted file mode 100755 index 4abfb286..00000000 --- a/examples/component/http-server/gen/wasi/config/runtime/runtime.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package runtime - -// This file contains wasmimport and wasmexport declarations for "wasi:config@0.2.0-draft". - -//go:wasmimport wasi:config/runtime@0.2.0-draft get -//go:noescape -func wasmimport_Get(key0 *uint8, key1 uint32) - -//go:wasmimport wasi:config/runtime@0.2.0-draft get-all -//go:noescape -func wasmimport_GetAll() diff --git a/examples/component/http-server/gen/wasi/config/runtime/runtime.wit.go b/examples/component/http-server/gen/wasi/config/runtime/runtime.wit.go deleted file mode 100755 index 204a5c0c..00000000 --- a/examples/component/http-server/gen/wasi/config/runtime/runtime.wit.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package runtime represents the imported interface "wasi:config/runtime@0.2.0-draft". -package runtime - -import ( - "go.bytecodealliance.org/cm" -) - -// ConfigError represents the variant "wasi:config/runtime@0.2.0-draft#config-error". -// -// variant config-error { -// upstream(string), -// io(string), -// } -type ConfigError cm.Variant[uint8, string, string] - -// ConfigErrorUpstream returns a [ConfigError] of case "upstream". -func ConfigErrorUpstream(data string) ConfigError { - return cm.New[ConfigError](0, data) -} - -// Upstream returns a non-nil *[string] if [ConfigError] represents the variant case "upstream". -func (self *ConfigError) Upstream() *string { - return cm.Case[string](self, 0) -} - -// ConfigErrorIO returns a [ConfigError] of case "io". -func ConfigErrorIO(data string) ConfigError { - return cm.New[ConfigError](1, data) -} - -// IO returns a non-nil *[string] if [ConfigError] represents the variant case "io". -func (self *ConfigError) IO() *string { - return cm.Case[string](self, 1) -} - -var stringsConfigError = [2]string{ - "upstream", - "io", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v ConfigError) String() string { - return stringsConfigError[v.Tag()] -} - -// Get represents the imported function "get". -// -// get: func(key: string) -// -//go:nosplit -func Get(key string) { - key0, key1 := cm.LowerString(key) - wasmimport_Get((*uint8)(key0), (uint32)(key1)) - return -} - -// GetAll represents the imported function "get-all". -// -// get-all: func() -// -//go:nosplit -func GetAll() { - wasmimport_GetAll() - return -} diff --git a/examples/component/http-server/gen/wasi/filesystem/preopens/empty.s b/examples/component/http-server/gen/wasi/filesystem/preopens/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/filesystem/preopens/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/filesystem/preopens/preopens.wasm.go b/examples/component/http-server/gen/wasi/filesystem/preopens/preopens.wasm.go deleted file mode 100755 index 50885ee0..00000000 --- a/examples/component/http-server/gen/wasi/filesystem/preopens/preopens.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package preopens - -// This file contains wasmimport and wasmexport declarations for "wasi:filesystem@0.2.0". - -//go:wasmimport wasi:filesystem/preopens@0.2.0 get-directories -//go:noescape -func wasmimport_GetDirectories() diff --git a/examples/component/http-server/gen/wasi/filesystem/preopens/preopens.wit.go b/examples/component/http-server/gen/wasi/filesystem/preopens/preopens.wit.go deleted file mode 100755 index 1174092a..00000000 --- a/examples/component/http-server/gen/wasi/filesystem/preopens/preopens.wit.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package preopens represents the imported interface "wasi:filesystem/preopens@0.2.0". -package preopens - -import ( - "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/filesystem/types" -) - -// Descriptor represents the imported type alias "wasi:filesystem/preopens@0.2.0#descriptor". -// -// See [types.Descriptor] for more information. -type Descriptor = types.Descriptor - -// GetDirectories represents the imported function "get-directories". -// -// get-directories: func() -// -//go:nosplit -func GetDirectories() { - wasmimport_GetDirectories() - return -} diff --git a/examples/component/http-server/gen/wasi/filesystem/types/abi.go b/examples/component/http-server/gen/wasi/filesystem/types/abi.go deleted file mode 100755 index ccc8a541..00000000 --- a/examples/component/http-server/gen/wasi/filesystem/types/abi.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package types - -import ( - wallclock "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/clocks/wall-clock" - "go.bytecodealliance.org/cm" -) - -func lower_DateTime(v wallclock.DateTime) (f0 uint64, f1 uint32) { - f0 = (uint64)(v.Seconds) - f1 = (uint32)(v.Nanoseconds) - return -} - -func lower_NewTimestamp(v NewTimestamp) (f0 uint32, f1 uint64, f2 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 2: // timestamp - v1, v2 := lower_DateTime(*cm.Case[DateTime](&v, 2)) - f1 = (uint64)(v1) - f2 = (uint32)(v2) - } - return -} diff --git a/examples/component/http-server/gen/wasi/filesystem/types/empty.s b/examples/component/http-server/gen/wasi/filesystem/types/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/filesystem/types/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/filesystem/types/types.wasm.go b/examples/component/http-server/gen/wasi/filesystem/types/types.wasm.go deleted file mode 100755 index 7a2b9993..00000000 --- a/examples/component/http-server/gen/wasi/filesystem/types/types.wasm.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package types - -// This file contains wasmimport and wasmexport declarations for "wasi:filesystem@0.2.0". - -//go:wasmimport wasi:filesystem/types@0.2.0 [resource-drop]descriptor -//go:noescape -func wasmimport_DescriptorResourceDrop(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.advise -//go:noescape -func wasmimport_DescriptorAdvise(self0 uint32, offset0 uint64, length0 uint64, advice0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.append-via-stream -//go:noescape -func wasmimport_DescriptorAppendViaStream(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.create-directory-at -//go:noescape -func wasmimport_DescriptorCreateDirectoryAt(self0 uint32, path0 *uint8, path1 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.get-flags -//go:noescape -func wasmimport_DescriptorGetFlags(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.get-type -//go:noescape -func wasmimport_DescriptorGetType(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.is-same-object -//go:noescape -func wasmimport_DescriptorIsSameObject(self0 uint32, other0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.link-at -//go:noescape -func wasmimport_DescriptorLinkAt(self0 uint32, oldPathFlags0 uint32, oldPath0 *uint8, oldPath1 uint32, newDescriptor0 uint32, newPath0 *uint8, newPath1 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.metadata-hash -//go:noescape -func wasmimport_DescriptorMetadataHash(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.metadata-hash-at -//go:noescape -func wasmimport_DescriptorMetadataHashAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.open-at -//go:noescape -func wasmimport_DescriptorOpenAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, openFlags0 uint32, flags0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.read -//go:noescape -func wasmimport_DescriptorRead(self0 uint32, length0 uint64, offset0 uint64) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.read-directory -//go:noescape -func wasmimport_DescriptorReadDirectory(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.read-via-stream -//go:noescape -func wasmimport_DescriptorReadViaStream(self0 uint32, offset0 uint64) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.readlink-at -//go:noescape -func wasmimport_DescriptorReadLinkAt(self0 uint32, path0 *uint8, path1 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.remove-directory-at -//go:noescape -func wasmimport_DescriptorRemoveDirectoryAt(self0 uint32, path0 *uint8, path1 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.rename-at -//go:noescape -func wasmimport_DescriptorRenameAt(self0 uint32, oldPath0 *uint8, oldPath1 uint32, newDescriptor0 uint32, newPath0 *uint8, newPath1 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.set-size -//go:noescape -func wasmimport_DescriptorSetSize(self0 uint32, size0 uint64) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.set-times -//go:noescape -func wasmimport_DescriptorSetTimes(self0 uint32, dataAccessTimestamp0 uint32, dataAccessTimestamp1 uint64, dataAccessTimestamp2 uint32, dataModificationTimestamp0 uint32, dataModificationTimestamp1 uint64, dataModificationTimestamp2 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.set-times-at -//go:noescape -func wasmimport_DescriptorSetTimesAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, dataAccessTimestamp0 uint32, dataAccessTimestamp1 uint64, dataAccessTimestamp2 uint32, dataModificationTimestamp0 uint32, dataModificationTimestamp1 uint64, dataModificationTimestamp2 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.stat -//go:noescape -func wasmimport_DescriptorStat(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.stat-at -//go:noescape -func wasmimport_DescriptorStatAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.symlink-at -//go:noescape -func wasmimport_DescriptorSymlinkAt(self0 uint32, oldPath0 *uint8, oldPath1 uint32, newPath0 *uint8, newPath1 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.sync -//go:noescape -func wasmimport_DescriptorSync(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.sync-data -//go:noescape -func wasmimport_DescriptorSyncData(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.unlink-file-at -//go:noescape -func wasmimport_DescriptorUnlinkFileAt(self0 uint32, path0 *uint8, path1 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.write -//go:noescape -func wasmimport_DescriptorWrite(self0 uint32, buffer0 *uint8, buffer1 uint32, offset0 uint64) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.write-via-stream -//go:noescape -func wasmimport_DescriptorWriteViaStream(self0 uint32, offset0 uint64) - -//go:wasmimport wasi:filesystem/types@0.2.0 [resource-drop]directory-entry-stream -//go:noescape -func wasmimport_DirectoryEntryStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]directory-entry-stream.read-directory-entry -//go:noescape -func wasmimport_DirectoryEntryStreamReadDirectoryEntry(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 filesystem-error-code -//go:noescape -func wasmimport_FilesystemErrorCode(err0 uint32) diff --git a/examples/component/http-server/gen/wasi/filesystem/types/types.wit.go b/examples/component/http-server/gen/wasi/filesystem/types/types.wit.go deleted file mode 100755 index d475f157..00000000 --- a/examples/component/http-server/gen/wasi/filesystem/types/types.wit.go +++ /dev/null @@ -1,783 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package types represents the imported interface "wasi:filesystem/types@0.2.0". -package types - -import ( - wallclock "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/clocks/wall-clock" - "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/io/streams" - "go.bytecodealliance.org/cm" -) - -// InputStream represents the imported type alias "wasi:filesystem/types@0.2.0#input-stream". -// -// See [streams.InputStream] for more information. -type InputStream = streams.InputStream - -// OutputStream represents the imported type alias "wasi:filesystem/types@0.2.0#output-stream". -// -// See [streams.OutputStream] for more information. -type OutputStream = streams.OutputStream - -// Error represents the imported type alias "wasi:filesystem/types@0.2.0#error". -// -// See [streams.Error] for more information. -type Error = streams.Error - -// DateTime represents the type alias "wasi:filesystem/types@0.2.0#datetime". -// -// See [wallclock.DateTime] for more information. -type DateTime = wallclock.DateTime - -// FileSize represents the u64 "wasi:filesystem/types@0.2.0#filesize". -// -// type filesize = u64 -type FileSize uint64 - -// DescriptorType represents the enum "wasi:filesystem/types@0.2.0#descriptor-type". -// -// enum descriptor-type { -// unknown, -// block-device, -// character-device, -// directory, -// fifo, -// symbolic-link, -// regular-file, -// socket -// } -type DescriptorType uint8 - -const ( - DescriptorTypeUnknown DescriptorType = iota - DescriptorTypeBlockDevice - DescriptorTypeCharacterDevice - DescriptorTypeDirectory - DescriptorTypeFIFO - DescriptorTypeSymbolicLink - DescriptorTypeRegularFile - DescriptorTypeSocket -) - -var stringsDescriptorType = [8]string{ - "unknown", - "block-device", - "character-device", - "directory", - "fifo", - "symbolic-link", - "regular-file", - "socket", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e DescriptorType) String() string { - return stringsDescriptorType[e] -} - -// DescriptorFlags represents the flags "wasi:filesystem/types@0.2.0#descriptor-flags". -// -// flags descriptor-flags { -// read, -// write, -// file-integrity-sync, -// data-integrity-sync, -// requested-write-sync, -// mutate-directory, -// } -type DescriptorFlags uint8 - -const ( - DescriptorFlagsRead DescriptorFlags = 1 << iota - DescriptorFlagsWrite - DescriptorFlagsFileIntegritySync - DescriptorFlagsDataIntegritySync - DescriptorFlagsRequestedWriteSync - DescriptorFlagsMutateDirectory -) - -// PathFlags represents the flags "wasi:filesystem/types@0.2.0#path-flags". -// -// flags path-flags { -// symlink-follow, -// } -type PathFlags uint8 - -const ( - PathFlagsSymlinkFollow PathFlags = 1 << iota -) - -// OpenFlags represents the flags "wasi:filesystem/types@0.2.0#open-flags". -// -// flags open-flags { -// create, -// directory, -// exclusive, -// truncate, -// } -type OpenFlags uint8 - -const ( - OpenFlagsCreate OpenFlags = 1 << iota - OpenFlagsDirectory - OpenFlagsExclusive - OpenFlagsTruncate -) - -// LinkCount represents the u64 "wasi:filesystem/types@0.2.0#link-count". -// -// type link-count = u64 -type LinkCount uint64 - -// DescriptorStat represents the record "wasi:filesystem/types@0.2.0#descriptor-stat". -// -// record descriptor-stat { -// %type: descriptor-type, -// link-count: link-count, -// size: filesize, -// data-access-timestamp: option, -// data-modification-timestamp: option, -// status-change-timestamp: option, -// } -type DescriptorStat struct { - _ cm.HostLayout - Type DescriptorType - LinkCount LinkCount - Size FileSize - DataAccessTimestamp cm.Option[DateTime] - DataModificationTimestamp cm.Option[DateTime] - StatusChangeTimestamp cm.Option[DateTime] -} - -// NewTimestamp represents the variant "wasi:filesystem/types@0.2.0#new-timestamp". -// -// variant new-timestamp { -// no-change, -// now, -// timestamp(datetime), -// } -type NewTimestamp cm.Variant[uint8, DateTime, DateTime] - -// NewTimestampNoChange returns a [NewTimestamp] of case "no-change". -func NewTimestampNoChange() NewTimestamp { - var data struct{} - return cm.New[NewTimestamp](0, data) -} - -// NoChange returns true if [NewTimestamp] represents the variant case "no-change". -func (self *NewTimestamp) NoChange() bool { - return self.Tag() == 0 -} - -// NewTimestampNow returns a [NewTimestamp] of case "now". -func NewTimestampNow() NewTimestamp { - var data struct{} - return cm.New[NewTimestamp](1, data) -} - -// Now returns true if [NewTimestamp] represents the variant case "now". -func (self *NewTimestamp) Now() bool { - return self.Tag() == 1 -} - -// NewTimestampTimestamp returns a [NewTimestamp] of case "timestamp". -func NewTimestampTimestamp(data DateTime) NewTimestamp { - return cm.New[NewTimestamp](2, data) -} - -// Timestamp returns a non-nil *[DateTime] if [NewTimestamp] represents the variant case "timestamp". -func (self *NewTimestamp) Timestamp() *DateTime { - return cm.Case[DateTime](self, 2) -} - -var stringsNewTimestamp = [3]string{ - "no-change", - "now", - "timestamp", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v NewTimestamp) String() string { - return stringsNewTimestamp[v.Tag()] -} - -// DirectoryEntry represents the record "wasi:filesystem/types@0.2.0#directory-entry". -// -// record directory-entry { -// %type: descriptor-type, -// name: string, -// } -type DirectoryEntry struct { - _ cm.HostLayout - Type DescriptorType - Name string -} - -// ErrorCode represents the enum "wasi:filesystem/types@0.2.0#error-code". -// -// enum error-code { -// access, -// would-block, -// already, -// bad-descriptor, -// busy, -// deadlock, -// quota, -// exist, -// file-too-large, -// illegal-byte-sequence, -// in-progress, -// interrupted, -// invalid, -// io, -// is-directory, -// loop, -// too-many-links, -// message-size, -// name-too-long, -// no-device, -// no-entry, -// no-lock, -// insufficient-memory, -// insufficient-space, -// not-directory, -// not-empty, -// not-recoverable, -// unsupported, -// no-tty, -// no-such-device, -// overflow, -// not-permitted, -// pipe, -// read-only, -// invalid-seek, -// text-file-busy, -// cross-device -// } -type ErrorCode uint8 - -const ( - ErrorCodeAccess ErrorCode = iota - ErrorCodeWouldBlock - ErrorCodeAlready - ErrorCodeBadDescriptor - ErrorCodeBusy - ErrorCodeDeadlock - ErrorCodeQuota - ErrorCodeExist - ErrorCodeFileTooLarge - ErrorCodeIllegalByteSequence - ErrorCodeInProgress - ErrorCodeInterrupted - ErrorCodeInvalid - ErrorCodeIO - ErrorCodeIsDirectory - ErrorCodeLoop - ErrorCodeTooManyLinks - ErrorCodeMessageSize - ErrorCodeNameTooLong - ErrorCodeNoDevice - ErrorCodeNoEntry - ErrorCodeNoLock - ErrorCodeInsufficientMemory - ErrorCodeInsufficientSpace - ErrorCodeNotDirectory - ErrorCodeNotEmpty - ErrorCodeNotRecoverable - ErrorCodeUnsupported - ErrorCodeNoTTY - ErrorCodeNoSuchDevice - ErrorCodeOverflow - ErrorCodeNotPermitted - ErrorCodePipe - ErrorCodeReadOnly - ErrorCodeInvalidSeek - ErrorCodeTextFileBusy - ErrorCodeCrossDevice -) - -var stringsErrorCode = [37]string{ - "access", - "would-block", - "already", - "bad-descriptor", - "busy", - "deadlock", - "quota", - "exist", - "file-too-large", - "illegal-byte-sequence", - "in-progress", - "interrupted", - "invalid", - "io", - "is-directory", - "loop", - "too-many-links", - "message-size", - "name-too-long", - "no-device", - "no-entry", - "no-lock", - "insufficient-memory", - "insufficient-space", - "not-directory", - "not-empty", - "not-recoverable", - "unsupported", - "no-tty", - "no-such-device", - "overflow", - "not-permitted", - "pipe", - "read-only", - "invalid-seek", - "text-file-busy", - "cross-device", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e ErrorCode) String() string { - return stringsErrorCode[e] -} - -// Advice represents the enum "wasi:filesystem/types@0.2.0#advice". -// -// enum advice { -// normal, -// sequential, -// random, -// will-need, -// dont-need, -// no-reuse -// } -type Advice uint8 - -const ( - AdviceNormal Advice = iota - AdviceSequential - AdviceRandom - AdviceWillNeed - AdviceDontNeed - AdviceNoReuse -) - -var stringsAdvice = [6]string{ - "normal", - "sequential", - "random", - "will-need", - "dont-need", - "no-reuse", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e Advice) String() string { - return stringsAdvice[e] -} - -// MetadataHashValue represents the record "wasi:filesystem/types@0.2.0#metadata-hash-value". -// -// record metadata-hash-value { -// lower: u64, -// upper: u64, -// } -type MetadataHashValue struct { - _ cm.HostLayout - Lower uint64 - Upper uint64 -} - -// Descriptor represents the imported resource "wasi:filesystem/types@0.2.0#descriptor". -// -// resource descriptor -type Descriptor cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "descriptor". -// -// Drops a resource handle. -// -//go:nosplit -func (self Descriptor) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorResourceDrop((uint32)(self0)) - return -} - -// Advise represents the imported method "advise". -// -// advise: func(offset: filesize, length: filesize, advice: advice) -// -//go:nosplit -func (self Descriptor) Advise(offset FileSize, length FileSize, advice Advice) { - self0 := cm.Reinterpret[uint32](self) - offset0 := (uint64)(offset) - length0 := (uint64)(length) - advice0 := (uint32)(advice) - wasmimport_DescriptorAdvise((uint32)(self0), (uint64)(offset0), (uint64)(length0), (uint32)(advice0)) - return -} - -// AppendViaStream represents the imported method "append-via-stream". -// -// append-via-stream: func() -// -//go:nosplit -func (self Descriptor) AppendViaStream() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorAppendViaStream((uint32)(self0)) - return -} - -// CreateDirectoryAt represents the imported method "create-directory-at". -// -// create-directory-at: func(path: string) -// -//go:nosplit -func (self Descriptor) CreateDirectoryAt(path string) { - self0 := cm.Reinterpret[uint32](self) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorCreateDirectoryAt((uint32)(self0), (*uint8)(path0), (uint32)(path1)) - return -} - -// GetFlags represents the imported method "get-flags". -// -// get-flags: func() -// -//go:nosplit -func (self Descriptor) GetFlags() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorGetFlags((uint32)(self0)) - return -} - -// GetType represents the imported method "get-type". -// -// get-type: func() -// -//go:nosplit -func (self Descriptor) GetType() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorGetType((uint32)(self0)) - return -} - -// IsSameObject represents the imported method "is-same-object". -// -// is-same-object: func(other: borrow) -// -//go:nosplit -func (self Descriptor) IsSameObject(other Descriptor) { - self0 := cm.Reinterpret[uint32](self) - other0 := cm.Reinterpret[uint32](other) - wasmimport_DescriptorIsSameObject((uint32)(self0), (uint32)(other0)) - return -} - -// LinkAt represents the imported method "link-at". -// -// link-at: func(old-path-flags: path-flags, old-path: string, new-descriptor: borrow, -// new-path: string) -// -//go:nosplit -func (self Descriptor) LinkAt(oldPathFlags PathFlags, oldPath string, newDescriptor Descriptor, newPath string) { - self0 := cm.Reinterpret[uint32](self) - oldPathFlags0 := (uint32)(oldPathFlags) - oldPath0, oldPath1 := cm.LowerString(oldPath) - newDescriptor0 := cm.Reinterpret[uint32](newDescriptor) - newPath0, newPath1 := cm.LowerString(newPath) - wasmimport_DescriptorLinkAt((uint32)(self0), (uint32)(oldPathFlags0), (*uint8)(oldPath0), (uint32)(oldPath1), (uint32)(newDescriptor0), (*uint8)(newPath0), (uint32)(newPath1)) - return -} - -// MetadataHash represents the imported method "metadata-hash". -// -// metadata-hash: func() -// -//go:nosplit -func (self Descriptor) MetadataHash() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorMetadataHash((uint32)(self0)) - return -} - -// MetadataHashAt represents the imported method "metadata-hash-at". -// -// metadata-hash-at: func(path-flags: path-flags, path: string) -// -//go:nosplit -func (self Descriptor) MetadataHashAt(pathFlags PathFlags, path string) { - self0 := cm.Reinterpret[uint32](self) - pathFlags0 := (uint32)(pathFlags) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorMetadataHashAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1)) - return -} - -// OpenAt represents the imported method "open-at". -// -// open-at: func(path-flags: path-flags, path: string, open-flags: open-flags, %flags: -// descriptor-flags) -// -//go:nosplit -func (self Descriptor) OpenAt(pathFlags PathFlags, path string, openFlags OpenFlags, flags DescriptorFlags) { - self0 := cm.Reinterpret[uint32](self) - pathFlags0 := (uint32)(pathFlags) - path0, path1 := cm.LowerString(path) - openFlags0 := (uint32)(openFlags) - flags0 := (uint32)(flags) - wasmimport_DescriptorOpenAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), (uint32)(openFlags0), (uint32)(flags0)) - return -} - -// Read represents the imported method "read". -// -// read: func(length: filesize, offset: filesize) -// -//go:nosplit -func (self Descriptor) Read(length FileSize, offset FileSize) { - self0 := cm.Reinterpret[uint32](self) - length0 := (uint64)(length) - offset0 := (uint64)(offset) - wasmimport_DescriptorRead((uint32)(self0), (uint64)(length0), (uint64)(offset0)) - return -} - -// ReadDirectory represents the imported method "read-directory". -// -// read-directory: func() -// -//go:nosplit -func (self Descriptor) ReadDirectory() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorReadDirectory((uint32)(self0)) - return -} - -// ReadViaStream represents the imported method "read-via-stream". -// -// read-via-stream: func(offset: filesize) -// -//go:nosplit -func (self Descriptor) ReadViaStream(offset FileSize) { - self0 := cm.Reinterpret[uint32](self) - offset0 := (uint64)(offset) - wasmimport_DescriptorReadViaStream((uint32)(self0), (uint64)(offset0)) - return -} - -// ReadLinkAt represents the imported method "readlink-at". -// -// readlink-at: func(path: string) -// -//go:nosplit -func (self Descriptor) ReadLinkAt(path string) { - self0 := cm.Reinterpret[uint32](self) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorReadLinkAt((uint32)(self0), (*uint8)(path0), (uint32)(path1)) - return -} - -// RemoveDirectoryAt represents the imported method "remove-directory-at". -// -// remove-directory-at: func(path: string) -// -//go:nosplit -func (self Descriptor) RemoveDirectoryAt(path string) { - self0 := cm.Reinterpret[uint32](self) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorRemoveDirectoryAt((uint32)(self0), (*uint8)(path0), (uint32)(path1)) - return -} - -// RenameAt represents the imported method "rename-at". -// -// rename-at: func(old-path: string, new-descriptor: borrow, new-path: -// string) -// -//go:nosplit -func (self Descriptor) RenameAt(oldPath string, newDescriptor Descriptor, newPath string) { - self0 := cm.Reinterpret[uint32](self) - oldPath0, oldPath1 := cm.LowerString(oldPath) - newDescriptor0 := cm.Reinterpret[uint32](newDescriptor) - newPath0, newPath1 := cm.LowerString(newPath) - wasmimport_DescriptorRenameAt((uint32)(self0), (*uint8)(oldPath0), (uint32)(oldPath1), (uint32)(newDescriptor0), (*uint8)(newPath0), (uint32)(newPath1)) - return -} - -// SetSize represents the imported method "set-size". -// -// set-size: func(size: filesize) -// -//go:nosplit -func (self Descriptor) SetSize(size FileSize) { - self0 := cm.Reinterpret[uint32](self) - size0 := (uint64)(size) - wasmimport_DescriptorSetSize((uint32)(self0), (uint64)(size0)) - return -} - -// SetTimes represents the imported method "set-times". -// -// set-times: func(data-access-timestamp: new-timestamp, data-modification-timestamp: -// new-timestamp) -// -//go:nosplit -func (self Descriptor) SetTimes(dataAccessTimestamp NewTimestamp, dataModificationTimestamp NewTimestamp) { - self0 := cm.Reinterpret[uint32](self) - dataAccessTimestamp0, dataAccessTimestamp1, dataAccessTimestamp2 := lower_NewTimestamp(dataAccessTimestamp) - dataModificationTimestamp0, dataModificationTimestamp1, dataModificationTimestamp2 := lower_NewTimestamp(dataModificationTimestamp) - wasmimport_DescriptorSetTimes((uint32)(self0), (uint32)(dataAccessTimestamp0), (uint64)(dataAccessTimestamp1), (uint32)(dataAccessTimestamp2), (uint32)(dataModificationTimestamp0), (uint64)(dataModificationTimestamp1), (uint32)(dataModificationTimestamp2)) - return -} - -// SetTimesAt represents the imported method "set-times-at". -// -// set-times-at: func(path-flags: path-flags, path: string, data-access-timestamp: -// new-timestamp, data-modification-timestamp: new-timestamp) -// -//go:nosplit -func (self Descriptor) SetTimesAt(pathFlags PathFlags, path string, dataAccessTimestamp NewTimestamp, dataModificationTimestamp NewTimestamp) { - self0 := cm.Reinterpret[uint32](self) - pathFlags0 := (uint32)(pathFlags) - path0, path1 := cm.LowerString(path) - dataAccessTimestamp0, dataAccessTimestamp1, dataAccessTimestamp2 := lower_NewTimestamp(dataAccessTimestamp) - dataModificationTimestamp0, dataModificationTimestamp1, dataModificationTimestamp2 := lower_NewTimestamp(dataModificationTimestamp) - wasmimport_DescriptorSetTimesAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), (uint32)(dataAccessTimestamp0), (uint64)(dataAccessTimestamp1), (uint32)(dataAccessTimestamp2), (uint32)(dataModificationTimestamp0), (uint64)(dataModificationTimestamp1), (uint32)(dataModificationTimestamp2)) - return -} - -// Stat represents the imported method "stat". -// -// stat: func() -// -//go:nosplit -func (self Descriptor) Stat() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorStat((uint32)(self0)) - return -} - -// StatAt represents the imported method "stat-at". -// -// stat-at: func(path-flags: path-flags, path: string) -// -//go:nosplit -func (self Descriptor) StatAt(pathFlags PathFlags, path string) { - self0 := cm.Reinterpret[uint32](self) - pathFlags0 := (uint32)(pathFlags) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorStatAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1)) - return -} - -// SymlinkAt represents the imported method "symlink-at". -// -// symlink-at: func(old-path: string, new-path: string) -// -//go:nosplit -func (self Descriptor) SymlinkAt(oldPath string, newPath string) { - self0 := cm.Reinterpret[uint32](self) - oldPath0, oldPath1 := cm.LowerString(oldPath) - newPath0, newPath1 := cm.LowerString(newPath) - wasmimport_DescriptorSymlinkAt((uint32)(self0), (*uint8)(oldPath0), (uint32)(oldPath1), (*uint8)(newPath0), (uint32)(newPath1)) - return -} - -// Sync represents the imported method "sync". -// -// sync: func() -// -//go:nosplit -func (self Descriptor) Sync() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorSync((uint32)(self0)) - return -} - -// SyncData represents the imported method "sync-data". -// -// sync-data: func() -// -//go:nosplit -func (self Descriptor) SyncData() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorSyncData((uint32)(self0)) - return -} - -// UnlinkFileAt represents the imported method "unlink-file-at". -// -// unlink-file-at: func(path: string) -// -//go:nosplit -func (self Descriptor) UnlinkFileAt(path string) { - self0 := cm.Reinterpret[uint32](self) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorUnlinkFileAt((uint32)(self0), (*uint8)(path0), (uint32)(path1)) - return -} - -// Write represents the imported method "write". -// -// write: func(buffer: list, offset: filesize) -// -//go:nosplit -func (self Descriptor) Write(buffer cm.List[uint8], offset FileSize) { - self0 := cm.Reinterpret[uint32](self) - buffer0, buffer1 := cm.LowerList(buffer) - offset0 := (uint64)(offset) - wasmimport_DescriptorWrite((uint32)(self0), (*uint8)(buffer0), (uint32)(buffer1), (uint64)(offset0)) - return -} - -// WriteViaStream represents the imported method "write-via-stream". -// -// write-via-stream: func(offset: filesize) -// -//go:nosplit -func (self Descriptor) WriteViaStream(offset FileSize) { - self0 := cm.Reinterpret[uint32](self) - offset0 := (uint64)(offset) - wasmimport_DescriptorWriteViaStream((uint32)(self0), (uint64)(offset0)) - return -} - -// DirectoryEntryStream represents the imported resource "wasi:filesystem/types@0.2.0#directory-entry-stream". -// -// resource directory-entry-stream -type DirectoryEntryStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "directory-entry-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self DirectoryEntryStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DirectoryEntryStreamResourceDrop((uint32)(self0)) - return -} - -// ReadDirectoryEntry represents the imported method "read-directory-entry". -// -// read-directory-entry: func() -// -//go:nosplit -func (self DirectoryEntryStream) ReadDirectoryEntry() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DirectoryEntryStreamReadDirectoryEntry((uint32)(self0)) - return -} - -// FilesystemErrorCode represents the imported function "filesystem-error-code". -// -// filesystem-error-code: func(err: borrow) -// -//go:nosplit -func FilesystemErrorCode(err Error) { - err0 := cm.Reinterpret[uint32](err) - wasmimport_FilesystemErrorCode((uint32)(err0)) - return -} diff --git a/examples/component/http-server/gen/wasi/http/incoming-handler/empty.s b/examples/component/http-server/gen/wasi/http/incoming-handler/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/http/incoming-handler/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/http/incoming-handler/incoming-handler.exports.go b/examples/component/http-server/gen/wasi/http/incoming-handler/incoming-handler.exports.go deleted file mode 100755 index 673ccb48..00000000 --- a/examples/component/http-server/gen/wasi/http/incoming-handler/incoming-handler.exports.go +++ /dev/null @@ -1,22 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package incominghandler - -// Exports represents the caller-defined exports from "wasi:http/incoming-handler@0.2.0". -var Exports struct { - // Handle represents the caller-defined, exported function "handle". - // - // This function is invoked with an incoming HTTP Request, and a resource - // `response-outparam` which provides the capability to reply with an HTTP - // Response. The response is sent by calling the `response-outparam.set` - // method, which allows execution to continue after the response has been - // sent. This enables both streaming to the response body, and performing other - // work. - // - // The implementor of this function must write a response to the - // `response-outparam` before returning, or else the caller will respond - // with an error on its behalf. - // - // handle: func(request: incoming-request, response-out: response-outparam) - Handle func(request IncomingRequest, responseOut ResponseOutparam) -} diff --git a/examples/component/http-server/gen/wasi/http/incoming-handler/incoming-handler.wit.go b/examples/component/http-server/gen/wasi/http/incoming-handler/incoming-handler.wit.go deleted file mode 100755 index 0c114e19..00000000 --- a/examples/component/http-server/gen/wasi/http/incoming-handler/incoming-handler.wit.go +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package incominghandler represents the exported interface "wasi:http/incoming-handler@0.2.0". -// -// This interface defines a handler of incoming HTTP Requests. It should -// be exported by components which can respond to HTTP Requests. -package incominghandler - -import ( - "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/http/types" -) - -// IncomingRequest represents the exported type alias "wasi:http/incoming-handler@0.2.0#incoming-request". -// -// See [types.IncomingRequest] for more information. -type IncomingRequest = types.IncomingRequest - -// ResponseOutparam represents the exported type alias "wasi:http/incoming-handler@0.2.0#response-outparam". -// -// See [types.ResponseOutparam] for more information. -type ResponseOutparam = types.ResponseOutparam diff --git a/examples/component/http-server/gen/wasi/http/incoming-handler/incominghandler.wasm.go b/examples/component/http-server/gen/wasi/http/incoming-handler/incominghandler.wasm.go deleted file mode 100755 index eae429f3..00000000 --- a/examples/component/http-server/gen/wasi/http/incoming-handler/incominghandler.wasm.go +++ /dev/null @@ -1,18 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package incominghandler - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:http@0.2.0". - -//go:wasmexport wasi:http/incoming-handler@0.2.0#handle -//export wasi:http/incoming-handler@0.2.0#handle -func wasmexport_Handle(request0 uint32, responseOut0 uint32) { - request := cm.Reinterpret[IncomingRequest]((uint32)(request0)) - responseOut := cm.Reinterpret[ResponseOutparam]((uint32)(responseOut0)) - Exports.Handle(request, responseOut) - return -} diff --git a/examples/component/http-server/gen/wasi/http/outgoing-handler/abi.go b/examples/component/http-server/gen/wasi/http/outgoing-handler/abi.go deleted file mode 100755 index 5c6a7b48..00000000 --- a/examples/component/http-server/gen/wasi/http/outgoing-handler/abi.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package outgoinghandler - -import ( - "go.bytecodealliance.org/cm" -) - -func lower_OptionRequestOptions(v cm.Option[RequestOptions]) (f0 uint32, f1 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := cm.Reinterpret[uint32](*some) - f1 = (uint32)(v1) - } - return -} diff --git a/examples/component/http-server/gen/wasi/http/outgoing-handler/empty.s b/examples/component/http-server/gen/wasi/http/outgoing-handler/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/http/outgoing-handler/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go b/examples/component/http-server/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go deleted file mode 100755 index 7c81b9dc..00000000 --- a/examples/component/http-server/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package outgoinghandler represents the imported interface "wasi:http/outgoing-handler@0.2.0". -// -// This interface defines a handler of outgoing HTTP Requests. It should be -// imported by components which wish to make HTTP Requests. -package outgoinghandler - -import ( - "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/http/types" - "go.bytecodealliance.org/cm" -) - -// OutgoingRequest represents the imported type alias "wasi:http/outgoing-handler@0.2.0#outgoing-request". -// -// See [types.OutgoingRequest] for more information. -type OutgoingRequest = types.OutgoingRequest - -// RequestOptions represents the imported type alias "wasi:http/outgoing-handler@0.2.0#request-options". -// -// See [types.RequestOptions] for more information. -type RequestOptions = types.RequestOptions - -// FutureIncomingResponse represents the imported type alias "wasi:http/outgoing-handler@0.2.0#future-incoming-response". -// -// See [types.FutureIncomingResponse] for more information. -type FutureIncomingResponse = types.FutureIncomingResponse - -// ErrorCode represents the type alias "wasi:http/outgoing-handler@0.2.0#error-code". -// -// See [types.ErrorCode] for more information. -type ErrorCode = types.ErrorCode - -// Handle represents the imported function "handle". -// -// This function is invoked with an outgoing HTTP Request, and it returns -// a resource `future-incoming-response` which represents an HTTP Response -// which may arrive in the future. -// -// The `options` argument accepts optional parameters for the HTTP -// protocol's transport layer. -// -// This function may return an error if the `outgoing-request` is invalid -// or not allowed to be made. Otherwise, protocol errors are reported -// through the `future-incoming-response`. -// -// handle: func(request: outgoing-request, options: option) -// -//go:nosplit -func Handle(request OutgoingRequest, options cm.Option[RequestOptions]) { - request0 := cm.Reinterpret[uint32](request) - options0, options1 := lower_OptionRequestOptions(options) - wasmimport_Handle((uint32)(request0), (uint32)(options0), (uint32)(options1)) - return -} diff --git a/examples/component/http-server/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go b/examples/component/http-server/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go deleted file mode 100755 index 1f362c2a..00000000 --- a/examples/component/http-server/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package outgoinghandler - -// This file contains wasmimport and wasmexport declarations for "wasi:http@0.2.0". - -//go:wasmimport wasi:http/outgoing-handler@0.2.0 handle -//go:noescape -func wasmimport_Handle(request0 uint32, options0 uint32, options1 uint32) diff --git a/examples/component/http-server/gen/wasi/http/types/abi.go b/examples/component/http-server/gen/wasi/http/types/abi.go deleted file mode 100755 index 6ffb1fdd..00000000 --- a/examples/component/http-server/gen/wasi/http/types/abi.go +++ /dev/null @@ -1,264 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package types - -import ( - "go.bytecodealliance.org/cm" - "unsafe" -) - -// OptionFieldSizePayloadShape is used for storage in variant or result types. -type OptionFieldSizePayloadShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Option[FieldSizePayload]{})]byte -} - -func lower_OptionString(v cm.Option[string]) (f0 uint32, f1 *uint8, f2 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1, v2 := cm.LowerString(*some) - f1 = (*uint8)(v1) - f2 = (uint32)(v2) - } - return -} - -func lower_Method(v Method) (f0 uint32, f1 *uint8, f2 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 9: // other - v1, v2 := cm.LowerString(*cm.Case[string](&v, 9)) - f1 = (*uint8)(v1) - f2 = (uint32)(v2) - } - return -} - -func lower_Scheme(v Scheme) (f0 uint32, f1 *uint8, f2 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 2: // other - v1, v2 := cm.LowerString(*cm.Case[string](&v, 2)) - f1 = (*uint8)(v1) - f2 = (uint32)(v2) - } - return -} - -func lower_OptionScheme(v cm.Option[Scheme]) (f0 uint32, f1 uint32, f2 *uint8, f3 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1, v2, v3 := lower_Scheme(*some) - f1 = (uint32)(v1) - f2 = (*uint8)(v2) - f3 = (uint32)(v3) - } - return -} - -func lower_OptionDuration(v cm.Option[Duration]) (f0 uint32, f1 uint64) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := (uint64)(*some) - f1 = (uint64)(v1) - } - return -} - -// ErrorCodeShape is used for storage in variant or result types. -type ErrorCodeShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(ErrorCode{})]byte -} - -func lower_OptionU16(v cm.Option[uint16]) (f0 uint32, f1 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := (uint32)(*some) - f1 = (uint32)(v1) - } - return -} - -func lower_DNSErrorPayload(v DNSErrorPayload) (f0 uint32, f1 *uint8, f2 uint32, f3 uint32, f4 uint32) { - f0, f1, f2 = lower_OptionString(v.Rcode) - f3, f4 = lower_OptionU16(v.InfoCode) - return -} - -func lower_OptionU8(v cm.Option[uint8]) (f0 uint32, f1 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := (uint32)(*some) - f1 = (uint32)(v1) - } - return -} - -func lower_TLSAlertReceivedPayload(v TLSAlertReceivedPayload) (f0 uint32, f1 uint32, f2 uint32, f3 *uint8, f4 uint32) { - f0, f1 = lower_OptionU8(v.AlertID) - f2, f3, f4 = lower_OptionString(v.AlertMessage) - return -} - -func lower_OptionU64(v cm.Option[uint64]) (f0 uint32, f1 uint64) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := (uint64)(*some) - f1 = (uint64)(v1) - } - return -} - -func lower_OptionU32(v cm.Option[uint32]) (f0 uint32, f1 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := (uint32)(*some) - f1 = (uint32)(v1) - } - return -} - -func lower_FieldSizePayload(v FieldSizePayload) (f0 uint32, f1 *uint8, f2 uint32, f3 uint32, f4 uint32) { - f0, f1, f2 = lower_OptionString(v.FieldName) - f3, f4 = lower_OptionU32(v.FieldSize) - return -} - -func lower_OptionFieldSizePayload(v cm.Option[FieldSizePayload]) (f0 uint32, f1 uint32, f2 *uint8, f3 uint32, f4 uint32, f5 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1, v2, v3, v4, v5 := lower_FieldSizePayload(*some) - f1 = (uint32)(v1) - f2 = (*uint8)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - } - return -} - -func lower_ErrorCode(v ErrorCode) (f0 uint32, f1 uint32, f2 uint64, f3 uint32, f4 uint32, f5 uint32, f6 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 1: // DNS-error - v1, v2, v3, v4, v5 := lower_DNSErrorPayload(*cm.Case[DNSErrorPayload](&v, 1)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 14: // TLS-alert-received - v1, v2, v3, v4, v5 := lower_TLSAlertReceivedPayload(*cm.Case[TLSAlertReceivedPayload](&v, 14)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(cm.PointerToU32(v4)) - f5 = (uint32)(v5) - case 17: // HTTP-request-body-size - v1, v2 := lower_OptionU64(*cm.Case[cm.Option[uint64]](&v, 17)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 21: // HTTP-request-header-section-size - v1, v2 := lower_OptionU32(*cm.Case[cm.Option[uint32]](&v, 21)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 22: // HTTP-request-header-size - v1, v2, v3, v4, v5, v6 := lower_OptionFieldSizePayload(*cm.Case[cm.Option[FieldSizePayload]](&v, 22)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - f3 = (uint32)(cm.PointerToU32(v3)) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - f6 = (uint32)(v6) - case 23: // HTTP-request-trailer-section-size - v1, v2 := lower_OptionU32(*cm.Case[cm.Option[uint32]](&v, 23)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 24: // HTTP-request-trailer-size - v1, v2, v3, v4, v5 := lower_FieldSizePayload(*cm.Case[FieldSizePayload](&v, 24)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 26: // HTTP-response-header-section-size - v1, v2 := lower_OptionU32(*cm.Case[cm.Option[uint32]](&v, 26)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 27: // HTTP-response-header-size - v1, v2, v3, v4, v5 := lower_FieldSizePayload(*cm.Case[FieldSizePayload](&v, 27)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 28: // HTTP-response-body-size - v1, v2 := lower_OptionU64(*cm.Case[cm.Option[uint64]](&v, 28)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 29: // HTTP-response-trailer-section-size - v1, v2 := lower_OptionU32(*cm.Case[cm.Option[uint32]](&v, 29)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 30: // HTTP-response-trailer-size - v1, v2, v3, v4, v5 := lower_FieldSizePayload(*cm.Case[FieldSizePayload](&v, 30)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 31: // HTTP-response-transfer-coding - v1, v2, v3 := lower_OptionString(*cm.Case[cm.Option[string]](&v, 31)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - case 32: // HTTP-response-content-coding - v1, v2, v3 := lower_OptionString(*cm.Case[cm.Option[string]](&v, 32)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - case 38: // internal-error - v1, v2, v3 := lower_OptionString(*cm.Case[cm.Option[string]](&v, 38)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - } - return -} - -func lower_ResultOutgoingResponseErrorCode(v cm.Result[ErrorCodeShape, OutgoingResponse, ErrorCode]) (f0 uint32, f1 uint32, f2 uint32, f3 uint64, f4 uint32, f5 uint32, f6 uint32, f7 uint32) { - if v.IsOK() { - v1 := cm.Reinterpret[uint32](*v.OK()) - f1 = (uint32)(v1) - } else { - f0 = 1 - v1, v2, v3, v4, v5, v6, v7 := lower_ErrorCode(*v.Err()) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint64)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - f6 = (uint32)(v6) - f7 = (uint32)(v7) - } - return -} - -func lower_OptionTrailers(v cm.Option[Trailers]) (f0 uint32, f1 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := cm.Reinterpret[uint32](*some) - f1 = (uint32)(v1) - } - return -} diff --git a/examples/component/http-server/gen/wasi/http/types/empty.s b/examples/component/http-server/gen/wasi/http/types/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/http/types/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/http/types/types.wasm.go b/examples/component/http-server/gen/wasi/http/types/types.wasm.go deleted file mode 100755 index 584e55ae..00000000 --- a/examples/component/http-server/gen/wasi/http/types/types.wasm.go +++ /dev/null @@ -1,257 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package types - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:http@0.2.0". - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]fields -//go:noescape -func wasmimport_FieldsResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [constructor]fields -//go:noescape -func wasmimport_NewFields() - -//go:wasmimport wasi:http/types@0.2.0 [static]fields.from-list -//go:noescape -func wasmimport_FieldsFromList(entries0 *cm.Tuple[FieldKey, FieldValue], entries1 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.append -//go:noescape -func wasmimport_FieldsAppend(self0 uint32, name0 *uint8, name1 uint32, value0 *uint8, value1 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.clone -//go:noescape -func wasmimport_FieldsClone(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.delete -//go:noescape -func wasmimport_FieldsDelete(self0 uint32, name0 *uint8, name1 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.entries -//go:noescape -func wasmimport_FieldsEntries(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.get -//go:noescape -func wasmimport_FieldsGet(self0 uint32, name0 *uint8, name1 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.has -//go:noescape -func wasmimport_FieldsHas(self0 uint32, name0 *uint8, name1 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.set -//go:noescape -func wasmimport_FieldsSet(self0 uint32, name0 *uint8, name1 uint32, value0 *FieldValue, value1 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]incoming-request -//go:noescape -func wasmimport_IncomingRequestResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.authority -//go:noescape -func wasmimport_IncomingRequestAuthority(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.consume -//go:noescape -func wasmimport_IncomingRequestConsume(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.headers -//go:noescape -func wasmimport_IncomingRequestHeaders(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.method -//go:noescape -func wasmimport_IncomingRequestMethod(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.path-with-query -//go:noescape -func wasmimport_IncomingRequestPathWithQuery(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.scheme -//go:noescape -func wasmimport_IncomingRequestScheme(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]outgoing-request -//go:noescape -func wasmimport_OutgoingRequestResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [constructor]outgoing-request -//go:noescape -func wasmimport_NewOutgoingRequest(headers0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.authority -//go:noescape -func wasmimport_OutgoingRequestAuthority(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.body -//go:noescape -func wasmimport_OutgoingRequestBody(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.headers -//go:noescape -func wasmimport_OutgoingRequestHeaders(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.method -//go:noescape -func wasmimport_OutgoingRequestMethod(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.path-with-query -//go:noescape -func wasmimport_OutgoingRequestPathWithQuery(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.scheme -//go:noescape -func wasmimport_OutgoingRequestScheme(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-authority -//go:noescape -func wasmimport_OutgoingRequestSetAuthority(self0 uint32, authority0 uint32, authority1 *uint8, authority2 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-method -//go:noescape -func wasmimport_OutgoingRequestSetMethod(self0 uint32, method0 uint32, method1 *uint8, method2 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-path-with-query -//go:noescape -func wasmimport_OutgoingRequestSetPathWithQuery(self0 uint32, pathWithQuery0 uint32, pathWithQuery1 *uint8, pathWithQuery2 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-scheme -//go:noescape -func wasmimport_OutgoingRequestSetScheme(self0 uint32, scheme0 uint32, scheme1 uint32, scheme2 *uint8, scheme3 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]request-options -//go:noescape -func wasmimport_RequestOptionsResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [constructor]request-options -//go:noescape -func wasmimport_NewRequestOptions() - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.between-bytes-timeout -//go:noescape -func wasmimport_RequestOptionsBetweenBytesTimeout(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.connect-timeout -//go:noescape -func wasmimport_RequestOptionsConnectTimeout(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.first-byte-timeout -//go:noescape -func wasmimport_RequestOptionsFirstByteTimeout(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.set-between-bytes-timeout -//go:noescape -func wasmimport_RequestOptionsSetBetweenBytesTimeout(self0 uint32, duration0 uint32, duration1 uint64) - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.set-connect-timeout -//go:noescape -func wasmimport_RequestOptionsSetConnectTimeout(self0 uint32, duration0 uint32, duration1 uint64) - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.set-first-byte-timeout -//go:noescape -func wasmimport_RequestOptionsSetFirstByteTimeout(self0 uint32, duration0 uint32, duration1 uint64) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]response-outparam -//go:noescape -func wasmimport_ResponseOutparamResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [static]response-outparam.set -//go:noescape -func wasmimport_ResponseOutparamSet(param0 uint32, response0 uint32, response1 uint32, response2 uint32, response3 uint64, response4 uint32, response5 uint32, response6 uint32, response7 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]incoming-response -//go:noescape -func wasmimport_IncomingResponseResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-response.consume -//go:noescape -func wasmimport_IncomingResponseConsume(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-response.headers -//go:noescape -func wasmimport_IncomingResponseHeaders(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-response.status -//go:noescape -func wasmimport_IncomingResponseStatus(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]incoming-body -//go:noescape -func wasmimport_IncomingBodyResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [static]incoming-body.finish -//go:noescape -func wasmimport_IncomingBodyFinish(this0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-body.stream -//go:noescape -func wasmimport_IncomingBodyStream(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]future-trailers -//go:noescape -func wasmimport_FutureTrailersResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]future-trailers.get -//go:noescape -func wasmimport_FutureTrailersGet(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]future-trailers.subscribe -//go:noescape -func wasmimport_FutureTrailersSubscribe(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]outgoing-response -//go:noescape -func wasmimport_OutgoingResponseResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [constructor]outgoing-response -//go:noescape -func wasmimport_NewOutgoingResponse(headers0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.body -//go:noescape -func wasmimport_OutgoingResponseBody(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.headers -//go:noescape -func wasmimport_OutgoingResponseHeaders(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.set-status-code -//go:noescape -func wasmimport_OutgoingResponseSetStatusCode(self0 uint32, statusCode0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.status-code -//go:noescape -func wasmimport_OutgoingResponseStatusCode(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]outgoing-body -//go:noescape -func wasmimport_OutgoingBodyResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [static]outgoing-body.finish -//go:noescape -func wasmimport_OutgoingBodyFinish(this0 uint32, trailers0 uint32, trailers1 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-body.write -//go:noescape -func wasmimport_OutgoingBodyWrite(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]future-incoming-response -//go:noescape -func wasmimport_FutureIncomingResponseResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]future-incoming-response.get -//go:noescape -func wasmimport_FutureIncomingResponseGet(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]future-incoming-response.subscribe -//go:noescape -func wasmimport_FutureIncomingResponseSubscribe(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 http-error-code -//go:noescape -func wasmimport_HTTPErrorCode(err0 uint32) diff --git a/examples/component/http-server/gen/wasi/http/types/types.wit.go b/examples/component/http-server/gen/wasi/http/types/types.wit.go deleted file mode 100755 index 33d42273..00000000 --- a/examples/component/http-server/gen/wasi/http/types/types.wit.go +++ /dev/null @@ -1,1982 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package types represents the imported interface "wasi:http/types@0.2.0". -// -// This interface defines all of the types and methods for implementing -// HTTP Requests and Responses, both incoming and outgoing, as well as -// their headers, trailers, and bodies. -package types - -import ( - monotonicclock "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/clocks/monotonic-clock" - ioerror "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/io/error" - "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/io/poll" - "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/io/streams" - "go.bytecodealliance.org/cm" -) - -// Duration represents the type alias "wasi:http/types@0.2.0#duration". -// -// See [monotonicclock.Duration] for more information. -type Duration = monotonicclock.Duration - -// InputStream represents the imported type alias "wasi:http/types@0.2.0#input-stream". -// -// See [streams.InputStream] for more information. -type InputStream = streams.InputStream - -// OutputStream represents the imported type alias "wasi:http/types@0.2.0#output-stream". -// -// See [streams.OutputStream] for more information. -type OutputStream = streams.OutputStream - -// IOError represents the imported type alias "wasi:http/types@0.2.0#io-error". -// -// See [ioerror.Error] for more information. -type IOError = ioerror.Error - -// Pollable represents the imported type alias "wasi:http/types@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// Method represents the variant "wasi:http/types@0.2.0#method". -// -// This type corresponds to HTTP standard Methods. -// -// variant method { -// get, -// head, -// post, -// put, -// delete, -// connect, -// options, -// trace, -// patch, -// other(string), -// } -type Method cm.Variant[uint8, string, string] - -// MethodGet returns a [Method] of case "get". -func MethodGet() Method { - var data struct{} - return cm.New[Method](0, data) -} - -// Get returns true if [Method] represents the variant case "get". -func (self *Method) Get() bool { - return self.Tag() == 0 -} - -// MethodHead returns a [Method] of case "head". -func MethodHead() Method { - var data struct{} - return cm.New[Method](1, data) -} - -// Head returns true if [Method] represents the variant case "head". -func (self *Method) Head() bool { - return self.Tag() == 1 -} - -// MethodPost returns a [Method] of case "post". -func MethodPost() Method { - var data struct{} - return cm.New[Method](2, data) -} - -// Post returns true if [Method] represents the variant case "post". -func (self *Method) Post() bool { - return self.Tag() == 2 -} - -// MethodPut returns a [Method] of case "put". -func MethodPut() Method { - var data struct{} - return cm.New[Method](3, data) -} - -// Put returns true if [Method] represents the variant case "put". -func (self *Method) Put() bool { - return self.Tag() == 3 -} - -// MethodDelete returns a [Method] of case "delete". -func MethodDelete() Method { - var data struct{} - return cm.New[Method](4, data) -} - -// Delete returns true if [Method] represents the variant case "delete". -func (self *Method) Delete() bool { - return self.Tag() == 4 -} - -// MethodConnect returns a [Method] of case "connect". -func MethodConnect() Method { - var data struct{} - return cm.New[Method](5, data) -} - -// Connect returns true if [Method] represents the variant case "connect". -func (self *Method) Connect() bool { - return self.Tag() == 5 -} - -// MethodOptions returns a [Method] of case "options". -func MethodOptions() Method { - var data struct{} - return cm.New[Method](6, data) -} - -// Options returns true if [Method] represents the variant case "options". -func (self *Method) Options() bool { - return self.Tag() == 6 -} - -// MethodTrace returns a [Method] of case "trace". -func MethodTrace() Method { - var data struct{} - return cm.New[Method](7, data) -} - -// Trace returns true if [Method] represents the variant case "trace". -func (self *Method) Trace() bool { - return self.Tag() == 7 -} - -// MethodPatch returns a [Method] of case "patch". -func MethodPatch() Method { - var data struct{} - return cm.New[Method](8, data) -} - -// Patch returns true if [Method] represents the variant case "patch". -func (self *Method) Patch() bool { - return self.Tag() == 8 -} - -// MethodOther returns a [Method] of case "other". -func MethodOther(data string) Method { - return cm.New[Method](9, data) -} - -// Other returns a non-nil *[string] if [Method] represents the variant case "other". -func (self *Method) Other() *string { - return cm.Case[string](self, 9) -} - -var stringsMethod = [10]string{ - "get", - "head", - "post", - "put", - "delete", - "connect", - "options", - "trace", - "patch", - "other", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v Method) String() string { - return stringsMethod[v.Tag()] -} - -// Scheme represents the variant "wasi:http/types@0.2.0#scheme". -// -// This type corresponds to HTTP standard Related Schemes. -// -// variant scheme { -// HTTP, -// HTTPS, -// other(string), -// } -type Scheme cm.Variant[uint8, string, string] - -// SchemeHTTP returns a [Scheme] of case "HTTP". -func SchemeHTTP() Scheme { - var data struct{} - return cm.New[Scheme](0, data) -} - -// HTTP returns true if [Scheme] represents the variant case "HTTP". -func (self *Scheme) HTTP() bool { - return self.Tag() == 0 -} - -// SchemeHTTPS returns a [Scheme] of case "HTTPS". -func SchemeHTTPS() Scheme { - var data struct{} - return cm.New[Scheme](1, data) -} - -// HTTPS returns true if [Scheme] represents the variant case "HTTPS". -func (self *Scheme) HTTPS() bool { - return self.Tag() == 1 -} - -// SchemeOther returns a [Scheme] of case "other". -func SchemeOther(data string) Scheme { - return cm.New[Scheme](2, data) -} - -// Other returns a non-nil *[string] if [Scheme] represents the variant case "other". -func (self *Scheme) Other() *string { - return cm.Case[string](self, 2) -} - -var stringsScheme = [3]string{ - "HTTP", - "HTTPS", - "other", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v Scheme) String() string { - return stringsScheme[v.Tag()] -} - -// DNSErrorPayload represents the record "wasi:http/types@0.2.0#DNS-error-payload". -// -// Defines the case payload type for `DNS-error` above: -// -// record DNS-error-payload { -// rcode: option, -// info-code: option, -// } -type DNSErrorPayload struct { - _ cm.HostLayout - Rcode cm.Option[string] - InfoCode cm.Option[uint16] -} - -// TLSAlertReceivedPayload represents the record "wasi:http/types@0.2.0#TLS-alert-received-payload". -// -// Defines the case payload type for `TLS-alert-received` above: -// -// record TLS-alert-received-payload { -// alert-id: option, -// alert-message: option, -// } -type TLSAlertReceivedPayload struct { - _ cm.HostLayout - AlertID cm.Option[uint8] - AlertMessage cm.Option[string] -} - -// FieldSizePayload represents the record "wasi:http/types@0.2.0#field-size-payload". -// -// Defines the case payload type for `HTTP-response-{header,trailer}-size` above: -// -// record field-size-payload { -// field-name: option, -// field-size: option, -// } -type FieldSizePayload struct { - _ cm.HostLayout - FieldName cm.Option[string] - FieldSize cm.Option[uint32] -} - -// ErrorCode represents the variant "wasi:http/types@0.2.0#error-code". -// -// These cases are inspired by the IANA HTTP Proxy Error Types: -// https://www.iana.org/assignments/http-proxy-status/http-proxy-status.xhtml#table-http-proxy-error-types -// -// variant error-code { -// DNS-timeout, -// DNS-error(DNS-error-payload), -// destination-not-found, -// destination-unavailable, -// destination-IP-prohibited, -// destination-IP-unroutable, -// connection-refused, -// connection-terminated, -// connection-timeout, -// connection-read-timeout, -// connection-write-timeout, -// connection-limit-reached, -// TLS-protocol-error, -// TLS-certificate-error, -// TLS-alert-received(TLS-alert-received-payload), -// HTTP-request-denied, -// HTTP-request-length-required, -// HTTP-request-body-size(option), -// HTTP-request-method-invalid, -// HTTP-request-URI-invalid, -// HTTP-request-URI-too-long, -// HTTP-request-header-section-size(option), -// HTTP-request-header-size(option), -// HTTP-request-trailer-section-size(option), -// HTTP-request-trailer-size(field-size-payload), -// HTTP-response-incomplete, -// HTTP-response-header-section-size(option), -// HTTP-response-header-size(field-size-payload), -// HTTP-response-body-size(option), -// HTTP-response-trailer-section-size(option), -// HTTP-response-trailer-size(field-size-payload), -// HTTP-response-transfer-coding(option), -// HTTP-response-content-coding(option), -// HTTP-response-timeout, -// HTTP-upgrade-failed, -// HTTP-protocol-error, -// loop-detected, -// configuration-error, -// internal-error(option), -// } -type ErrorCode cm.Variant[uint8, OptionFieldSizePayloadShape, cm.Option[uint64]] - -// ErrorCodeDNSTimeout returns a [ErrorCode] of case "DNS-timeout". -func ErrorCodeDNSTimeout() ErrorCode { - var data struct{} - return cm.New[ErrorCode](0, data) -} - -// DNSTimeout returns true if [ErrorCode] represents the variant case "DNS-timeout". -func (self *ErrorCode) DNSTimeout() bool { - return self.Tag() == 0 -} - -// ErrorCodeDNSError returns a [ErrorCode] of case "DNS-error". -func ErrorCodeDNSError(data DNSErrorPayload) ErrorCode { - return cm.New[ErrorCode](1, data) -} - -// DNSError returns a non-nil *[DNSErrorPayload] if [ErrorCode] represents the variant case "DNS-error". -func (self *ErrorCode) DNSError() *DNSErrorPayload { - return cm.Case[DNSErrorPayload](self, 1) -} - -// ErrorCodeDestinationNotFound returns a [ErrorCode] of case "destination-not-found". -func ErrorCodeDestinationNotFound() ErrorCode { - var data struct{} - return cm.New[ErrorCode](2, data) -} - -// DestinationNotFound returns true if [ErrorCode] represents the variant case "destination-not-found". -func (self *ErrorCode) DestinationNotFound() bool { - return self.Tag() == 2 -} - -// ErrorCodeDestinationUnavailable returns a [ErrorCode] of case "destination-unavailable". -func ErrorCodeDestinationUnavailable() ErrorCode { - var data struct{} - return cm.New[ErrorCode](3, data) -} - -// DestinationUnavailable returns true if [ErrorCode] represents the variant case "destination-unavailable". -func (self *ErrorCode) DestinationUnavailable() bool { - return self.Tag() == 3 -} - -// ErrorCodeDestinationIPProhibited returns a [ErrorCode] of case "destination-IP-prohibited". -func ErrorCodeDestinationIPProhibited() ErrorCode { - var data struct{} - return cm.New[ErrorCode](4, data) -} - -// DestinationIPProhibited returns true if [ErrorCode] represents the variant case "destination-IP-prohibited". -func (self *ErrorCode) DestinationIPProhibited() bool { - return self.Tag() == 4 -} - -// ErrorCodeDestinationIPUnroutable returns a [ErrorCode] of case "destination-IP-unroutable". -func ErrorCodeDestinationIPUnroutable() ErrorCode { - var data struct{} - return cm.New[ErrorCode](5, data) -} - -// DestinationIPUnroutable returns true if [ErrorCode] represents the variant case "destination-IP-unroutable". -func (self *ErrorCode) DestinationIPUnroutable() bool { - return self.Tag() == 5 -} - -// ErrorCodeConnectionRefused returns a [ErrorCode] of case "connection-refused". -func ErrorCodeConnectionRefused() ErrorCode { - var data struct{} - return cm.New[ErrorCode](6, data) -} - -// ConnectionRefused returns true if [ErrorCode] represents the variant case "connection-refused". -func (self *ErrorCode) ConnectionRefused() bool { - return self.Tag() == 6 -} - -// ErrorCodeConnectionTerminated returns a [ErrorCode] of case "connection-terminated". -func ErrorCodeConnectionTerminated() ErrorCode { - var data struct{} - return cm.New[ErrorCode](7, data) -} - -// ConnectionTerminated returns true if [ErrorCode] represents the variant case "connection-terminated". -func (self *ErrorCode) ConnectionTerminated() bool { - return self.Tag() == 7 -} - -// ErrorCodeConnectionTimeout returns a [ErrorCode] of case "connection-timeout". -func ErrorCodeConnectionTimeout() ErrorCode { - var data struct{} - return cm.New[ErrorCode](8, data) -} - -// ConnectionTimeout returns true if [ErrorCode] represents the variant case "connection-timeout". -func (self *ErrorCode) ConnectionTimeout() bool { - return self.Tag() == 8 -} - -// ErrorCodeConnectionReadTimeout returns a [ErrorCode] of case "connection-read-timeout". -func ErrorCodeConnectionReadTimeout() ErrorCode { - var data struct{} - return cm.New[ErrorCode](9, data) -} - -// ConnectionReadTimeout returns true if [ErrorCode] represents the variant case "connection-read-timeout". -func (self *ErrorCode) ConnectionReadTimeout() bool { - return self.Tag() == 9 -} - -// ErrorCodeConnectionWriteTimeout returns a [ErrorCode] of case "connection-write-timeout". -func ErrorCodeConnectionWriteTimeout() ErrorCode { - var data struct{} - return cm.New[ErrorCode](10, data) -} - -// ConnectionWriteTimeout returns true if [ErrorCode] represents the variant case "connection-write-timeout". -func (self *ErrorCode) ConnectionWriteTimeout() bool { - return self.Tag() == 10 -} - -// ErrorCodeConnectionLimitReached returns a [ErrorCode] of case "connection-limit-reached". -func ErrorCodeConnectionLimitReached() ErrorCode { - var data struct{} - return cm.New[ErrorCode](11, data) -} - -// ConnectionLimitReached returns true if [ErrorCode] represents the variant case "connection-limit-reached". -func (self *ErrorCode) ConnectionLimitReached() bool { - return self.Tag() == 11 -} - -// ErrorCodeTLSProtocolError returns a [ErrorCode] of case "TLS-protocol-error". -func ErrorCodeTLSProtocolError() ErrorCode { - var data struct{} - return cm.New[ErrorCode](12, data) -} - -// TLSProtocolError returns true if [ErrorCode] represents the variant case "TLS-protocol-error". -func (self *ErrorCode) TLSProtocolError() bool { - return self.Tag() == 12 -} - -// ErrorCodeTLSCertificateError returns a [ErrorCode] of case "TLS-certificate-error". -func ErrorCodeTLSCertificateError() ErrorCode { - var data struct{} - return cm.New[ErrorCode](13, data) -} - -// TLSCertificateError returns true if [ErrorCode] represents the variant case "TLS-certificate-error". -func (self *ErrorCode) TLSCertificateError() bool { - return self.Tag() == 13 -} - -// ErrorCodeTLSAlertReceived returns a [ErrorCode] of case "TLS-alert-received". -func ErrorCodeTLSAlertReceived(data TLSAlertReceivedPayload) ErrorCode { - return cm.New[ErrorCode](14, data) -} - -// TLSAlertReceived returns a non-nil *[TLSAlertReceivedPayload] if [ErrorCode] represents the variant case "TLS-alert-received". -func (self *ErrorCode) TLSAlertReceived() *TLSAlertReceivedPayload { - return cm.Case[TLSAlertReceivedPayload](self, 14) -} - -// ErrorCodeHTTPRequestDenied returns a [ErrorCode] of case "HTTP-request-denied". -func ErrorCodeHTTPRequestDenied() ErrorCode { - var data struct{} - return cm.New[ErrorCode](15, data) -} - -// HTTPRequestDenied returns true if [ErrorCode] represents the variant case "HTTP-request-denied". -func (self *ErrorCode) HTTPRequestDenied() bool { - return self.Tag() == 15 -} - -// ErrorCodeHTTPRequestLengthRequired returns a [ErrorCode] of case "HTTP-request-length-required". -func ErrorCodeHTTPRequestLengthRequired() ErrorCode { - var data struct{} - return cm.New[ErrorCode](16, data) -} - -// HTTPRequestLengthRequired returns true if [ErrorCode] represents the variant case "HTTP-request-length-required". -func (self *ErrorCode) HTTPRequestLengthRequired() bool { - return self.Tag() == 16 -} - -// ErrorCodeHTTPRequestBodySize returns a [ErrorCode] of case "HTTP-request-body-size". -func ErrorCodeHTTPRequestBodySize(data cm.Option[uint64]) ErrorCode { - return cm.New[ErrorCode](17, data) -} - -// HTTPRequestBodySize returns a non-nil *[cm.Option[uint64]] if [ErrorCode] represents the variant case "HTTP-request-body-size". -func (self *ErrorCode) HTTPRequestBodySize() *cm.Option[uint64] { - return cm.Case[cm.Option[uint64]](self, 17) -} - -// ErrorCodeHTTPRequestMethodInvalid returns a [ErrorCode] of case "HTTP-request-method-invalid". -func ErrorCodeHTTPRequestMethodInvalid() ErrorCode { - var data struct{} - return cm.New[ErrorCode](18, data) -} - -// HTTPRequestMethodInvalid returns true if [ErrorCode] represents the variant case "HTTP-request-method-invalid". -func (self *ErrorCode) HTTPRequestMethodInvalid() bool { - return self.Tag() == 18 -} - -// ErrorCodeHTTPRequestURIInvalid returns a [ErrorCode] of case "HTTP-request-URI-invalid". -func ErrorCodeHTTPRequestURIInvalid() ErrorCode { - var data struct{} - return cm.New[ErrorCode](19, data) -} - -// HTTPRequestURIInvalid returns true if [ErrorCode] represents the variant case "HTTP-request-URI-invalid". -func (self *ErrorCode) HTTPRequestURIInvalid() bool { - return self.Tag() == 19 -} - -// ErrorCodeHTTPRequestURITooLong returns a [ErrorCode] of case "HTTP-request-URI-too-long". -func ErrorCodeHTTPRequestURITooLong() ErrorCode { - var data struct{} - return cm.New[ErrorCode](20, data) -} - -// HTTPRequestURITooLong returns true if [ErrorCode] represents the variant case "HTTP-request-URI-too-long". -func (self *ErrorCode) HTTPRequestURITooLong() bool { - return self.Tag() == 20 -} - -// ErrorCodeHTTPRequestHeaderSectionSize returns a [ErrorCode] of case "HTTP-request-header-section-size". -func ErrorCodeHTTPRequestHeaderSectionSize(data cm.Option[uint32]) ErrorCode { - return cm.New[ErrorCode](21, data) -} - -// HTTPRequestHeaderSectionSize returns a non-nil *[cm.Option[uint32]] if [ErrorCode] represents the variant case "HTTP-request-header-section-size". -func (self *ErrorCode) HTTPRequestHeaderSectionSize() *cm.Option[uint32] { - return cm.Case[cm.Option[uint32]](self, 21) -} - -// ErrorCodeHTTPRequestHeaderSize returns a [ErrorCode] of case "HTTP-request-header-size". -func ErrorCodeHTTPRequestHeaderSize(data cm.Option[FieldSizePayload]) ErrorCode { - return cm.New[ErrorCode](22, data) -} - -// HTTPRequestHeaderSize returns a non-nil *[cm.Option[FieldSizePayload]] if [ErrorCode] represents the variant case "HTTP-request-header-size". -func (self *ErrorCode) HTTPRequestHeaderSize() *cm.Option[FieldSizePayload] { - return cm.Case[cm.Option[FieldSizePayload]](self, 22) -} - -// ErrorCodeHTTPRequestTrailerSectionSize returns a [ErrorCode] of case "HTTP-request-trailer-section-size". -func ErrorCodeHTTPRequestTrailerSectionSize(data cm.Option[uint32]) ErrorCode { - return cm.New[ErrorCode](23, data) -} - -// HTTPRequestTrailerSectionSize returns a non-nil *[cm.Option[uint32]] if [ErrorCode] represents the variant case "HTTP-request-trailer-section-size". -func (self *ErrorCode) HTTPRequestTrailerSectionSize() *cm.Option[uint32] { - return cm.Case[cm.Option[uint32]](self, 23) -} - -// ErrorCodeHTTPRequestTrailerSize returns a [ErrorCode] of case "HTTP-request-trailer-size". -func ErrorCodeHTTPRequestTrailerSize(data FieldSizePayload) ErrorCode { - return cm.New[ErrorCode](24, data) -} - -// HTTPRequestTrailerSize returns a non-nil *[FieldSizePayload] if [ErrorCode] represents the variant case "HTTP-request-trailer-size". -func (self *ErrorCode) HTTPRequestTrailerSize() *FieldSizePayload { - return cm.Case[FieldSizePayload](self, 24) -} - -// ErrorCodeHTTPResponseIncomplete returns a [ErrorCode] of case "HTTP-response-incomplete". -func ErrorCodeHTTPResponseIncomplete() ErrorCode { - var data struct{} - return cm.New[ErrorCode](25, data) -} - -// HTTPResponseIncomplete returns true if [ErrorCode] represents the variant case "HTTP-response-incomplete". -func (self *ErrorCode) HTTPResponseIncomplete() bool { - return self.Tag() == 25 -} - -// ErrorCodeHTTPResponseHeaderSectionSize returns a [ErrorCode] of case "HTTP-response-header-section-size". -func ErrorCodeHTTPResponseHeaderSectionSize(data cm.Option[uint32]) ErrorCode { - return cm.New[ErrorCode](26, data) -} - -// HTTPResponseHeaderSectionSize returns a non-nil *[cm.Option[uint32]] if [ErrorCode] represents the variant case "HTTP-response-header-section-size". -func (self *ErrorCode) HTTPResponseHeaderSectionSize() *cm.Option[uint32] { - return cm.Case[cm.Option[uint32]](self, 26) -} - -// ErrorCodeHTTPResponseHeaderSize returns a [ErrorCode] of case "HTTP-response-header-size". -func ErrorCodeHTTPResponseHeaderSize(data FieldSizePayload) ErrorCode { - return cm.New[ErrorCode](27, data) -} - -// HTTPResponseHeaderSize returns a non-nil *[FieldSizePayload] if [ErrorCode] represents the variant case "HTTP-response-header-size". -func (self *ErrorCode) HTTPResponseHeaderSize() *FieldSizePayload { - return cm.Case[FieldSizePayload](self, 27) -} - -// ErrorCodeHTTPResponseBodySize returns a [ErrorCode] of case "HTTP-response-body-size". -func ErrorCodeHTTPResponseBodySize(data cm.Option[uint64]) ErrorCode { - return cm.New[ErrorCode](28, data) -} - -// HTTPResponseBodySize returns a non-nil *[cm.Option[uint64]] if [ErrorCode] represents the variant case "HTTP-response-body-size". -func (self *ErrorCode) HTTPResponseBodySize() *cm.Option[uint64] { - return cm.Case[cm.Option[uint64]](self, 28) -} - -// ErrorCodeHTTPResponseTrailerSectionSize returns a [ErrorCode] of case "HTTP-response-trailer-section-size". -func ErrorCodeHTTPResponseTrailerSectionSize(data cm.Option[uint32]) ErrorCode { - return cm.New[ErrorCode](29, data) -} - -// HTTPResponseTrailerSectionSize returns a non-nil *[cm.Option[uint32]] if [ErrorCode] represents the variant case "HTTP-response-trailer-section-size". -func (self *ErrorCode) HTTPResponseTrailerSectionSize() *cm.Option[uint32] { - return cm.Case[cm.Option[uint32]](self, 29) -} - -// ErrorCodeHTTPResponseTrailerSize returns a [ErrorCode] of case "HTTP-response-trailer-size". -func ErrorCodeHTTPResponseTrailerSize(data FieldSizePayload) ErrorCode { - return cm.New[ErrorCode](30, data) -} - -// HTTPResponseTrailerSize returns a non-nil *[FieldSizePayload] if [ErrorCode] represents the variant case "HTTP-response-trailer-size". -func (self *ErrorCode) HTTPResponseTrailerSize() *FieldSizePayload { - return cm.Case[FieldSizePayload](self, 30) -} - -// ErrorCodeHTTPResponseTransferCoding returns a [ErrorCode] of case "HTTP-response-transfer-coding". -func ErrorCodeHTTPResponseTransferCoding(data cm.Option[string]) ErrorCode { - return cm.New[ErrorCode](31, data) -} - -// HTTPResponseTransferCoding returns a non-nil *[cm.Option[string]] if [ErrorCode] represents the variant case "HTTP-response-transfer-coding". -func (self *ErrorCode) HTTPResponseTransferCoding() *cm.Option[string] { - return cm.Case[cm.Option[string]](self, 31) -} - -// ErrorCodeHTTPResponseContentCoding returns a [ErrorCode] of case "HTTP-response-content-coding". -func ErrorCodeHTTPResponseContentCoding(data cm.Option[string]) ErrorCode { - return cm.New[ErrorCode](32, data) -} - -// HTTPResponseContentCoding returns a non-nil *[cm.Option[string]] if [ErrorCode] represents the variant case "HTTP-response-content-coding". -func (self *ErrorCode) HTTPResponseContentCoding() *cm.Option[string] { - return cm.Case[cm.Option[string]](self, 32) -} - -// ErrorCodeHTTPResponseTimeout returns a [ErrorCode] of case "HTTP-response-timeout". -func ErrorCodeHTTPResponseTimeout() ErrorCode { - var data struct{} - return cm.New[ErrorCode](33, data) -} - -// HTTPResponseTimeout returns true if [ErrorCode] represents the variant case "HTTP-response-timeout". -func (self *ErrorCode) HTTPResponseTimeout() bool { - return self.Tag() == 33 -} - -// ErrorCodeHTTPUpgradeFailed returns a [ErrorCode] of case "HTTP-upgrade-failed". -func ErrorCodeHTTPUpgradeFailed() ErrorCode { - var data struct{} - return cm.New[ErrorCode](34, data) -} - -// HTTPUpgradeFailed returns true if [ErrorCode] represents the variant case "HTTP-upgrade-failed". -func (self *ErrorCode) HTTPUpgradeFailed() bool { - return self.Tag() == 34 -} - -// ErrorCodeHTTPProtocolError returns a [ErrorCode] of case "HTTP-protocol-error". -func ErrorCodeHTTPProtocolError() ErrorCode { - var data struct{} - return cm.New[ErrorCode](35, data) -} - -// HTTPProtocolError returns true if [ErrorCode] represents the variant case "HTTP-protocol-error". -func (self *ErrorCode) HTTPProtocolError() bool { - return self.Tag() == 35 -} - -// ErrorCodeLoopDetected returns a [ErrorCode] of case "loop-detected". -func ErrorCodeLoopDetected() ErrorCode { - var data struct{} - return cm.New[ErrorCode](36, data) -} - -// LoopDetected returns true if [ErrorCode] represents the variant case "loop-detected". -func (self *ErrorCode) LoopDetected() bool { - return self.Tag() == 36 -} - -// ErrorCodeConfigurationError returns a [ErrorCode] of case "configuration-error". -func ErrorCodeConfigurationError() ErrorCode { - var data struct{} - return cm.New[ErrorCode](37, data) -} - -// ConfigurationError returns true if [ErrorCode] represents the variant case "configuration-error". -func (self *ErrorCode) ConfigurationError() bool { - return self.Tag() == 37 -} - -// ErrorCodeInternalError returns a [ErrorCode] of case "internal-error". -// -// This is a catch-all error for anything that doesn't fit cleanly into a -// more specific case. It also includes an optional string for an -// unstructured description of the error. Users should not depend on the -// string for diagnosing errors, as it's not required to be consistent -// between implementations. -func ErrorCodeInternalError(data cm.Option[string]) ErrorCode { - return cm.New[ErrorCode](38, data) -} - -// InternalError returns a non-nil *[cm.Option[string]] if [ErrorCode] represents the variant case "internal-error". -func (self *ErrorCode) InternalError() *cm.Option[string] { - return cm.Case[cm.Option[string]](self, 38) -} - -var stringsErrorCode = [39]string{ - "DNS-timeout", - "DNS-error", - "destination-not-found", - "destination-unavailable", - "destination-IP-prohibited", - "destination-IP-unroutable", - "connection-refused", - "connection-terminated", - "connection-timeout", - "connection-read-timeout", - "connection-write-timeout", - "connection-limit-reached", - "TLS-protocol-error", - "TLS-certificate-error", - "TLS-alert-received", - "HTTP-request-denied", - "HTTP-request-length-required", - "HTTP-request-body-size", - "HTTP-request-method-invalid", - "HTTP-request-URI-invalid", - "HTTP-request-URI-too-long", - "HTTP-request-header-section-size", - "HTTP-request-header-size", - "HTTP-request-trailer-section-size", - "HTTP-request-trailer-size", - "HTTP-response-incomplete", - "HTTP-response-header-section-size", - "HTTP-response-header-size", - "HTTP-response-body-size", - "HTTP-response-trailer-section-size", - "HTTP-response-trailer-size", - "HTTP-response-transfer-coding", - "HTTP-response-content-coding", - "HTTP-response-timeout", - "HTTP-upgrade-failed", - "HTTP-protocol-error", - "loop-detected", - "configuration-error", - "internal-error", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v ErrorCode) String() string { - return stringsErrorCode[v.Tag()] -} - -// HeaderError represents the variant "wasi:http/types@0.2.0#header-error". -// -// This type enumerates the different kinds of errors that may occur when -// setting or appending to a `fields` resource. -// -// variant header-error { -// invalid-syntax, -// forbidden, -// immutable, -// } -type HeaderError uint8 - -const ( - // This error indicates that a `field-key` or `field-value` was - // syntactically invalid when used with an operation that sets headers in a - // `fields`. - HeaderErrorInvalidSyntax HeaderError = iota - - // This error indicates that a forbidden `field-key` was used when trying - // to set a header in a `fields`. - HeaderErrorForbidden - - // This error indicates that the operation on the `fields` was not - // permitted because the fields are immutable. - HeaderErrorImmutable -) - -var stringsHeaderError = [3]string{ - "invalid-syntax", - "forbidden", - "immutable", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e HeaderError) String() string { - return stringsHeaderError[e] -} - -// FieldKey represents the string "wasi:http/types@0.2.0#field-key". -// -// Field keys are always strings. -// -// type field-key = string -type FieldKey string - -// FieldValue represents the list "wasi:http/types@0.2.0#field-value". -// -// Field values should always be ASCII strings. However, in -// reality, HTTP implementations often have to interpret malformed values, -// so they are provided as a list of bytes. -// -// type field-value = list -type FieldValue cm.List[uint8] - -// Fields represents the imported resource "wasi:http/types@0.2.0#fields". -// -// This following block defines the `fields` resource which corresponds to -// HTTP standard Fields. Fields are a common representation used for both -// Headers and Trailers. -// -// A `fields` may be mutable or immutable. A `fields` created using the -// constructor, `from-list`, or `clone` will be mutable, but a `fields` -// resource given by other means (including, but not limited to, -// `incoming-request.headers`, `outgoing-request.headers`) might be be -// immutable. In an immutable fields, the `set`, `append`, and `delete` -// operations will fail with `header-error.immutable`. -// -// resource fields -type Fields cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "fields". -// -// Drops a resource handle. -// -//go:nosplit -func (self Fields) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FieldsResourceDrop((uint32)(self0)) - return -} - -// NewFields represents the imported constructor for resource "fields". -// -// Construct an empty HTTP Fields. -// -// The resulting `fields` is mutable. -// -// constructor() -// -//go:nosplit -func NewFields() { - wasmimport_NewFields() - return -} - -// FieldsFromList represents the imported static function "from-list". -// -// Construct an HTTP Fields. -// -// The resulting `fields` is mutable. -// -// The list represents each key-value pair in the Fields. Keys -// which have multiple values are represented by multiple entries in this -// list with the same key. -// -// The tuple is a pair of the field key, represented as a string, and -// Value, represented as a list of bytes. In a valid Fields, all keys -// and values are valid UTF-8 strings. However, values are not always -// well-formed, so they are represented as a raw list of bytes. -// -// An error result will be returned if any header or value was -// syntactically invalid, or if a header was forbidden. -// -// from-list: static func(entries: list>) -// -//go:nosplit -func FieldsFromList(entries cm.List[cm.Tuple[FieldKey, FieldValue]]) { - entries0, entries1 := cm.LowerList(entries) - wasmimport_FieldsFromList((*cm.Tuple[FieldKey, FieldValue])(entries0), (uint32)(entries1)) - return -} - -// Append represents the imported method "append". -// -// Append a value for a key. Does not change or delete any existing -// values for that key. -// -// Fails with `header-error.immutable` if the `fields` are immutable. -// -// append: func(name: field-key, value: field-value) -// -//go:nosplit -func (self Fields) Append(name FieldKey, value FieldValue) { - self0 := cm.Reinterpret[uint32](self) - name0, name1 := cm.LowerString(name) - value0, value1 := cm.LowerList(value) - wasmimport_FieldsAppend((uint32)(self0), (*uint8)(name0), (uint32)(name1), (*uint8)(value0), (uint32)(value1)) - return -} - -// Clone represents the imported method "clone". -// -// Make a deep copy of the Fields. Equivelant in behavior to calling the -// `fields` constructor on the return value of `entries`. The resulting -// `fields` is mutable. -// -// clone: func() -// -//go:nosplit -func (self Fields) Clone() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FieldsClone((uint32)(self0)) - return -} - -// Delete represents the imported method "delete". -// -// Delete all values for a key. Does nothing if no values for the key -// exist. -// -// Fails with `header-error.immutable` if the `fields` are immutable. -// -// delete: func(name: field-key) -// -//go:nosplit -func (self Fields) Delete(name FieldKey) { - self0 := cm.Reinterpret[uint32](self) - name0, name1 := cm.LowerString(name) - wasmimport_FieldsDelete((uint32)(self0), (*uint8)(name0), (uint32)(name1)) - return -} - -// Entries represents the imported method "entries". -// -// Retrieve the full set of keys and values in the Fields. Like the -// constructor, the list represents each key-value pair. -// -// The outer list represents each key-value pair in the Fields. Keys -// which have multiple values are represented by multiple entries in this -// list with the same key. -// -// entries: func() -// -//go:nosplit -func (self Fields) Entries() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FieldsEntries((uint32)(self0)) - return -} - -// Get represents the imported method "get". -// -// Get all of the values corresponding to a key. If the key is not present -// in this `fields`, an empty list is returned. However, if the key is -// present but empty, this is represented by a list with one or more -// empty field-values present. -// -// get: func(name: field-key) -// -//go:nosplit -func (self Fields) Get(name FieldKey) { - self0 := cm.Reinterpret[uint32](self) - name0, name1 := cm.LowerString(name) - wasmimport_FieldsGet((uint32)(self0), (*uint8)(name0), (uint32)(name1)) - return -} - -// Has represents the imported method "has". -// -// Returns `true` when the key is present in this `fields`. If the key is -// syntactically invalid, `false` is returned. -// -// has: func(name: field-key) -// -//go:nosplit -func (self Fields) Has(name FieldKey) { - self0 := cm.Reinterpret[uint32](self) - name0, name1 := cm.LowerString(name) - wasmimport_FieldsHas((uint32)(self0), (*uint8)(name0), (uint32)(name1)) - return -} - -// Set represents the imported method "set". -// -// Set all of the values for a key. Clears any existing values for that -// key, if they have been set. -// -// Fails with `header-error.immutable` if the `fields` are immutable. -// -// set: func(name: field-key, value: list) -// -//go:nosplit -func (self Fields) Set(name FieldKey, value cm.List[FieldValue]) { - self0 := cm.Reinterpret[uint32](self) - name0, name1 := cm.LowerString(name) - value0, value1 := cm.LowerList(value) - wasmimport_FieldsSet((uint32)(self0), (*uint8)(name0), (uint32)(name1), (*FieldValue)(value0), (uint32)(value1)) - return -} - -// Headers represents the imported type alias "wasi:http/types@0.2.0#headers". -// -// See [Fields] for more information. -type Headers = Fields - -// Trailers represents the imported type alias "wasi:http/types@0.2.0#trailers". -// -// See [Fields] for more information. -type Trailers = Fields - -// IncomingRequest represents the imported resource "wasi:http/types@0.2.0#incoming-request". -// -// Represents an incoming HTTP Request. -// -// resource incoming-request -type IncomingRequest cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "incoming-request". -// -// Drops a resource handle. -// -//go:nosplit -func (self IncomingRequest) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestResourceDrop((uint32)(self0)) - return -} - -// Authority represents the imported method "authority". -// -// Returns the authority from the request, if it was present. -// -// authority: func() -// -//go:nosplit -func (self IncomingRequest) Authority() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestAuthority((uint32)(self0)) - return -} - -// Consume represents the imported method "consume". -// -// Gives the `incoming-body` associated with this request. Will only -// return success at most once, and subsequent calls will return error. -// -// consume: func() -// -//go:nosplit -func (self IncomingRequest) Consume() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestConsume((uint32)(self0)) - return -} - -// Headers represents the imported method "headers". -// -// Get the `headers` associated with the request. -// -// The returned `headers` resource is immutable: `set`, `append`, and -// `delete` operations will fail with `header-error.immutable`. -// -// The `headers` returned are a child resource: it must be dropped before -// the parent `incoming-request` is dropped. Dropping this -// `incoming-request` before all children are dropped will trap. -// -// headers: func() -// -//go:nosplit -func (self IncomingRequest) Headers() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestHeaders((uint32)(self0)) - return -} - -// Method represents the imported method "method". -// -// Returns the method of the incoming request. -// -// method: func() -// -//go:nosplit -func (self IncomingRequest) Method() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestMethod((uint32)(self0)) - return -} - -// PathWithQuery represents the imported method "path-with-query". -// -// Returns the path with query parameters from the request, as a string. -// -// path-with-query: func() -// -//go:nosplit -func (self IncomingRequest) PathWithQuery() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestPathWithQuery((uint32)(self0)) - return -} - -// Scheme represents the imported method "scheme". -// -// Returns the protocol scheme from the request. -// -// scheme: func() -// -//go:nosplit -func (self IncomingRequest) Scheme() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestScheme((uint32)(self0)) - return -} - -// OutgoingRequest represents the imported resource "wasi:http/types@0.2.0#outgoing-request". -// -// Represents an outgoing HTTP Request. -// -// resource outgoing-request -type OutgoingRequest cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "outgoing-request". -// -// Drops a resource handle. -// -//go:nosplit -func (self OutgoingRequest) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestResourceDrop((uint32)(self0)) - return -} - -// NewOutgoingRequest represents the imported constructor for resource "outgoing-request". -// -// Construct a new `outgoing-request` with a default `method` of `GET`, and -// `none` values for `path-with-query`, `scheme`, and `authority`. -// -// * `headers` is the HTTP Headers for the Request. -// -// It is possible to construct, or manipulate with the accessor functions -// below, an `outgoing-request` with an invalid combination of `scheme` -// and `authority`, or `headers` which are not permitted to be sent. -// It is the obligation of the `outgoing-handler.handle` implementation -// to reject invalid constructions of `outgoing-request`. -// -// constructor(headers: headers) -// -//go:nosplit -func NewOutgoingRequest(headers Headers) { - headers0 := cm.Reinterpret[uint32](headers) - wasmimport_NewOutgoingRequest((uint32)(headers0)) - return -} - -// Authority represents the imported method "authority". -// -// Get the HTTP Authority for the Request. A value of `none` may be used -// with Related Schemes which do not require an Authority. The HTTP and -// HTTPS schemes always require an authority. -// -// authority: func() -// -//go:nosplit -func (self OutgoingRequest) Authority() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestAuthority((uint32)(self0)) - return -} - -// Body represents the imported method "body". -// -// Returns the resource corresponding to the outgoing Body for this -// Request. -// -// Returns success on the first call: the `outgoing-body` resource for -// this `outgoing-request` can be retrieved at most once. Subsequent -// calls will return error. -// -// body: func() -// -//go:nosplit -func (self OutgoingRequest) Body() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestBody((uint32)(self0)) - return -} - -// Headers represents the imported method "headers". -// -// Get the headers associated with the Request. -// -// The returned `headers` resource is immutable: `set`, `append`, and -// `delete` operations will fail with `header-error.immutable`. -// -// This headers resource is a child: it must be dropped before the parent -// `outgoing-request` is dropped, or its ownership is transfered to -// another component by e.g. `outgoing-handler.handle`. -// -// headers: func() -// -//go:nosplit -func (self OutgoingRequest) Headers() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestHeaders((uint32)(self0)) - return -} - -// Method represents the imported method "method". -// -// Get the Method for the Request. -// -// method: func() -// -//go:nosplit -func (self OutgoingRequest) Method() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestMethod((uint32)(self0)) - return -} - -// PathWithQuery represents the imported method "path-with-query". -// -// Get the combination of the HTTP Path and Query for the Request. -// When `none`, this represents an empty Path and empty Query. -// -// path-with-query: func() -// -//go:nosplit -func (self OutgoingRequest) PathWithQuery() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestPathWithQuery((uint32)(self0)) - return -} - -// Scheme represents the imported method "scheme". -// -// Get the HTTP Related Scheme for the Request. When `none`, the -// implementation may choose an appropriate default scheme. -// -// scheme: func() -// -//go:nosplit -func (self OutgoingRequest) Scheme() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestScheme((uint32)(self0)) - return -} - -// SetAuthority represents the imported method "set-authority". -// -// Set the HTTP Authority for the Request. A value of `none` may be used -// with Related Schemes which do not require an Authority. The HTTP and -// HTTPS schemes always require an authority. Fails if the string given is -// not a syntactically valid uri authority. -// -// set-authority: func(authority: option) -// -//go:nosplit -func (self OutgoingRequest) SetAuthority(authority cm.Option[string]) { - self0 := cm.Reinterpret[uint32](self) - authority0, authority1, authority2 := lower_OptionString(authority) - wasmimport_OutgoingRequestSetAuthority((uint32)(self0), (uint32)(authority0), (*uint8)(authority1), (uint32)(authority2)) - return -} - -// SetMethod represents the imported method "set-method". -// -// Set the Method for the Request. Fails if the string present in a -// `method.other` argument is not a syntactically valid method. -// -// set-method: func(method: method) -// -//go:nosplit -func (self OutgoingRequest) SetMethod(method Method) { - self0 := cm.Reinterpret[uint32](self) - method0, method1, method2 := lower_Method(method) - wasmimport_OutgoingRequestSetMethod((uint32)(self0), (uint32)(method0), (*uint8)(method1), (uint32)(method2)) - return -} - -// SetPathWithQuery represents the imported method "set-path-with-query". -// -// Set the combination of the HTTP Path and Query for the Request. -// When `none`, this represents an empty Path and empty Query. Fails is the -// string given is not a syntactically valid path and query uri component. -// -// set-path-with-query: func(path-with-query: option) -// -//go:nosplit -func (self OutgoingRequest) SetPathWithQuery(pathWithQuery cm.Option[string]) { - self0 := cm.Reinterpret[uint32](self) - pathWithQuery0, pathWithQuery1, pathWithQuery2 := lower_OptionString(pathWithQuery) - wasmimport_OutgoingRequestSetPathWithQuery((uint32)(self0), (uint32)(pathWithQuery0), (*uint8)(pathWithQuery1), (uint32)(pathWithQuery2)) - return -} - -// SetScheme represents the imported method "set-scheme". -// -// Set the HTTP Related Scheme for the Request. When `none`, the -// implementation may choose an appropriate default scheme. Fails if the -// string given is not a syntactically valid uri scheme. -// -// set-scheme: func(scheme: option) -// -//go:nosplit -func (self OutgoingRequest) SetScheme(scheme cm.Option[Scheme]) { - self0 := cm.Reinterpret[uint32](self) - scheme0, scheme1, scheme2, scheme3 := lower_OptionScheme(scheme) - wasmimport_OutgoingRequestSetScheme((uint32)(self0), (uint32)(scheme0), (uint32)(scheme1), (*uint8)(scheme2), (uint32)(scheme3)) - return -} - -// RequestOptions represents the imported resource "wasi:http/types@0.2.0#request-options". -// -// Parameters for making an HTTP Request. Each of these parameters is -// currently an optional timeout applicable to the transport layer of the -// HTTP protocol. -// -// These timeouts are separate from any the user may use to bound a -// blocking call to `wasi:io/poll.poll`. -// -// resource request-options -type RequestOptions cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "request-options". -// -// Drops a resource handle. -// -//go:nosplit -func (self RequestOptions) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsResourceDrop((uint32)(self0)) - return -} - -// NewRequestOptions represents the imported constructor for resource "request-options". -// -// Construct a default `request-options` value. -// -// constructor() -// -//go:nosplit -func NewRequestOptions() { - wasmimport_NewRequestOptions() - return -} - -// BetweenBytesTimeout represents the imported method "between-bytes-timeout". -// -// The timeout for receiving subsequent chunks of bytes in the Response -// body stream. -// -// between-bytes-timeout: func() -// -//go:nosplit -func (self RequestOptions) BetweenBytesTimeout() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsBetweenBytesTimeout((uint32)(self0)) - return -} - -// ConnectTimeout represents the imported method "connect-timeout". -// -// The timeout for the initial connect to the HTTP Server. -// -// connect-timeout: func() -// -//go:nosplit -func (self RequestOptions) ConnectTimeout() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsConnectTimeout((uint32)(self0)) - return -} - -// FirstByteTimeout represents the imported method "first-byte-timeout". -// -// The timeout for receiving the first byte of the Response body. -// -// first-byte-timeout: func() -// -//go:nosplit -func (self RequestOptions) FirstByteTimeout() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsFirstByteTimeout((uint32)(self0)) - return -} - -// SetBetweenBytesTimeout represents the imported method "set-between-bytes-timeout". -// -// Set the timeout for receiving subsequent chunks of bytes in the Response -// body stream. An error return value indicates that this timeout is not -// supported. -// -// set-between-bytes-timeout: func(duration: option) -// -//go:nosplit -func (self RequestOptions) SetBetweenBytesTimeout(duration cm.Option[Duration]) { - self0 := cm.Reinterpret[uint32](self) - duration0, duration1 := lower_OptionDuration(duration) - wasmimport_RequestOptionsSetBetweenBytesTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) - return -} - -// SetConnectTimeout represents the imported method "set-connect-timeout". -// -// Set the timeout for the initial connect to the HTTP Server. An error -// return value indicates that this timeout is not supported. -// -// set-connect-timeout: func(duration: option) -// -//go:nosplit -func (self RequestOptions) SetConnectTimeout(duration cm.Option[Duration]) { - self0 := cm.Reinterpret[uint32](self) - duration0, duration1 := lower_OptionDuration(duration) - wasmimport_RequestOptionsSetConnectTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) - return -} - -// SetFirstByteTimeout represents the imported method "set-first-byte-timeout". -// -// Set the timeout for receiving the first byte of the Response body. An -// error return value indicates that this timeout is not supported. -// -// set-first-byte-timeout: func(duration: option) -// -//go:nosplit -func (self RequestOptions) SetFirstByteTimeout(duration cm.Option[Duration]) { - self0 := cm.Reinterpret[uint32](self) - duration0, duration1 := lower_OptionDuration(duration) - wasmimport_RequestOptionsSetFirstByteTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) - return -} - -// ResponseOutparam represents the imported resource "wasi:http/types@0.2.0#response-outparam". -// -// Represents the ability to send an HTTP Response. -// -// This resource is used by the `wasi:http/incoming-handler` interface to -// allow a Response to be sent corresponding to the Request provided as the -// other argument to `incoming-handler.handle`. -// -// resource response-outparam -type ResponseOutparam cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "response-outparam". -// -// Drops a resource handle. -// -//go:nosplit -func (self ResponseOutparam) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_ResponseOutparamResourceDrop((uint32)(self0)) - return -} - -// ResponseOutparamSet represents the imported static function "set". -// -// Set the value of the `response-outparam` to either send a response, -// or indicate an error. -// -// This method consumes the `response-outparam` to ensure that it is -// called at most once. If it is never called, the implementation -// will respond with an error. -// -// The user may provide an `error` to `response` to allow the -// implementation determine how to respond with an HTTP error response. -// -// set: static func(param: response-outparam, response: result) -// -//go:nosplit -func ResponseOutparamSet(param ResponseOutparam, response cm.Result[ErrorCodeShape, OutgoingResponse, ErrorCode]) { - param0 := cm.Reinterpret[uint32](param) - response0, response1, response2, response3, response4, response5, response6, response7 := lower_ResultOutgoingResponseErrorCode(response) - wasmimport_ResponseOutparamSet((uint32)(param0), (uint32)(response0), (uint32)(response1), (uint32)(response2), (uint64)(response3), (uint32)(response4), (uint32)(response5), (uint32)(response6), (uint32)(response7)) - return -} - -// StatusCode represents the u16 "wasi:http/types@0.2.0#status-code". -// -// This type corresponds to the HTTP standard Status Code. -// -// type status-code = u16 -type StatusCode uint16 - -// IncomingResponse represents the imported resource "wasi:http/types@0.2.0#incoming-response". -// -// Represents an incoming HTTP Response. -// -// resource incoming-response -type IncomingResponse cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "incoming-response". -// -// Drops a resource handle. -// -//go:nosplit -func (self IncomingResponse) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingResponseResourceDrop((uint32)(self0)) - return -} - -// Consume represents the imported method "consume". -// -// Returns the incoming body. May be called at most once. Returns error -// if called additional times. -// -// consume: func() -// -//go:nosplit -func (self IncomingResponse) Consume() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingResponseConsume((uint32)(self0)) - return -} - -// Headers represents the imported method "headers". -// -// Returns the headers from the incoming response. -// -// The returned `headers` resource is immutable: `set`, `append`, and -// `delete` operations will fail with `header-error.immutable`. -// -// This headers resource is a child: it must be dropped before the parent -// `incoming-response` is dropped. -// -// headers: func() -// -//go:nosplit -func (self IncomingResponse) Headers() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingResponseHeaders((uint32)(self0)) - return -} - -// Status represents the imported method "status". -// -// Returns the status code from the incoming response. -// -// status: func() -// -//go:nosplit -func (self IncomingResponse) Status() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingResponseStatus((uint32)(self0)) - return -} - -// IncomingBody represents the imported resource "wasi:http/types@0.2.0#incoming-body". -// -// Represents an incoming HTTP Request or Response's Body. -// -// A body has both its contents - a stream of bytes - and a (possibly -// empty) set of trailers, indicating that the full contents of the -// body have been received. This resource represents the contents as -// an `input-stream` and the delivery of trailers as a `future-trailers`, -// and ensures that the user of this interface may only be consuming either -// the body contents or waiting on trailers at any given time. -// -// resource incoming-body -type IncomingBody cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "incoming-body". -// -// Drops a resource handle. -// -//go:nosplit -func (self IncomingBody) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingBodyResourceDrop((uint32)(self0)) - return -} - -// IncomingBodyFinish represents the imported static function "finish". -// -// Takes ownership of `incoming-body`, and returns a `future-trailers`. -// This function will trap if the `input-stream` child is still alive. -// -// finish: static func(this: incoming-body) -// -//go:nosplit -func IncomingBodyFinish(this IncomingBody) { - this0 := cm.Reinterpret[uint32](this) - wasmimport_IncomingBodyFinish((uint32)(this0)) - return -} - -// Stream represents the imported method "stream". -// -// Returns the contents of the body, as a stream of bytes. -// -// Returns success on first call: the stream representing the contents -// can be retrieved at most once. Subsequent calls will return error. -// -// The returned `input-stream` resource is a child: it must be dropped -// before the parent `incoming-body` is dropped, or consumed by -// `incoming-body.finish`. -// -// This invariant ensures that the implementation can determine whether -// the user is consuming the contents of the body, waiting on the -// `future-trailers` to be ready, or neither. This allows for network -// backpressure is to be applied when the user is consuming the body, -// and for that backpressure to not inhibit delivery of the trailers if -// the user does not read the entire body. -// -// %stream: func() -// -//go:nosplit -func (self IncomingBody) Stream() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingBodyStream((uint32)(self0)) - return -} - -// FutureTrailers represents the imported resource "wasi:http/types@0.2.0#future-trailers". -// -// Represents a future which may eventaully return trailers, or an error. -// -// In the case that the incoming HTTP Request or Response did not have any -// trailers, this future will resolve to the empty set of trailers once the -// complete Request or Response body has been received. -// -// resource future-trailers -type FutureTrailers cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "future-trailers". -// -// Drops a resource handle. -// -//go:nosplit -func (self FutureTrailers) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureTrailersResourceDrop((uint32)(self0)) - return -} - -// Get represents the imported method "get". -// -// Returns the contents of the trailers, or an error which occured, -// once the future is ready. -// -// The outer `option` represents future readiness. Users can wait on this -// `option` to become `some` using the `subscribe` method. -// -// The outer `result` is used to retrieve the trailers or error at most -// once. It will be success on the first call in which the outer option -// is `some`, and error on subsequent calls. -// -// The inner `result` represents that either the HTTP Request or Response -// body, as well as any trailers, were received successfully, or that an -// error occured receiving them. The optional `trailers` indicates whether -// or not trailers were present in the body. -// -// When some `trailers` are returned by this method, the `trailers` -// resource is immutable, and a child. Use of the `set`, `append`, or -// `delete` methods will return an error, and the resource must be -// dropped before the parent `future-trailers` is dropped. -// -// get: func() -// -//go:nosplit -func (self FutureTrailers) Get() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureTrailersGet((uint32)(self0)) - return -} - -// Subscribe represents the imported method "subscribe". -// -// Returns a pollable which becomes ready when either the trailers have -// been received, or an error has occured. When this pollable is ready, -// the `get` method will return `some`. -// -// subscribe: func() -// -//go:nosplit -func (self FutureTrailers) Subscribe() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureTrailersSubscribe((uint32)(self0)) - return -} - -// OutgoingResponse represents the imported resource "wasi:http/types@0.2.0#outgoing-response". -// -// Represents an outgoing HTTP Response. -// -// resource outgoing-response -type OutgoingResponse cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "outgoing-response". -// -// Drops a resource handle. -// -//go:nosplit -func (self OutgoingResponse) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingResponseResourceDrop((uint32)(self0)) - return -} - -// NewOutgoingResponse represents the imported constructor for resource "outgoing-response". -// -// Construct an `outgoing-response`, with a default `status-code` of `200`. -// If a different `status-code` is needed, it must be set via the -// `set-status-code` method. -// -// * `headers` is the HTTP Headers for the Response. -// -// constructor(headers: headers) -// -//go:nosplit -func NewOutgoingResponse(headers Headers) { - headers0 := cm.Reinterpret[uint32](headers) - wasmimport_NewOutgoingResponse((uint32)(headers0)) - return -} - -// Body represents the imported method "body". -// -// Returns the resource corresponding to the outgoing Body for this Response. -// -// Returns success on the first call: the `outgoing-body` resource for -// this `outgoing-response` can be retrieved at most once. Subsequent -// calls will return error. -// -// body: func() -// -//go:nosplit -func (self OutgoingResponse) Body() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingResponseBody((uint32)(self0)) - return -} - -// Headers represents the imported method "headers". -// -// Get the headers associated with the Request. -// -// The returned `headers` resource is immutable: `set`, `append`, and -// `delete` operations will fail with `header-error.immutable`. -// -// This headers resource is a child: it must be dropped before the parent -// `outgoing-request` is dropped, or its ownership is transfered to -// another component by e.g. `outgoing-handler.handle`. -// -// headers: func() -// -//go:nosplit -func (self OutgoingResponse) Headers() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingResponseHeaders((uint32)(self0)) - return -} - -// SetStatusCode represents the imported method "set-status-code". -// -// Set the HTTP Status Code for the Response. Fails if the status-code -// given is not a valid http status code. -// -// set-status-code: func(status-code: status-code) -// -//go:nosplit -func (self OutgoingResponse) SetStatusCode(statusCode StatusCode) { - self0 := cm.Reinterpret[uint32](self) - statusCode0 := (uint32)(statusCode) - wasmimport_OutgoingResponseSetStatusCode((uint32)(self0), (uint32)(statusCode0)) - return -} - -// StatusCode represents the imported method "status-code". -// -// Get the HTTP Status Code for the Response. -// -// status-code: func() -// -//go:nosplit -func (self OutgoingResponse) StatusCode() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingResponseStatusCode((uint32)(self0)) - return -} - -// OutgoingBody represents the imported resource "wasi:http/types@0.2.0#outgoing-body". -// -// Represents an outgoing HTTP Request or Response's Body. -// -// A body has both its contents - a stream of bytes - and a (possibly -// empty) set of trailers, inducating the full contents of the body -// have been sent. This resource represents the contents as an -// `output-stream` child resource, and the completion of the body (with -// optional trailers) with a static function that consumes the -// `outgoing-body` resource, and ensures that the user of this interface -// may not write to the body contents after the body has been finished. -// -// If the user code drops this resource, as opposed to calling the static -// method `finish`, the implementation should treat the body as incomplete, -// and that an error has occured. The implementation should propogate this -// error to the HTTP protocol by whatever means it has available, -// including: corrupting the body on the wire, aborting the associated -// Request, or sending a late status code for the Response. -// -// resource outgoing-body -type OutgoingBody cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "outgoing-body". -// -// Drops a resource handle. -// -//go:nosplit -func (self OutgoingBody) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingBodyResourceDrop((uint32)(self0)) - return -} - -// OutgoingBodyFinish represents the imported static function "finish". -// -// Finalize an outgoing body, optionally providing trailers. This must be -// called to signal that the response is complete. If the `outgoing-body` -// is dropped without calling `outgoing-body.finalize`, the implementation -// should treat the body as corrupted. -// -// Fails if the body's `outgoing-request` or `outgoing-response` was -// constructed with a Content-Length header, and the contents written -// to the body (via `write`) does not match the value given in the -// Content-Length. -// -// finish: static func(this: outgoing-body, trailers: option) -// -//go:nosplit -func OutgoingBodyFinish(this OutgoingBody, trailers cm.Option[Trailers]) { - this0 := cm.Reinterpret[uint32](this) - trailers0, trailers1 := lower_OptionTrailers(trailers) - wasmimport_OutgoingBodyFinish((uint32)(this0), (uint32)(trailers0), (uint32)(trailers1)) - return -} - -// Write represents the imported method "write". -// -// Returns a stream for writing the body contents. -// -// The returned `output-stream` is a child resource: it must be dropped -// before the parent `outgoing-body` resource is dropped (or finished), -// otherwise the `outgoing-body` drop or `finish` will trap. -// -// Returns success on the first call: the `output-stream` resource for -// this `outgoing-body` may be retrieved at most once. Subsequent calls -// will return error. -// -// write: func() -// -//go:nosplit -func (self OutgoingBody) Write() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingBodyWrite((uint32)(self0)) - return -} - -// FutureIncomingResponse represents the imported resource "wasi:http/types@0.2.0#future-incoming-response". -// -// Represents a future which may eventaully return an incoming HTTP -// Response, or an error. -// -// This resource is returned by the `wasi:http/outgoing-handler` interface to -// provide the HTTP Response corresponding to the sent Request. -// -// resource future-incoming-response -type FutureIncomingResponse cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "future-incoming-response". -// -// Drops a resource handle. -// -//go:nosplit -func (self FutureIncomingResponse) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureIncomingResponseResourceDrop((uint32)(self0)) - return -} - -// Get represents the imported method "get". -// -// Returns the incoming HTTP Response, or an error, once one is ready. -// -// The outer `option` represents future readiness. Users can wait on this -// `option` to become `some` using the `subscribe` method. -// -// The outer `result` is used to retrieve the response or error at most -// once. It will be success on the first call in which the outer option -// is `some`, and error on subsequent calls. -// -// The inner `result` represents that either the incoming HTTP Response -// status and headers have recieved successfully, or that an error -// occured. Errors may also occur while consuming the response body, -// but those will be reported by the `incoming-body` and its -// `output-stream` child. -// -// get: func() -// -//go:nosplit -func (self FutureIncomingResponse) Get() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureIncomingResponseGet((uint32)(self0)) - return -} - -// Subscribe represents the imported method "subscribe". -// -// Returns a pollable which becomes ready when either the Response has -// been received, or an error has occured. When this pollable is ready, -// the `get` method will return `some`. -// -// subscribe: func() -// -//go:nosplit -func (self FutureIncomingResponse) Subscribe() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureIncomingResponseSubscribe((uint32)(self0)) - return -} - -// HTTPErrorCode represents the imported function "http-error-code". -// -// Attempts to extract a http-related `error` from the wasi:io `error` -// provided. -// -// Stream operations which return -// `wasi:io/stream/stream-error::last-operation-failed` have a payload of -// type `wasi:io/error/error` with more information about the operation -// that failed. This payload can be passed through to this function to see -// if there's http-related information about the error to return. -// -// Note that this function is fallible because not all io-errors are -// http-related errors. -// -// http-error-code: func(err: borrow) -// -//go:nosplit -func HTTPErrorCode(err IOError) { - err0 := cm.Reinterpret[uint32](err) - wasmimport_HTTPErrorCode((uint32)(err0)) - return -} diff --git a/examples/component/http-server/gen/wasi/io/error/empty.s b/examples/component/http-server/gen/wasi/io/error/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/io/error/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/io/error/error.wit.go b/examples/component/http-server/gen/wasi/io/error/error.wit.go deleted file mode 100755 index a7ebc7e4..00000000 --- a/examples/component/http-server/gen/wasi/io/error/error.wit.go +++ /dev/null @@ -1,35 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package ioerror represents the imported interface "wasi:io/error@0.2.0". -package ioerror - -import ( - "go.bytecodealliance.org/cm" -) - -// Error represents the imported resource "wasi:io/error@0.2.0#error". -// -// resource error -type Error cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "error". -// -// Drops a resource handle. -// -//go:nosplit -func (self Error) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_ErrorResourceDrop((uint32)(self0)) - return -} - -// ToDebugString represents the imported method "to-debug-string". -// -// to-debug-string: func() -// -//go:nosplit -func (self Error) ToDebugString() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_ErrorToDebugString((uint32)(self0)) - return -} diff --git a/examples/component/http-server/gen/wasi/io/error/ioerror.wasm.go b/examples/component/http-server/gen/wasi/io/error/ioerror.wasm.go deleted file mode 100755 index 96c77c65..00000000 --- a/examples/component/http-server/gen/wasi/io/error/ioerror.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package ioerror - -// This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". - -//go:wasmimport wasi:io/error@0.2.0 [resource-drop]error -//go:noescape -func wasmimport_ErrorResourceDrop(self0 uint32) - -//go:wasmimport wasi:io/error@0.2.0 [method]error.to-debug-string -//go:noescape -func wasmimport_ErrorToDebugString(self0 uint32) diff --git a/examples/component/http-server/gen/wasi/io/poll/empty.s b/examples/component/http-server/gen/wasi/io/poll/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/io/poll/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/io/poll/poll.wasm.go b/examples/component/http-server/gen/wasi/io/poll/poll.wasm.go deleted file mode 100755 index d89a9926..00000000 --- a/examples/component/http-server/gen/wasi/io/poll/poll.wasm.go +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package poll - -// This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". - -//go:wasmimport wasi:io/poll@0.2.0 [resource-drop]pollable -//go:noescape -func wasmimport_PollableResourceDrop(self0 uint32) - -//go:wasmimport wasi:io/poll@0.2.0 [method]pollable.block -//go:noescape -func wasmimport_PollableBlock(self0 uint32) - -//go:wasmimport wasi:io/poll@0.2.0 [method]pollable.ready -//go:noescape -func wasmimport_PollableReady(self0 uint32) - -//go:wasmimport wasi:io/poll@0.2.0 poll -//go:noescape -func wasmimport_Poll(in0 *Pollable, in1 uint32) diff --git a/examples/component/http-server/gen/wasi/io/poll/poll.wit.go b/examples/component/http-server/gen/wasi/io/poll/poll.wit.go deleted file mode 100755 index 4a952ecf..00000000 --- a/examples/component/http-server/gen/wasi/io/poll/poll.wit.go +++ /dev/null @@ -1,57 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package poll represents the imported interface "wasi:io/poll@0.2.0". -package poll - -import ( - "go.bytecodealliance.org/cm" -) - -// Pollable represents the imported resource "wasi:io/poll@0.2.0#pollable". -// -// resource pollable -type Pollable cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "pollable". -// -// Drops a resource handle. -// -//go:nosplit -func (self Pollable) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_PollableResourceDrop((uint32)(self0)) - return -} - -// Block represents the imported method "block". -// -// block: func() -// -//go:nosplit -func (self Pollable) Block() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_PollableBlock((uint32)(self0)) - return -} - -// Ready represents the imported method "ready". -// -// ready: func() -// -//go:nosplit -func (self Pollable) Ready() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_PollableReady((uint32)(self0)) - return -} - -// Poll represents the imported function "poll". -// -// poll: func(in: list>) -// -//go:nosplit -func Poll(in cm.List[Pollable]) { - in0, in1 := cm.LowerList(in) - wasmimport_Poll((*Pollable)(in0), (uint32)(in1)) - return -} diff --git a/examples/component/http-server/gen/wasi/io/streams/empty.s b/examples/component/http-server/gen/wasi/io/streams/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/io/streams/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/io/streams/streams.wasm.go b/examples/component/http-server/gen/wasi/io/streams/streams.wasm.go deleted file mode 100755 index 98543c56..00000000 --- a/examples/component/http-server/gen/wasi/io/streams/streams.wasm.go +++ /dev/null @@ -1,73 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package streams - -// This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". - -//go:wasmimport wasi:io/streams@0.2.0 [resource-drop]input-stream -//go:noescape -func wasmimport_InputStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.blocking-read -//go:noescape -func wasmimport_InputStreamBlockingRead(self0 uint32, len0 uint64) - -//go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.blocking-skip -//go:noescape -func wasmimport_InputStreamBlockingSkip(self0 uint32, len0 uint64) - -//go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.read -//go:noescape -func wasmimport_InputStreamRead(self0 uint32, len0 uint64) - -//go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.skip -//go:noescape -func wasmimport_InputStreamSkip(self0 uint32, len0 uint64) - -//go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.subscribe -//go:noescape -func wasmimport_InputStreamSubscribe(self0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [resource-drop]output-stream -//go:noescape -func wasmimport_OutputStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-flush -//go:noescape -func wasmimport_OutputStreamBlockingFlush(self0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-splice -//go:noescape -func wasmimport_OutputStreamBlockingSplice(self0 uint32, src0 uint32, len0 uint64) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-write-and-flush -//go:noescape -func wasmimport_OutputStreamBlockingWriteAndFlush(self0 uint32, contents0 *uint8, contents1 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-write-zeroes-and-flush -//go:noescape -func wasmimport_OutputStreamBlockingWriteZeroesAndFlush(self0 uint32, len0 uint64) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.check-write -//go:noescape -func wasmimport_OutputStreamCheckWrite(self0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.flush -//go:noescape -func wasmimport_OutputStreamFlush(self0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.splice -//go:noescape -func wasmimport_OutputStreamSplice(self0 uint32, src0 uint32, len0 uint64) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.subscribe -//go:noescape -func wasmimport_OutputStreamSubscribe(self0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.write -//go:noescape -func wasmimport_OutputStreamWrite(self0 uint32, contents0 *uint8, contents1 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.write-zeroes -//go:noescape -func wasmimport_OutputStreamWriteZeroes(self0 uint32, len0 uint64) diff --git a/examples/component/http-server/gen/wasi/io/streams/streams.wit.go b/examples/component/http-server/gen/wasi/io/streams/streams.wit.go deleted file mode 100755 index d41c044a..00000000 --- a/examples/component/http-server/gen/wasi/io/streams/streams.wit.go +++ /dev/null @@ -1,268 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package streams represents the imported interface "wasi:io/streams@0.2.0". -package streams - -import ( - ioerror "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/io/error" - "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/io/poll" - "go.bytecodealliance.org/cm" -) - -// Error represents the imported type alias "wasi:io/streams@0.2.0#error". -// -// See [ioerror.Error] for more information. -type Error = ioerror.Error - -// Pollable represents the imported type alias "wasi:io/streams@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// StreamError represents the imported variant "wasi:io/streams@0.2.0#stream-error". -// -// variant stream-error { -// last-operation-failed(error), -// closed, -// } -type StreamError cm.Variant[uint8, Error, Error] - -// StreamErrorLastOperationFailed returns a [StreamError] of case "last-operation-failed". -func StreamErrorLastOperationFailed(data Error) StreamError { - return cm.New[StreamError](0, data) -} - -// LastOperationFailed returns a non-nil *[Error] if [StreamError] represents the variant case "last-operation-failed". -func (self *StreamError) LastOperationFailed() *Error { - return cm.Case[Error](self, 0) -} - -// StreamErrorClosed returns a [StreamError] of case "closed". -func StreamErrorClosed() StreamError { - var data struct{} - return cm.New[StreamError](1, data) -} - -// Closed returns true if [StreamError] represents the variant case "closed". -func (self *StreamError) Closed() bool { - return self.Tag() == 1 -} - -var stringsStreamError = [2]string{ - "last-operation-failed", - "closed", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v StreamError) String() string { - return stringsStreamError[v.Tag()] -} - -// InputStream represents the imported resource "wasi:io/streams@0.2.0#input-stream". -// -// resource input-stream -type InputStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "input-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self InputStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_InputStreamResourceDrop((uint32)(self0)) - return -} - -// BlockingRead represents the imported method "blocking-read". -// -// blocking-read: func(len: u64) -// -//go:nosplit -func (self InputStream) BlockingRead(len_ uint64) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_InputStreamBlockingRead((uint32)(self0), (uint64)(len0)) - return -} - -// BlockingSkip represents the imported method "blocking-skip". -// -// blocking-skip: func(len: u64) -// -//go:nosplit -func (self InputStream) BlockingSkip(len_ uint64) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_InputStreamBlockingSkip((uint32)(self0), (uint64)(len0)) - return -} - -// Read represents the imported method "read". -// -// read: func(len: u64) -// -//go:nosplit -func (self InputStream) Read(len_ uint64) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_InputStreamRead((uint32)(self0), (uint64)(len0)) - return -} - -// Skip represents the imported method "skip". -// -// skip: func(len: u64) -// -//go:nosplit -func (self InputStream) Skip(len_ uint64) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_InputStreamSkip((uint32)(self0), (uint64)(len0)) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -// -//go:nosplit -func (self InputStream) Subscribe() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_InputStreamSubscribe((uint32)(self0)) - return -} - -// OutputStream represents the imported resource "wasi:io/streams@0.2.0#output-stream". -// -// resource output-stream -type OutputStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "output-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self OutputStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamResourceDrop((uint32)(self0)) - return -} - -// BlockingFlush represents the imported method "blocking-flush". -// -// blocking-flush: func() -// -//go:nosplit -func (self OutputStream) BlockingFlush() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamBlockingFlush((uint32)(self0)) - return -} - -// BlockingSplice represents the imported method "blocking-splice". -// -// blocking-splice: func(src: borrow, len: u64) -// -//go:nosplit -func (self OutputStream) BlockingSplice(src InputStream, len_ uint64) { - self0 := cm.Reinterpret[uint32](self) - src0 := cm.Reinterpret[uint32](src) - len0 := (uint64)(len_) - wasmimport_OutputStreamBlockingSplice((uint32)(self0), (uint32)(src0), (uint64)(len0)) - return -} - -// BlockingWriteAndFlush represents the imported method "blocking-write-and-flush". -// -// blocking-write-and-flush: func(contents: list) -// -//go:nosplit -func (self OutputStream) BlockingWriteAndFlush(contents cm.List[uint8]) { - self0 := cm.Reinterpret[uint32](self) - contents0, contents1 := cm.LowerList(contents) - wasmimport_OutputStreamBlockingWriteAndFlush((uint32)(self0), (*uint8)(contents0), (uint32)(contents1)) - return -} - -// BlockingWriteZeroesAndFlush represents the imported method "blocking-write-zeroes-and-flush". -// -// blocking-write-zeroes-and-flush: func(len: u64) -// -//go:nosplit -func (self OutputStream) BlockingWriteZeroesAndFlush(len_ uint64) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_OutputStreamBlockingWriteZeroesAndFlush((uint32)(self0), (uint64)(len0)) - return -} - -// CheckWrite represents the imported method "check-write". -// -// check-write: func() -// -//go:nosplit -func (self OutputStream) CheckWrite() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamCheckWrite((uint32)(self0)) - return -} - -// Flush represents the imported method "flush". -// -// flush: func() -// -//go:nosplit -func (self OutputStream) Flush() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamFlush((uint32)(self0)) - return -} - -// Splice represents the imported method "splice". -// -// splice: func(src: borrow, len: u64) -// -//go:nosplit -func (self OutputStream) Splice(src InputStream, len_ uint64) { - self0 := cm.Reinterpret[uint32](self) - src0 := cm.Reinterpret[uint32](src) - len0 := (uint64)(len_) - wasmimport_OutputStreamSplice((uint32)(self0), (uint32)(src0), (uint64)(len0)) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -// -//go:nosplit -func (self OutputStream) Subscribe() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamSubscribe((uint32)(self0)) - return -} - -// Write represents the imported method "write". -// -// write: func(contents: list) -// -//go:nosplit -func (self OutputStream) Write(contents cm.List[uint8]) { - self0 := cm.Reinterpret[uint32](self) - contents0, contents1 := cm.LowerList(contents) - wasmimport_OutputStreamWrite((uint32)(self0), (*uint8)(contents0), (uint32)(contents1)) - return -} - -// WriteZeroes represents the imported method "write-zeroes". -// -// write-zeroes: func(len: u64) -// -//go:nosplit -func (self OutputStream) WriteZeroes(len_ uint64) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_OutputStreamWriteZeroes((uint32)(self0), (uint64)(len0)) - return -} diff --git a/examples/component/http-server/gen/wasi/logging/logging/empty.s b/examples/component/http-server/gen/wasi/logging/logging/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/logging/logging/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/logging/logging/logging.wasm.go b/examples/component/http-server/gen/wasi/logging/logging/logging.wasm.go deleted file mode 100755 index d2d27098..00000000 --- a/examples/component/http-server/gen/wasi/logging/logging/logging.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package logging - -// This file contains wasmimport and wasmexport declarations for "wasi:logging@0.1.0-draft". - -//go:wasmimport wasi:logging/logging@0.1.0-draft log -//go:noescape -func wasmimport_Log(level0 uint32, context0 *uint8, context1 uint32, message0 *uint8, message1 uint32) diff --git a/examples/component/http-server/gen/wasi/logging/logging/logging.wit.go b/examples/component/http-server/gen/wasi/logging/logging/logging.wit.go deleted file mode 100755 index 96e406ed..00000000 --- a/examples/component/http-server/gen/wasi/logging/logging/logging.wit.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package logging represents the imported interface "wasi:logging/logging@0.1.0-draft". -package logging - -import ( - "go.bytecodealliance.org/cm" -) - -// Level represents the enum "wasi:logging/logging@0.1.0-draft#level". -// -// enum level { -// trace, -// debug, -// info, -// warn, -// error, -// critical -// } -type Level uint8 - -const ( - LevelTrace Level = iota - LevelDebug - LevelInfo - LevelWarn - LevelError - LevelCritical -) - -var stringsLevel = [6]string{ - "trace", - "debug", - "info", - "warn", - "error", - "critical", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e Level) String() string { - return stringsLevel[e] -} - -// Log represents the imported function "log". -// -// log: func(level: level, context: string, message: string) -// -//go:nosplit -func Log(level Level, context string, message string) { - level0 := (uint32)(level) - context0, context1 := cm.LowerString(context) - message0, message1 := cm.LowerString(message) - wasmimport_Log((uint32)(level0), (*uint8)(context0), (uint32)(context1), (*uint8)(message0), (uint32)(message1)) - return -} diff --git a/examples/component/http-server/gen/wasi/random/insecure-seed/empty.s b/examples/component/http-server/gen/wasi/random/insecure-seed/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/random/insecure-seed/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/random/insecure-seed/insecure-seed.wit.go b/examples/component/http-server/gen/wasi/random/insecure-seed/insecure-seed.wit.go deleted file mode 100755 index 6b9afd75..00000000 --- a/examples/component/http-server/gen/wasi/random/insecure-seed/insecure-seed.wit.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package insecureseed represents the imported interface "wasi:random/insecure-seed@0.2.0". -package insecureseed - -// InsecureSeed represents the imported function "insecure-seed". -// -// insecure-seed: func() -// -//go:nosplit -func InsecureSeed() { - wasmimport_InsecureSeed() - return -} diff --git a/examples/component/http-server/gen/wasi/random/insecure-seed/insecureseed.wasm.go b/examples/component/http-server/gen/wasi/random/insecure-seed/insecureseed.wasm.go deleted file mode 100755 index 6dc19c0b..00000000 --- a/examples/component/http-server/gen/wasi/random/insecure-seed/insecureseed.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package insecureseed - -// This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". - -//go:wasmimport wasi:random/insecure-seed@0.2.0 insecure-seed -//go:noescape -func wasmimport_InsecureSeed() diff --git a/examples/component/http-server/gen/wasi/random/insecure/empty.s b/examples/component/http-server/gen/wasi/random/insecure/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/random/insecure/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/random/insecure/insecure.wasm.go b/examples/component/http-server/gen/wasi/random/insecure/insecure.wasm.go deleted file mode 100755 index 41ffb551..00000000 --- a/examples/component/http-server/gen/wasi/random/insecure/insecure.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package insecure - -// This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". - -//go:wasmimport wasi:random/insecure@0.2.0 get-insecure-random-bytes -//go:noescape -func wasmimport_GetInsecureRandomBytes(len0 uint64) - -//go:wasmimport wasi:random/insecure@0.2.0 get-insecure-random-u64 -//go:noescape -func wasmimport_GetInsecureRandomU64() diff --git a/examples/component/http-server/gen/wasi/random/insecure/insecure.wit.go b/examples/component/http-server/gen/wasi/random/insecure/insecure.wit.go deleted file mode 100755 index add35465..00000000 --- a/examples/component/http-server/gen/wasi/random/insecure/insecure.wit.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package insecure represents the imported interface "wasi:random/insecure@0.2.0". -package insecure - -// GetInsecureRandomBytes represents the imported function "get-insecure-random-bytes". -// -// get-insecure-random-bytes: func(len: u64) -// -//go:nosplit -func GetInsecureRandomBytes(len_ uint64) { - len0 := (uint64)(len_) - wasmimport_GetInsecureRandomBytes((uint64)(len0)) - return -} - -// GetInsecureRandomU64 represents the imported function "get-insecure-random-u64". -// -// get-insecure-random-u64: func() -// -//go:nosplit -func GetInsecureRandomU64() { - wasmimport_GetInsecureRandomU64() - return -} diff --git a/examples/component/http-server/gen/wasi/random/random/empty.s b/examples/component/http-server/gen/wasi/random/random/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/random/random/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/random/random/random.wasm.go b/examples/component/http-server/gen/wasi/random/random/random.wasm.go deleted file mode 100755 index 512ee826..00000000 --- a/examples/component/http-server/gen/wasi/random/random/random.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package random - -// This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". - -//go:wasmimport wasi:random/random@0.2.0 get-random-bytes -//go:noescape -func wasmimport_GetRandomBytes(len0 uint64) - -//go:wasmimport wasi:random/random@0.2.0 get-random-u64 -//go:noescape -func wasmimport_GetRandomU64() diff --git a/examples/component/http-server/gen/wasi/random/random/random.wit.go b/examples/component/http-server/gen/wasi/random/random/random.wit.go deleted file mode 100755 index f11f988d..00000000 --- a/examples/component/http-server/gen/wasi/random/random/random.wit.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package random represents the imported interface "wasi:random/random@0.2.0". -package random - -// GetRandomBytes represents the imported function "get-random-bytes". -// -// get-random-bytes: func(len: u64) -// -//go:nosplit -func GetRandomBytes(len_ uint64) { - len0 := (uint64)(len_) - wasmimport_GetRandomBytes((uint64)(len0)) - return -} - -// GetRandomU64 represents the imported function "get-random-u64". -// -// get-random-u64: func() -// -//go:nosplit -func GetRandomU64() { - wasmimport_GetRandomU64() - return -} diff --git a/examples/component/http-server/gen/wasi/sockets/instance-network/empty.s b/examples/component/http-server/gen/wasi/sockets/instance-network/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/sockets/instance-network/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/sockets/instance-network/instance-network.wit.go b/examples/component/http-server/gen/wasi/sockets/instance-network/instance-network.wit.go deleted file mode 100755 index 55895cc2..00000000 --- a/examples/component/http-server/gen/wasi/sockets/instance-network/instance-network.wit.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package instancenetwork represents the imported interface "wasi:sockets/instance-network@0.2.0". -package instancenetwork - -import ( - "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/sockets/network" -) - -// Network represents the imported type alias "wasi:sockets/instance-network@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// InstanceNetwork represents the imported function "instance-network". -// -// instance-network: func() -// -//go:nosplit -func InstanceNetwork() { - wasmimport_InstanceNetwork() - return -} diff --git a/examples/component/http-server/gen/wasi/sockets/instance-network/instancenetwork.wasm.go b/examples/component/http-server/gen/wasi/sockets/instance-network/instancenetwork.wasm.go deleted file mode 100755 index 01fc4839..00000000 --- a/examples/component/http-server/gen/wasi/sockets/instance-network/instancenetwork.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package instancenetwork - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/instance-network@0.2.0 instance-network -//go:noescape -func wasmimport_InstanceNetwork() diff --git a/examples/component/http-server/gen/wasi/sockets/ip-name-lookup/abi.go b/examples/component/http-server/gen/wasi/sockets/ip-name-lookup/abi.go deleted file mode 100755 index a63f0d01..00000000 --- a/examples/component/http-server/gen/wasi/sockets/ip-name-lookup/abi.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package ipnamelookup - -import ( - "go.bytecodealliance.org/cm" - "unsafe" -) - -// OptionIPAddressShape is used for storage in variant or result types. -type OptionIPAddressShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Option[IPAddress]{})]byte -} diff --git a/examples/component/http-server/gen/wasi/sockets/ip-name-lookup/empty.s b/examples/component/http-server/gen/wasi/sockets/ip-name-lookup/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/sockets/ip-name-lookup/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go b/examples/component/http-server/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go deleted file mode 100755 index c8d85412..00000000 --- a/examples/component/http-server/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package ipnamelookup represents the imported interface "wasi:sockets/ip-name-lookup@0.2.0". -package ipnamelookup - -import ( - "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/io/poll" - "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/sockets/network" - "go.bytecodealliance.org/cm" -) - -// Pollable represents the imported type alias "wasi:sockets/ip-name-lookup@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// Network represents the imported type alias "wasi:sockets/ip-name-lookup@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// ErrorCode represents the type alias "wasi:sockets/ip-name-lookup@0.2.0#error-code". -// -// See [network.ErrorCode] for more information. -type ErrorCode = network.ErrorCode - -// IPAddress represents the type alias "wasi:sockets/ip-name-lookup@0.2.0#ip-address". -// -// See [network.IPAddress] for more information. -type IPAddress = network.IPAddress - -// ResolveAddressStream represents the imported resource "wasi:sockets/ip-name-lookup@0.2.0#resolve-address-stream". -// -// resource resolve-address-stream -type ResolveAddressStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "resolve-address-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self ResolveAddressStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_ResolveAddressStreamResourceDrop((uint32)(self0)) - return -} - -// ResolveNextAddress represents the imported method "resolve-next-address". -// -// resolve-next-address: func() -// -//go:nosplit -func (self ResolveAddressStream) ResolveNextAddress() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_ResolveAddressStreamResolveNextAddress((uint32)(self0)) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -// -//go:nosplit -func (self ResolveAddressStream) Subscribe() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_ResolveAddressStreamSubscribe((uint32)(self0)) - return -} - -// ResolveAddresses represents the imported function "resolve-addresses". -// -// resolve-addresses: func(network: borrow, name: string) -// -//go:nosplit -func ResolveAddresses(network_ Network, name string) { - network0 := cm.Reinterpret[uint32](network_) - name0, name1 := cm.LowerString(name) - wasmimport_ResolveAddresses((uint32)(network0), (*uint8)(name0), (uint32)(name1)) - return -} diff --git a/examples/component/http-server/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go b/examples/component/http-server/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go deleted file mode 100755 index df4d85bc..00000000 --- a/examples/component/http-server/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package ipnamelookup - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 [resource-drop]resolve-address-stream -//go:noescape -func wasmimport_ResolveAddressStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 [method]resolve-address-stream.resolve-next-address -//go:noescape -func wasmimport_ResolveAddressStreamResolveNextAddress(self0 uint32) - -//go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 [method]resolve-address-stream.subscribe -//go:noescape -func wasmimport_ResolveAddressStreamSubscribe(self0 uint32) - -//go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 resolve-addresses -//go:noescape -func wasmimport_ResolveAddresses(network0 uint32, name0 *uint8, name1 uint32) diff --git a/examples/component/http-server/gen/wasi/sockets/network/abi.go b/examples/component/http-server/gen/wasi/sockets/network/abi.go deleted file mode 100755 index a088bd1d..00000000 --- a/examples/component/http-server/gen/wasi/sockets/network/abi.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package network - -import ( - "go.bytecodealliance.org/cm" - "unsafe" -) - -// IPv6SocketAddressShape is used for storage in variant or result types. -type IPv6SocketAddressShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(IPv6SocketAddress{})]byte -} diff --git a/examples/component/http-server/gen/wasi/sockets/network/empty.s b/examples/component/http-server/gen/wasi/sockets/network/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/sockets/network/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/sockets/network/network.wasm.go b/examples/component/http-server/gen/wasi/sockets/network/network.wasm.go deleted file mode 100755 index 012a79ff..00000000 --- a/examples/component/http-server/gen/wasi/sockets/network/network.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package network - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/network@0.2.0 [resource-drop]network -//go:noescape -func wasmimport_NetworkResourceDrop(self0 uint32) diff --git a/examples/component/http-server/gen/wasi/sockets/network/network.wit.go b/examples/component/http-server/gen/wasi/sockets/network/network.wit.go deleted file mode 100755 index f0fb7eef..00000000 --- a/examples/component/http-server/gen/wasi/sockets/network/network.wit.go +++ /dev/null @@ -1,241 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package network represents the imported interface "wasi:sockets/network@0.2.0". -package network - -import ( - "go.bytecodealliance.org/cm" -) - -// Network represents the imported resource "wasi:sockets/network@0.2.0#network". -// -// resource network -type Network cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "network". -// -// Drops a resource handle. -// -//go:nosplit -func (self Network) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_NetworkResourceDrop((uint32)(self0)) - return -} - -// ErrorCode represents the enum "wasi:sockets/network@0.2.0#error-code". -// -// enum error-code { -// unknown, -// access-denied, -// not-supported, -// invalid-argument, -// out-of-memory, -// timeout, -// concurrency-conflict, -// not-in-progress, -// would-block, -// invalid-state, -// new-socket-limit, -// address-not-bindable, -// address-in-use, -// remote-unreachable, -// connection-refused, -// connection-reset, -// connection-aborted, -// datagram-too-large, -// name-unresolvable, -// temporary-resolver-failure, -// permanent-resolver-failure -// } -type ErrorCode uint8 - -const ( - ErrorCodeUnknown ErrorCode = iota - ErrorCodeAccessDenied - ErrorCodeNotSupported - ErrorCodeInvalidArgument - ErrorCodeOutOfMemory - ErrorCodeTimeout - ErrorCodeConcurrencyConflict - ErrorCodeNotInProgress - ErrorCodeWouldBlock - ErrorCodeInvalidState - ErrorCodeNewSocketLimit - ErrorCodeAddressNotBindable - ErrorCodeAddressInUse - ErrorCodeRemoteUnreachable - ErrorCodeConnectionRefused - ErrorCodeConnectionReset - ErrorCodeConnectionAborted - ErrorCodeDatagramTooLarge - ErrorCodeNameUnresolvable - ErrorCodeTemporaryResolverFailure - ErrorCodePermanentResolverFailure -) - -var stringsErrorCode = [21]string{ - "unknown", - "access-denied", - "not-supported", - "invalid-argument", - "out-of-memory", - "timeout", - "concurrency-conflict", - "not-in-progress", - "would-block", - "invalid-state", - "new-socket-limit", - "address-not-bindable", - "address-in-use", - "remote-unreachable", - "connection-refused", - "connection-reset", - "connection-aborted", - "datagram-too-large", - "name-unresolvable", - "temporary-resolver-failure", - "permanent-resolver-failure", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e ErrorCode) String() string { - return stringsErrorCode[e] -} - -// IPAddressFamily represents the enum "wasi:sockets/network@0.2.0#ip-address-family". -// -// enum ip-address-family { -// ipv4, -// ipv6 -// } -type IPAddressFamily uint8 - -const ( - IPAddressFamilyIPv4 IPAddressFamily = iota - IPAddressFamilyIPv6 -) - -var stringsIPAddressFamily = [2]string{ - "ipv4", - "ipv6", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e IPAddressFamily) String() string { - return stringsIPAddressFamily[e] -} - -// IPv4Address represents the tuple "wasi:sockets/network@0.2.0#ipv4-address". -// -// type ipv4-address = tuple -type IPv4Address [4]uint8 - -// IPv6Address represents the tuple "wasi:sockets/network@0.2.0#ipv6-address". -// -// type ipv6-address = tuple -type IPv6Address [8]uint16 - -// IPAddress represents the variant "wasi:sockets/network@0.2.0#ip-address". -// -// variant ip-address { -// ipv4(ipv4-address), -// ipv6(ipv6-address), -// } -type IPAddress cm.Variant[uint8, IPv6Address, IPv6Address] - -// IPAddressIPv4 returns a [IPAddress] of case "ipv4". -func IPAddressIPv4(data IPv4Address) IPAddress { - return cm.New[IPAddress](0, data) -} - -// IPv4 returns a non-nil *[IPv4Address] if [IPAddress] represents the variant case "ipv4". -func (self *IPAddress) IPv4() *IPv4Address { - return cm.Case[IPv4Address](self, 0) -} - -// IPAddressIPv6 returns a [IPAddress] of case "ipv6". -func IPAddressIPv6(data IPv6Address) IPAddress { - return cm.New[IPAddress](1, data) -} - -// IPv6 returns a non-nil *[IPv6Address] if [IPAddress] represents the variant case "ipv6". -func (self *IPAddress) IPv6() *IPv6Address { - return cm.Case[IPv6Address](self, 1) -} - -var stringsIPAddress = [2]string{ - "ipv4", - "ipv6", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v IPAddress) String() string { - return stringsIPAddress[v.Tag()] -} - -// IPv4SocketAddress represents the record "wasi:sockets/network@0.2.0#ipv4-socket-address". -// -// record ipv4-socket-address { -// port: u16, -// address: ipv4-address, -// } -type IPv4SocketAddress struct { - _ cm.HostLayout - Port uint16 - Address IPv4Address -} - -// IPv6SocketAddress represents the record "wasi:sockets/network@0.2.0#ipv6-socket-address". -// -// record ipv6-socket-address { -// port: u16, -// flow-info: u32, -// address: ipv6-address, -// scope-id: u32, -// } -type IPv6SocketAddress struct { - _ cm.HostLayout - Port uint16 - FlowInfo uint32 - Address IPv6Address - ScopeID uint32 -} - -// IPSocketAddress represents the variant "wasi:sockets/network@0.2.0#ip-socket-address". -// -// variant ip-socket-address { -// ipv4(ipv4-socket-address), -// ipv6(ipv6-socket-address), -// } -type IPSocketAddress cm.Variant[uint8, IPv6SocketAddressShape, IPv6SocketAddress] - -// IPSocketAddressIPv4 returns a [IPSocketAddress] of case "ipv4". -func IPSocketAddressIPv4(data IPv4SocketAddress) IPSocketAddress { - return cm.New[IPSocketAddress](0, data) -} - -// IPv4 returns a non-nil *[IPv4SocketAddress] if [IPSocketAddress] represents the variant case "ipv4". -func (self *IPSocketAddress) IPv4() *IPv4SocketAddress { - return cm.Case[IPv4SocketAddress](self, 0) -} - -// IPSocketAddressIPv6 returns a [IPSocketAddress] of case "ipv6". -func IPSocketAddressIPv6(data IPv6SocketAddress) IPSocketAddress { - return cm.New[IPSocketAddress](1, data) -} - -// IPv6 returns a non-nil *[IPv6SocketAddress] if [IPSocketAddress] represents the variant case "ipv6". -func (self *IPSocketAddress) IPv6() *IPv6SocketAddress { - return cm.Case[IPv6SocketAddress](self, 1) -} - -var stringsIPSocketAddress = [2]string{ - "ipv4", - "ipv6", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v IPSocketAddress) String() string { - return stringsIPSocketAddress[v.Tag()] -} diff --git a/examples/component/http-server/gen/wasi/sockets/tcp-create-socket/empty.s b/examples/component/http-server/gen/wasi/sockets/tcp-create-socket/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/sockets/tcp-create-socket/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go b/examples/component/http-server/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go deleted file mode 100755 index 094f033d..00000000 --- a/examples/component/http-server/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package tcpcreatesocket represents the imported interface "wasi:sockets/tcp-create-socket@0.2.0". -package tcpcreatesocket - -import ( - "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/sockets/network" - "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/sockets/tcp" -) - -// Network represents the imported type alias "wasi:sockets/tcp-create-socket@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// ErrorCode represents the type alias "wasi:sockets/tcp-create-socket@0.2.0#error-code". -// -// See [network.ErrorCode] for more information. -type ErrorCode = network.ErrorCode - -// IPAddressFamily represents the type alias "wasi:sockets/tcp-create-socket@0.2.0#ip-address-family". -// -// See [network.IPAddressFamily] for more information. -type IPAddressFamily = network.IPAddressFamily - -// TCPSocket represents the imported type alias "wasi:sockets/tcp-create-socket@0.2.0#tcp-socket". -// -// See [tcp.TCPSocket] for more information. -type TCPSocket = tcp.TCPSocket - -// CreateTCPSocket represents the imported function "create-tcp-socket". -// -// create-tcp-socket: func(address-family: ip-address-family) -// -//go:nosplit -func CreateTCPSocket(addressFamily IPAddressFamily) { - addressFamily0 := (uint32)(addressFamily) - wasmimport_CreateTCPSocket((uint32)(addressFamily0)) - return -} diff --git a/examples/component/http-server/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go b/examples/component/http-server/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go deleted file mode 100755 index 48d9b113..00000000 --- a/examples/component/http-server/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package tcpcreatesocket - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/tcp-create-socket@0.2.0 create-tcp-socket -//go:noescape -func wasmimport_CreateTCPSocket(addressFamily0 uint32) diff --git a/examples/component/http-server/gen/wasi/sockets/tcp/abi.go b/examples/component/http-server/gen/wasi/sockets/tcp/abi.go deleted file mode 100755 index 3b037ff4..00000000 --- a/examples/component/http-server/gen/wasi/sockets/tcp/abi.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package tcp - -import ( - "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/sockets/network" - "go.bytecodealliance.org/cm" -) - -func lower_IPv4Address(v network.IPv4Address) (f0 uint32, f1 uint32, f2 uint32, f3 uint32) { - f0 = (uint32)(v[0]) - f1 = (uint32)(v[1]) - f2 = (uint32)(v[2]) - f3 = (uint32)(v[3]) - return -} - -func lower_IPv4SocketAddress(v network.IPv4SocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32) { - f0 = (uint32)(v.Port) - f1, f2, f3, f4 = lower_IPv4Address(v.Address) - return -} - -func lower_IPv6Address(v network.IPv6Address) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32) { - f0 = (uint32)(v[0]) - f1 = (uint32)(v[1]) - f2 = (uint32)(v[2]) - f3 = (uint32)(v[3]) - f4 = (uint32)(v[4]) - f5 = (uint32)(v[5]) - f6 = (uint32)(v[6]) - f7 = (uint32)(v[7]) - return -} - -func lower_IPv6SocketAddress(v network.IPv6SocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32) { - f0 = (uint32)(v.Port) - f1 = (uint32)(v.FlowInfo) - f2, f3, f4, f5, f6, f7, f8, f9 = lower_IPv6Address(v.Address) - f10 = (uint32)(v.ScopeID) - return -} - -func lower_IPSocketAddress(v network.IPSocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32, f11 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 0: // ipv4 - v1, v2, v3, v4, v5 := lower_IPv4SocketAddress(*cm.Case[network.IPv4SocketAddress](&v, 0)) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 1: // ipv6 - v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11 := lower_IPv6SocketAddress(*cm.Case[network.IPv6SocketAddress](&v, 1)) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - f6 = (uint32)(v6) - f7 = (uint32)(v7) - f8 = (uint32)(v8) - f9 = (uint32)(v9) - f10 = (uint32)(v10) - f11 = (uint32)(v11) - } - return -} diff --git a/examples/component/http-server/gen/wasi/sockets/tcp/empty.s b/examples/component/http-server/gen/wasi/sockets/tcp/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/sockets/tcp/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/sockets/tcp/tcp.wasm.go b/examples/component/http-server/gen/wasi/sockets/tcp/tcp.wasm.go deleted file mode 100755 index 3d3553be..00000000 --- a/examples/component/http-server/gen/wasi/sockets/tcp/tcp.wasm.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package tcp - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/tcp@0.2.0 [resource-drop]tcp-socket -//go:noescape -func wasmimport_TCPSocketResourceDrop(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.accept -//go:noescape -func wasmimport_TCPSocketAccept(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.address-family -//go:noescape -func wasmimport_TCPSocketAddressFamily(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-bind -//go:noescape -func wasmimport_TCPSocketFinishBind(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-connect -//go:noescape -func wasmimport_TCPSocketFinishConnect(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-listen -//go:noescape -func wasmimport_TCPSocketFinishListen(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.hop-limit -//go:noescape -func wasmimport_TCPSocketHopLimit(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.is-listening -//go:noescape -func wasmimport_TCPSocketIsListening(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-count -//go:noescape -func wasmimport_TCPSocketKeepAliveCount(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-enabled -//go:noescape -func wasmimport_TCPSocketKeepAliveEnabled(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-idle-time -//go:noescape -func wasmimport_TCPSocketKeepAliveIdleTime(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-interval -//go:noescape -func wasmimport_TCPSocketKeepAliveInterval(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.local-address -//go:noescape -func wasmimport_TCPSocketLocalAddress(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.receive-buffer-size -//go:noescape -func wasmimport_TCPSocketReceiveBufferSize(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.remote-address -//go:noescape -func wasmimport_TCPSocketRemoteAddress(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.send-buffer-size -//go:noescape -func wasmimport_TCPSocketSendBufferSize(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-hop-limit -//go:noescape -func wasmimport_TCPSocketSetHopLimit(self0 uint32, value0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-count -//go:noescape -func wasmimport_TCPSocketSetKeepAliveCount(self0 uint32, value0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-enabled -//go:noescape -func wasmimport_TCPSocketSetKeepAliveEnabled(self0 uint32, value0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-idle-time -//go:noescape -func wasmimport_TCPSocketSetKeepAliveIdleTime(self0 uint32, value0 uint64) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-interval -//go:noescape -func wasmimport_TCPSocketSetKeepAliveInterval(self0 uint32, value0 uint64) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-listen-backlog-size -//go:noescape -func wasmimport_TCPSocketSetListenBacklogSize(self0 uint32, value0 uint64) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-receive-buffer-size -//go:noescape -func wasmimport_TCPSocketSetReceiveBufferSize(self0 uint32, value0 uint64) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-send-buffer-size -//go:noescape -func wasmimport_TCPSocketSetSendBufferSize(self0 uint32, value0 uint64) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.shutdown -//go:noescape -func wasmimport_TCPSocketShutdown(self0 uint32, shutdownType0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-bind -//go:noescape -func wasmimport_TCPSocketStartBind(self0 uint32, network0 uint32, localAddress0 uint32, localAddress1 uint32, localAddress2 uint32, localAddress3 uint32, localAddress4 uint32, localAddress5 uint32, localAddress6 uint32, localAddress7 uint32, localAddress8 uint32, localAddress9 uint32, localAddress10 uint32, localAddress11 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-connect -//go:noescape -func wasmimport_TCPSocketStartConnect(self0 uint32, network0 uint32, remoteAddress0 uint32, remoteAddress1 uint32, remoteAddress2 uint32, remoteAddress3 uint32, remoteAddress4 uint32, remoteAddress5 uint32, remoteAddress6 uint32, remoteAddress7 uint32, remoteAddress8 uint32, remoteAddress9 uint32, remoteAddress10 uint32, remoteAddress11 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-listen -//go:noescape -func wasmimport_TCPSocketStartListen(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.subscribe -//go:noescape -func wasmimport_TCPSocketSubscribe(self0 uint32) diff --git a/examples/component/http-server/gen/wasi/sockets/tcp/tcp.wit.go b/examples/component/http-server/gen/wasi/sockets/tcp/tcp.wit.go deleted file mode 100755 index 6e37ed2a..00000000 --- a/examples/component/http-server/gen/wasi/sockets/tcp/tcp.wit.go +++ /dev/null @@ -1,415 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package tcp represents the imported interface "wasi:sockets/tcp@0.2.0". -package tcp - -import ( - monotonicclock "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/clocks/monotonic-clock" - "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/io/poll" - "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/io/streams" - "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/sockets/network" - "go.bytecodealliance.org/cm" -) - -// InputStream represents the imported type alias "wasi:sockets/tcp@0.2.0#input-stream". -// -// See [streams.InputStream] for more information. -type InputStream = streams.InputStream - -// OutputStream represents the imported type alias "wasi:sockets/tcp@0.2.0#output-stream". -// -// See [streams.OutputStream] for more information. -type OutputStream = streams.OutputStream - -// Pollable represents the imported type alias "wasi:sockets/tcp@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// Duration represents the type alias "wasi:sockets/tcp@0.2.0#duration". -// -// See [monotonicclock.Duration] for more information. -type Duration = monotonicclock.Duration - -// Network represents the imported type alias "wasi:sockets/tcp@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// ErrorCode represents the type alias "wasi:sockets/tcp@0.2.0#error-code". -// -// See [network.ErrorCode] for more information. -type ErrorCode = network.ErrorCode - -// IPSocketAddress represents the type alias "wasi:sockets/tcp@0.2.0#ip-socket-address". -// -// See [network.IPSocketAddress] for more information. -type IPSocketAddress = network.IPSocketAddress - -// IPAddressFamily represents the type alias "wasi:sockets/tcp@0.2.0#ip-address-family". -// -// See [network.IPAddressFamily] for more information. -type IPAddressFamily = network.IPAddressFamily - -// ShutdownType represents the enum "wasi:sockets/tcp@0.2.0#shutdown-type". -// -// enum shutdown-type { -// receive, -// send, -// both -// } -type ShutdownType uint8 - -const ( - ShutdownTypeReceive ShutdownType = iota - ShutdownTypeSend - ShutdownTypeBoth -) - -var stringsShutdownType = [3]string{ - "receive", - "send", - "both", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e ShutdownType) String() string { - return stringsShutdownType[e] -} - -// TCPSocket represents the imported resource "wasi:sockets/tcp@0.2.0#tcp-socket". -// -// resource tcp-socket -type TCPSocket cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "tcp-socket". -// -// Drops a resource handle. -// -//go:nosplit -func (self TCPSocket) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketResourceDrop((uint32)(self0)) - return -} - -// Accept represents the imported method "accept". -// -// accept: func() -// -//go:nosplit -func (self TCPSocket) Accept() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketAccept((uint32)(self0)) - return -} - -// AddressFamily represents the imported method "address-family". -// -// address-family: func() -// -//go:nosplit -func (self TCPSocket) AddressFamily() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketAddressFamily((uint32)(self0)) - return -} - -// FinishBind represents the imported method "finish-bind". -// -// finish-bind: func() -// -//go:nosplit -func (self TCPSocket) FinishBind() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketFinishBind((uint32)(self0)) - return -} - -// FinishConnect represents the imported method "finish-connect". -// -// finish-connect: func() -// -//go:nosplit -func (self TCPSocket) FinishConnect() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketFinishConnect((uint32)(self0)) - return -} - -// FinishListen represents the imported method "finish-listen". -// -// finish-listen: func() -// -//go:nosplit -func (self TCPSocket) FinishListen() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketFinishListen((uint32)(self0)) - return -} - -// HopLimit represents the imported method "hop-limit". -// -// hop-limit: func() -// -//go:nosplit -func (self TCPSocket) HopLimit() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketHopLimit((uint32)(self0)) - return -} - -// IsListening represents the imported method "is-listening". -// -// is-listening: func() -// -//go:nosplit -func (self TCPSocket) IsListening() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketIsListening((uint32)(self0)) - return -} - -// KeepAliveCount represents the imported method "keep-alive-count". -// -// keep-alive-count: func() -// -//go:nosplit -func (self TCPSocket) KeepAliveCount() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveCount((uint32)(self0)) - return -} - -// KeepAliveEnabled represents the imported method "keep-alive-enabled". -// -// keep-alive-enabled: func() -// -//go:nosplit -func (self TCPSocket) KeepAliveEnabled() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveEnabled((uint32)(self0)) - return -} - -// KeepAliveIdleTime represents the imported method "keep-alive-idle-time". -// -// keep-alive-idle-time: func() -// -//go:nosplit -func (self TCPSocket) KeepAliveIdleTime() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveIdleTime((uint32)(self0)) - return -} - -// KeepAliveInterval represents the imported method "keep-alive-interval". -// -// keep-alive-interval: func() -// -//go:nosplit -func (self TCPSocket) KeepAliveInterval() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveInterval((uint32)(self0)) - return -} - -// LocalAddress represents the imported method "local-address". -// -// local-address: func() -// -//go:nosplit -func (self TCPSocket) LocalAddress() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketLocalAddress((uint32)(self0)) - return -} - -// ReceiveBufferSize represents the imported method "receive-buffer-size". -// -// receive-buffer-size: func() -// -//go:nosplit -func (self TCPSocket) ReceiveBufferSize() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketReceiveBufferSize((uint32)(self0)) - return -} - -// RemoteAddress represents the imported method "remote-address". -// -// remote-address: func() -// -//go:nosplit -func (self TCPSocket) RemoteAddress() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketRemoteAddress((uint32)(self0)) - return -} - -// SendBufferSize represents the imported method "send-buffer-size". -// -// send-buffer-size: func() -// -//go:nosplit -func (self TCPSocket) SendBufferSize() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketSendBufferSize((uint32)(self0)) - return -} - -// SetHopLimit represents the imported method "set-hop-limit". -// -// set-hop-limit: func(value: u8) -// -//go:nosplit -func (self TCPSocket) SetHopLimit(value uint8) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint32)(value) - wasmimport_TCPSocketSetHopLimit((uint32)(self0), (uint32)(value0)) - return -} - -// SetKeepAliveCount represents the imported method "set-keep-alive-count". -// -// set-keep-alive-count: func(value: u32) -// -//go:nosplit -func (self TCPSocket) SetKeepAliveCount(value uint32) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint32)(value) - wasmimport_TCPSocketSetKeepAliveCount((uint32)(self0), (uint32)(value0)) - return -} - -// SetKeepAliveEnabled represents the imported method "set-keep-alive-enabled". -// -// set-keep-alive-enabled: func(value: bool) -// -//go:nosplit -func (self TCPSocket) SetKeepAliveEnabled(value bool) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint32)(cm.BoolToU32(value)) - wasmimport_TCPSocketSetKeepAliveEnabled((uint32)(self0), (uint32)(value0)) - return -} - -// SetKeepAliveIdleTime represents the imported method "set-keep-alive-idle-time". -// -// set-keep-alive-idle-time: func(value: duration) -// -//go:nosplit -func (self TCPSocket) SetKeepAliveIdleTime(value Duration) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_TCPSocketSetKeepAliveIdleTime((uint32)(self0), (uint64)(value0)) - return -} - -// SetKeepAliveInterval represents the imported method "set-keep-alive-interval". -// -// set-keep-alive-interval: func(value: duration) -// -//go:nosplit -func (self TCPSocket) SetKeepAliveInterval(value Duration) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_TCPSocketSetKeepAliveInterval((uint32)(self0), (uint64)(value0)) - return -} - -// SetListenBacklogSize represents the imported method "set-listen-backlog-size". -// -// set-listen-backlog-size: func(value: u64) -// -//go:nosplit -func (self TCPSocket) SetListenBacklogSize(value uint64) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_TCPSocketSetListenBacklogSize((uint32)(self0), (uint64)(value0)) - return -} - -// SetReceiveBufferSize represents the imported method "set-receive-buffer-size". -// -// set-receive-buffer-size: func(value: u64) -// -//go:nosplit -func (self TCPSocket) SetReceiveBufferSize(value uint64) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_TCPSocketSetReceiveBufferSize((uint32)(self0), (uint64)(value0)) - return -} - -// SetSendBufferSize represents the imported method "set-send-buffer-size". -// -// set-send-buffer-size: func(value: u64) -// -//go:nosplit -func (self TCPSocket) SetSendBufferSize(value uint64) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_TCPSocketSetSendBufferSize((uint32)(self0), (uint64)(value0)) - return -} - -// Shutdown represents the imported method "shutdown". -// -// shutdown: func(shutdown-type: shutdown-type) -// -//go:nosplit -func (self TCPSocket) Shutdown(shutdownType ShutdownType) { - self0 := cm.Reinterpret[uint32](self) - shutdownType0 := (uint32)(shutdownType) - wasmimport_TCPSocketShutdown((uint32)(self0), (uint32)(shutdownType0)) - return -} - -// StartBind represents the imported method "start-bind". -// -// start-bind: func(network: borrow, local-address: ip-socket-address) -// -//go:nosplit -func (self TCPSocket) StartBind(network_ Network, localAddress IPSocketAddress) { - self0 := cm.Reinterpret[uint32](self) - network0 := cm.Reinterpret[uint32](network_) - localAddress0, localAddress1, localAddress2, localAddress3, localAddress4, localAddress5, localAddress6, localAddress7, localAddress8, localAddress9, localAddress10, localAddress11 := lower_IPSocketAddress(localAddress) - wasmimport_TCPSocketStartBind((uint32)(self0), (uint32)(network0), (uint32)(localAddress0), (uint32)(localAddress1), (uint32)(localAddress2), (uint32)(localAddress3), (uint32)(localAddress4), (uint32)(localAddress5), (uint32)(localAddress6), (uint32)(localAddress7), (uint32)(localAddress8), (uint32)(localAddress9), (uint32)(localAddress10), (uint32)(localAddress11)) - return -} - -// StartConnect represents the imported method "start-connect". -// -// start-connect: func(network: borrow, remote-address: ip-socket-address) -// -//go:nosplit -func (self TCPSocket) StartConnect(network_ Network, remoteAddress IPSocketAddress) { - self0 := cm.Reinterpret[uint32](self) - network0 := cm.Reinterpret[uint32](network_) - remoteAddress0, remoteAddress1, remoteAddress2, remoteAddress3, remoteAddress4, remoteAddress5, remoteAddress6, remoteAddress7, remoteAddress8, remoteAddress9, remoteAddress10, remoteAddress11 := lower_IPSocketAddress(remoteAddress) - wasmimport_TCPSocketStartConnect((uint32)(self0), (uint32)(network0), (uint32)(remoteAddress0), (uint32)(remoteAddress1), (uint32)(remoteAddress2), (uint32)(remoteAddress3), (uint32)(remoteAddress4), (uint32)(remoteAddress5), (uint32)(remoteAddress6), (uint32)(remoteAddress7), (uint32)(remoteAddress8), (uint32)(remoteAddress9), (uint32)(remoteAddress10), (uint32)(remoteAddress11)) - return -} - -// StartListen represents the imported method "start-listen". -// -// start-listen: func() -// -//go:nosplit -func (self TCPSocket) StartListen() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketStartListen((uint32)(self0)) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -// -//go:nosplit -func (self TCPSocket) Subscribe() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketSubscribe((uint32)(self0)) - return -} diff --git a/examples/component/http-server/gen/wasi/sockets/udp-create-socket/empty.s b/examples/component/http-server/gen/wasi/sockets/udp-create-socket/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/sockets/udp-create-socket/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go b/examples/component/http-server/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go deleted file mode 100755 index 96d5914f..00000000 --- a/examples/component/http-server/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package udpcreatesocket represents the imported interface "wasi:sockets/udp-create-socket@0.2.0". -package udpcreatesocket - -import ( - "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/sockets/network" - "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/sockets/udp" -) - -// Network represents the imported type alias "wasi:sockets/udp-create-socket@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// ErrorCode represents the type alias "wasi:sockets/udp-create-socket@0.2.0#error-code". -// -// See [network.ErrorCode] for more information. -type ErrorCode = network.ErrorCode - -// IPAddressFamily represents the type alias "wasi:sockets/udp-create-socket@0.2.0#ip-address-family". -// -// See [network.IPAddressFamily] for more information. -type IPAddressFamily = network.IPAddressFamily - -// UDPSocket represents the imported type alias "wasi:sockets/udp-create-socket@0.2.0#udp-socket". -// -// See [udp.UDPSocket] for more information. -type UDPSocket = udp.UDPSocket - -// CreateUDPSocket represents the imported function "create-udp-socket". -// -// create-udp-socket: func(address-family: ip-address-family) -// -//go:nosplit -func CreateUDPSocket(addressFamily IPAddressFamily) { - addressFamily0 := (uint32)(addressFamily) - wasmimport_CreateUDPSocket((uint32)(addressFamily0)) - return -} diff --git a/examples/component/http-server/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go b/examples/component/http-server/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go deleted file mode 100755 index dfe49e18..00000000 --- a/examples/component/http-server/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package udpcreatesocket - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/udp-create-socket@0.2.0 create-udp-socket -//go:noescape -func wasmimport_CreateUDPSocket(addressFamily0 uint32) diff --git a/examples/component/http-server/gen/wasi/sockets/udp/abi.go b/examples/component/http-server/gen/wasi/sockets/udp/abi.go deleted file mode 100755 index 9f87725c..00000000 --- a/examples/component/http-server/gen/wasi/sockets/udp/abi.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package udp - -import ( - "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/sockets/network" - "go.bytecodealliance.org/cm" -) - -func lower_IPv4Address(v network.IPv4Address) (f0 uint32, f1 uint32, f2 uint32, f3 uint32) { - f0 = (uint32)(v[0]) - f1 = (uint32)(v[1]) - f2 = (uint32)(v[2]) - f3 = (uint32)(v[3]) - return -} - -func lower_IPv4SocketAddress(v network.IPv4SocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32) { - f0 = (uint32)(v.Port) - f1, f2, f3, f4 = lower_IPv4Address(v.Address) - return -} - -func lower_IPv6Address(v network.IPv6Address) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32) { - f0 = (uint32)(v[0]) - f1 = (uint32)(v[1]) - f2 = (uint32)(v[2]) - f3 = (uint32)(v[3]) - f4 = (uint32)(v[4]) - f5 = (uint32)(v[5]) - f6 = (uint32)(v[6]) - f7 = (uint32)(v[7]) - return -} - -func lower_IPv6SocketAddress(v network.IPv6SocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32) { - f0 = (uint32)(v.Port) - f1 = (uint32)(v.FlowInfo) - f2, f3, f4, f5, f6, f7, f8, f9 = lower_IPv6Address(v.Address) - f10 = (uint32)(v.ScopeID) - return -} - -func lower_IPSocketAddress(v network.IPSocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32, f11 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 0: // ipv4 - v1, v2, v3, v4, v5 := lower_IPv4SocketAddress(*cm.Case[network.IPv4SocketAddress](&v, 0)) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 1: // ipv6 - v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11 := lower_IPv6SocketAddress(*cm.Case[network.IPv6SocketAddress](&v, 1)) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - f6 = (uint32)(v6) - f7 = (uint32)(v7) - f8 = (uint32)(v8) - f9 = (uint32)(v9) - f10 = (uint32)(v10) - f11 = (uint32)(v11) - } - return -} - -func lower_OptionIPSocketAddress(v cm.Option[IPSocketAddress]) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32, f11 uint32, f12 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12 := lower_IPSocketAddress(*some) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - f6 = (uint32)(v6) - f7 = (uint32)(v7) - f8 = (uint32)(v8) - f9 = (uint32)(v9) - f10 = (uint32)(v10) - f11 = (uint32)(v11) - f12 = (uint32)(v12) - } - return -} diff --git a/examples/component/http-server/gen/wasi/sockets/udp/empty.s b/examples/component/http-server/gen/wasi/sockets/udp/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasi/sockets/udp/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasi/sockets/udp/udp.wasm.go b/examples/component/http-server/gen/wasi/sockets/udp/udp.wasm.go deleted file mode 100755 index 0b0fd6ba..00000000 --- a/examples/component/http-server/gen/wasi/sockets/udp/udp.wasm.go +++ /dev/null @@ -1,89 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package udp - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/udp@0.2.0 [resource-drop]udp-socket -//go:noescape -func wasmimport_UDPSocketResourceDrop(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.address-family -//go:noescape -func wasmimport_UDPSocketAddressFamily(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.finish-bind -//go:noescape -func wasmimport_UDPSocketFinishBind(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.local-address -//go:noescape -func wasmimport_UDPSocketLocalAddress(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.receive-buffer-size -//go:noescape -func wasmimport_UDPSocketReceiveBufferSize(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.remote-address -//go:noescape -func wasmimport_UDPSocketRemoteAddress(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.send-buffer-size -//go:noescape -func wasmimport_UDPSocketSendBufferSize(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.set-receive-buffer-size -//go:noescape -func wasmimport_UDPSocketSetReceiveBufferSize(self0 uint32, value0 uint64) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.set-send-buffer-size -//go:noescape -func wasmimport_UDPSocketSetSendBufferSize(self0 uint32, value0 uint64) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.set-unicast-hop-limit -//go:noescape -func wasmimport_UDPSocketSetUnicastHopLimit(self0 uint32, value0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.start-bind -//go:noescape -func wasmimport_UDPSocketStartBind(self0 uint32, network0 uint32, localAddress0 uint32, localAddress1 uint32, localAddress2 uint32, localAddress3 uint32, localAddress4 uint32, localAddress5 uint32, localAddress6 uint32, localAddress7 uint32, localAddress8 uint32, localAddress9 uint32, localAddress10 uint32, localAddress11 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.stream -//go:noescape -func wasmimport_UDPSocketStream(self0 uint32, remoteAddress0 uint32, remoteAddress1 uint32, remoteAddress2 uint32, remoteAddress3 uint32, remoteAddress4 uint32, remoteAddress5 uint32, remoteAddress6 uint32, remoteAddress7 uint32, remoteAddress8 uint32, remoteAddress9 uint32, remoteAddress10 uint32, remoteAddress11 uint32, remoteAddress12 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.subscribe -//go:noescape -func wasmimport_UDPSocketSubscribe(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.unicast-hop-limit -//go:noescape -func wasmimport_UDPSocketUnicastHopLimit(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [resource-drop]incoming-datagram-stream -//go:noescape -func wasmimport_IncomingDatagramStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]incoming-datagram-stream.receive -//go:noescape -func wasmimport_IncomingDatagramStreamReceive(self0 uint32, maxResults0 uint64) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]incoming-datagram-stream.subscribe -//go:noescape -func wasmimport_IncomingDatagramStreamSubscribe(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [resource-drop]outgoing-datagram-stream -//go:noescape -func wasmimport_OutgoingDatagramStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]outgoing-datagram-stream.check-send -//go:noescape -func wasmimport_OutgoingDatagramStreamCheckSend(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]outgoing-datagram-stream.send -//go:noescape -func wasmimport_OutgoingDatagramStreamSend(self0 uint32, datagrams0 *OutgoingDatagram, datagrams1 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]outgoing-datagram-stream.subscribe -//go:noescape -func wasmimport_OutgoingDatagramStreamSubscribe(self0 uint32) diff --git a/examples/component/http-server/gen/wasi/sockets/udp/udp.wit.go b/examples/component/http-server/gen/wasi/sockets/udp/udp.wit.go deleted file mode 100755 index c20a451f..00000000 --- a/examples/component/http-server/gen/wasi/sockets/udp/udp.wit.go +++ /dev/null @@ -1,313 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package udp represents the imported interface "wasi:sockets/udp@0.2.0". -package udp - -import ( - "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/io/poll" - "github.com/wasmCloud/go/examples/component/http-server/gen/wasi/sockets/network" - "go.bytecodealliance.org/cm" -) - -// Pollable represents the imported type alias "wasi:sockets/udp@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// Network represents the imported type alias "wasi:sockets/udp@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// ErrorCode represents the type alias "wasi:sockets/udp@0.2.0#error-code". -// -// See [network.ErrorCode] for more information. -type ErrorCode = network.ErrorCode - -// IPSocketAddress represents the type alias "wasi:sockets/udp@0.2.0#ip-socket-address". -// -// See [network.IPSocketAddress] for more information. -type IPSocketAddress = network.IPSocketAddress - -// IPAddressFamily represents the type alias "wasi:sockets/udp@0.2.0#ip-address-family". -// -// See [network.IPAddressFamily] for more information. -type IPAddressFamily = network.IPAddressFamily - -// IncomingDatagram represents the record "wasi:sockets/udp@0.2.0#incoming-datagram". -// -// record incoming-datagram { -// data: list, -// remote-address: ip-socket-address, -// } -type IncomingDatagram struct { - _ cm.HostLayout - Data cm.List[uint8] - RemoteAddress IPSocketAddress -} - -// OutgoingDatagram represents the record "wasi:sockets/udp@0.2.0#outgoing-datagram". -// -// record outgoing-datagram { -// data: list, -// remote-address: option, -// } -type OutgoingDatagram struct { - _ cm.HostLayout - Data cm.List[uint8] - RemoteAddress cm.Option[IPSocketAddress] -} - -// UDPSocket represents the imported resource "wasi:sockets/udp@0.2.0#udp-socket". -// -// resource udp-socket -type UDPSocket cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "udp-socket". -// -// Drops a resource handle. -// -//go:nosplit -func (self UDPSocket) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketResourceDrop((uint32)(self0)) - return -} - -// AddressFamily represents the imported method "address-family". -// -// address-family: func() -// -//go:nosplit -func (self UDPSocket) AddressFamily() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketAddressFamily((uint32)(self0)) - return -} - -// FinishBind represents the imported method "finish-bind". -// -// finish-bind: func() -// -//go:nosplit -func (self UDPSocket) FinishBind() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketFinishBind((uint32)(self0)) - return -} - -// LocalAddress represents the imported method "local-address". -// -// local-address: func() -// -//go:nosplit -func (self UDPSocket) LocalAddress() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketLocalAddress((uint32)(self0)) - return -} - -// ReceiveBufferSize represents the imported method "receive-buffer-size". -// -// receive-buffer-size: func() -// -//go:nosplit -func (self UDPSocket) ReceiveBufferSize() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketReceiveBufferSize((uint32)(self0)) - return -} - -// RemoteAddress represents the imported method "remote-address". -// -// remote-address: func() -// -//go:nosplit -func (self UDPSocket) RemoteAddress() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketRemoteAddress((uint32)(self0)) - return -} - -// SendBufferSize represents the imported method "send-buffer-size". -// -// send-buffer-size: func() -// -//go:nosplit -func (self UDPSocket) SendBufferSize() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketSendBufferSize((uint32)(self0)) - return -} - -// SetReceiveBufferSize represents the imported method "set-receive-buffer-size". -// -// set-receive-buffer-size: func(value: u64) -// -//go:nosplit -func (self UDPSocket) SetReceiveBufferSize(value uint64) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_UDPSocketSetReceiveBufferSize((uint32)(self0), (uint64)(value0)) - return -} - -// SetSendBufferSize represents the imported method "set-send-buffer-size". -// -// set-send-buffer-size: func(value: u64) -// -//go:nosplit -func (self UDPSocket) SetSendBufferSize(value uint64) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_UDPSocketSetSendBufferSize((uint32)(self0), (uint64)(value0)) - return -} - -// SetUnicastHopLimit represents the imported method "set-unicast-hop-limit". -// -// set-unicast-hop-limit: func(value: u8) -// -//go:nosplit -func (self UDPSocket) SetUnicastHopLimit(value uint8) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint32)(value) - wasmimport_UDPSocketSetUnicastHopLimit((uint32)(self0), (uint32)(value0)) - return -} - -// StartBind represents the imported method "start-bind". -// -// start-bind: func(network: borrow, local-address: ip-socket-address) -// -//go:nosplit -func (self UDPSocket) StartBind(network_ Network, localAddress IPSocketAddress) { - self0 := cm.Reinterpret[uint32](self) - network0 := cm.Reinterpret[uint32](network_) - localAddress0, localAddress1, localAddress2, localAddress3, localAddress4, localAddress5, localAddress6, localAddress7, localAddress8, localAddress9, localAddress10, localAddress11 := lower_IPSocketAddress(localAddress) - wasmimport_UDPSocketStartBind((uint32)(self0), (uint32)(network0), (uint32)(localAddress0), (uint32)(localAddress1), (uint32)(localAddress2), (uint32)(localAddress3), (uint32)(localAddress4), (uint32)(localAddress5), (uint32)(localAddress6), (uint32)(localAddress7), (uint32)(localAddress8), (uint32)(localAddress9), (uint32)(localAddress10), (uint32)(localAddress11)) - return -} - -// Stream represents the imported method "stream". -// -// %stream: func(remote-address: option) -// -//go:nosplit -func (self UDPSocket) Stream(remoteAddress cm.Option[IPSocketAddress]) { - self0 := cm.Reinterpret[uint32](self) - remoteAddress0, remoteAddress1, remoteAddress2, remoteAddress3, remoteAddress4, remoteAddress5, remoteAddress6, remoteAddress7, remoteAddress8, remoteAddress9, remoteAddress10, remoteAddress11, remoteAddress12 := lower_OptionIPSocketAddress(remoteAddress) - wasmimport_UDPSocketStream((uint32)(self0), (uint32)(remoteAddress0), (uint32)(remoteAddress1), (uint32)(remoteAddress2), (uint32)(remoteAddress3), (uint32)(remoteAddress4), (uint32)(remoteAddress5), (uint32)(remoteAddress6), (uint32)(remoteAddress7), (uint32)(remoteAddress8), (uint32)(remoteAddress9), (uint32)(remoteAddress10), (uint32)(remoteAddress11), (uint32)(remoteAddress12)) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -// -//go:nosplit -func (self UDPSocket) Subscribe() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketSubscribe((uint32)(self0)) - return -} - -// UnicastHopLimit represents the imported method "unicast-hop-limit". -// -// unicast-hop-limit: func() -// -//go:nosplit -func (self UDPSocket) UnicastHopLimit() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketUnicastHopLimit((uint32)(self0)) - return -} - -// IncomingDatagramStream represents the imported resource "wasi:sockets/udp@0.2.0#incoming-datagram-stream". -// -// resource incoming-datagram-stream -type IncomingDatagramStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "incoming-datagram-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self IncomingDatagramStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingDatagramStreamResourceDrop((uint32)(self0)) - return -} - -// Receive represents the imported method "receive". -// -// receive: func(max-results: u64) -// -//go:nosplit -func (self IncomingDatagramStream) Receive(maxResults uint64) { - self0 := cm.Reinterpret[uint32](self) - maxResults0 := (uint64)(maxResults) - wasmimport_IncomingDatagramStreamReceive((uint32)(self0), (uint64)(maxResults0)) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -// -//go:nosplit -func (self IncomingDatagramStream) Subscribe() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingDatagramStreamSubscribe((uint32)(self0)) - return -} - -// OutgoingDatagramStream represents the imported resource "wasi:sockets/udp@0.2.0#outgoing-datagram-stream". -// -// resource outgoing-datagram-stream -type OutgoingDatagramStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "outgoing-datagram-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self OutgoingDatagramStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingDatagramStreamResourceDrop((uint32)(self0)) - return -} - -// CheckSend represents the imported method "check-send". -// -// check-send: func() -// -//go:nosplit -func (self OutgoingDatagramStream) CheckSend() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingDatagramStreamCheckSend((uint32)(self0)) - return -} - -// Send represents the imported method "send". -// -// send: func(datagrams: list) -// -//go:nosplit -func (self OutgoingDatagramStream) Send(datagrams cm.List[OutgoingDatagram]) { - self0 := cm.Reinterpret[uint32](self) - datagrams0, datagrams1 := cm.LowerList(datagrams) - wasmimport_OutgoingDatagramStreamSend((uint32)(self0), (*OutgoingDatagram)(datagrams0), (uint32)(datagrams1)) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -// -//go:nosplit -func (self OutgoingDatagramStream) Subscribe() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingDatagramStreamSubscribe((uint32)(self0)) - return -} diff --git a/examples/component/http-server/gen/wasmcloud/bus/lattice/empty.s b/examples/component/http-server/gen/wasmcloud/bus/lattice/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasmcloud/bus/lattice/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasmcloud/bus/lattice/lattice.wasm.go b/examples/component/http-server/gen/wasmcloud/bus/lattice/lattice.wasm.go deleted file mode 100755 index 6c044549..00000000 --- a/examples/component/http-server/gen/wasmcloud/bus/lattice/lattice.wasm.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package lattice - -// This file contains wasmimport and wasmexport declarations for "wasmcloud:bus@1.0.0". - -//go:wasmimport wasmcloud:bus/lattice@1.0.0 [resource-drop]call-target-interface -//go:noescape -func wasmimport_CallTargetInterfaceResourceDrop(self0 uint32) - -//go:wasmimport wasmcloud:bus/lattice@1.0.0 [constructor]call-target-interface -//go:noescape -func wasmimport_NewCallTargetInterface(namespace0 *uint8, namespace1 uint32, package0 *uint8, package1 uint32, interface0 *uint8, interface1 uint32) - -//go:wasmimport wasmcloud:bus/lattice@1.0.0 set-link-name -//go:noescape -func wasmimport_SetLinkName(name0 *uint8, name1 uint32, interfaces0 *CallTargetInterface, interfaces1 uint32) diff --git a/examples/component/http-server/gen/wasmcloud/bus/lattice/lattice.wit.go b/examples/component/http-server/gen/wasmcloud/bus/lattice/lattice.wit.go deleted file mode 100755 index af5d44b6..00000000 --- a/examples/component/http-server/gen/wasmcloud/bus/lattice/lattice.wit.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package lattice represents the imported interface "wasmcloud:bus/lattice@1.0.0". -package lattice - -import ( - "go.bytecodealliance.org/cm" -) - -// CallTargetInterface represents the imported resource "wasmcloud:bus/lattice@1.0.0#call-target-interface". -// -// resource call-target-interface -type CallTargetInterface cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "call-target-interface". -// -// Drops a resource handle. -// -//go:nosplit -func (self CallTargetInterface) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_CallTargetInterfaceResourceDrop((uint32)(self0)) - return -} - -// NewCallTargetInterface represents the imported constructor for resource "call-target-interface". -// -// constructor(namespace: string, %package: string, %interface: string) -// -//go:nosplit -func NewCallTargetInterface(namespace string, package_ string, interface_ string) { - namespace0, namespace1 := cm.LowerString(namespace) - package0, package1 := cm.LowerString(package_) - interface0, interface1 := cm.LowerString(interface_) - wasmimport_NewCallTargetInterface((*uint8)(namespace0), (uint32)(namespace1), (*uint8)(package0), (uint32)(package1), (*uint8)(interface0), (uint32)(interface1)) - return -} - -// SetLinkName represents the imported function "set-link-name". -// -// set-link-name: func(name: string, interfaces: list) -// -//go:nosplit -func SetLinkName(name string, interfaces cm.List[CallTargetInterface]) { - name0, name1 := cm.LowerString(name) - interfaces0, interfaces1 := cm.LowerList(interfaces) - wasmimport_SetLinkName((*uint8)(name0), (uint32)(name1), (*CallTargetInterface)(interfaces0), (uint32)(interfaces1)) - return -} diff --git a/examples/component/http-server/gen/wasmcloud/secrets/reveal/empty.s b/examples/component/http-server/gen/wasmcloud/secrets/reveal/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasmcloud/secrets/reveal/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasmcloud/secrets/reveal/reveal.wasm.go b/examples/component/http-server/gen/wasmcloud/secrets/reveal/reveal.wasm.go deleted file mode 100755 index a6d83174..00000000 --- a/examples/component/http-server/gen/wasmcloud/secrets/reveal/reveal.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package reveal - -// This file contains wasmimport and wasmexport declarations for "wasmcloud:secrets@0.1.0-draft". - -//go:wasmimport wasmcloud:secrets/reveal@0.1.0-draft reveal -//go:noescape -func wasmimport_Reveal(s0 uint32) diff --git a/examples/component/http-server/gen/wasmcloud/secrets/reveal/reveal.wit.go b/examples/component/http-server/gen/wasmcloud/secrets/reveal/reveal.wit.go deleted file mode 100755 index 6503d39c..00000000 --- a/examples/component/http-server/gen/wasmcloud/secrets/reveal/reveal.wit.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package reveal represents the imported interface "wasmcloud:secrets/reveal@0.1.0-draft". -package reveal - -import ( - "github.com/wasmCloud/go/examples/component/http-server/gen/wasmcloud/secrets/store" - "go.bytecodealliance.org/cm" -) - -// Secret represents the imported type alias "wasmcloud:secrets/reveal@0.1.0-draft#secret". -// -// See [store.Secret] for more information. -type Secret = store.Secret - -// SecretValue represents the type alias "wasmcloud:secrets/reveal@0.1.0-draft#secret-value". -// -// See [store.SecretValue] for more information. -type SecretValue = store.SecretValue - -// Reveal represents the imported function "reveal". -// -// reveal: func(s: borrow) -// -//go:nosplit -func Reveal(s Secret) { - s0 := cm.Reinterpret[uint32](s) - wasmimport_Reveal((uint32)(s0)) - return -} diff --git a/examples/component/http-server/gen/wasmcloud/secrets/store/abi.go b/examples/component/http-server/gen/wasmcloud/secrets/store/abi.go deleted file mode 100755 index 20affd6c..00000000 --- a/examples/component/http-server/gen/wasmcloud/secrets/store/abi.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package store - -import ( - "go.bytecodealliance.org/cm" - "unsafe" -) - -// SecretsErrorShape is used for storage in variant or result types. -type SecretsErrorShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(SecretsError{})]byte -} diff --git a/examples/component/http-server/gen/wasmcloud/secrets/store/empty.s b/examples/component/http-server/gen/wasmcloud/secrets/store/empty.s deleted file mode 100755 index 5444f200..00000000 --- a/examples/component/http-server/gen/wasmcloud/secrets/store/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/http-server/gen/wasmcloud/secrets/store/store.wasm.go b/examples/component/http-server/gen/wasmcloud/secrets/store/store.wasm.go deleted file mode 100755 index 4ef43490..00000000 --- a/examples/component/http-server/gen/wasmcloud/secrets/store/store.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package store - -// This file contains wasmimport and wasmexport declarations for "wasmcloud:secrets@0.1.0-draft". - -//go:wasmimport wasmcloud:secrets/store@0.1.0-draft [resource-drop]secret -//go:noescape -func wasmimport_SecretResourceDrop(self0 uint32) - -//go:wasmimport wasmcloud:secrets/store@0.1.0-draft get -//go:noescape -func wasmimport_Get(key0 *uint8, key1 uint32) diff --git a/examples/component/http-server/gen/wasmcloud/secrets/store/store.wit.go b/examples/component/http-server/gen/wasmcloud/secrets/store/store.wit.go deleted file mode 100755 index 405555fa..00000000 --- a/examples/component/http-server/gen/wasmcloud/secrets/store/store.wit.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package store represents the imported interface "wasmcloud:secrets/store@0.1.0-draft". -package store - -import ( - "go.bytecodealliance.org/cm" -) - -// SecretsError represents the variant "wasmcloud:secrets/store@0.1.0-draft#secrets-error". -// -// variant secrets-error { -// upstream(string), -// io(string), -// not-found, -// } -type SecretsError cm.Variant[uint8, string, string] - -// SecretsErrorUpstream returns a [SecretsError] of case "upstream". -func SecretsErrorUpstream(data string) SecretsError { - return cm.New[SecretsError](0, data) -} - -// Upstream returns a non-nil *[string] if [SecretsError] represents the variant case "upstream". -func (self *SecretsError) Upstream() *string { - return cm.Case[string](self, 0) -} - -// SecretsErrorIO returns a [SecretsError] of case "io". -func SecretsErrorIO(data string) SecretsError { - return cm.New[SecretsError](1, data) -} - -// IO returns a non-nil *[string] if [SecretsError] represents the variant case "io". -func (self *SecretsError) IO() *string { - return cm.Case[string](self, 1) -} - -// SecretsErrorNotFound returns a [SecretsError] of case "not-found". -func SecretsErrorNotFound() SecretsError { - var data struct{} - return cm.New[SecretsError](2, data) -} - -// NotFound returns true if [SecretsError] represents the variant case "not-found". -func (self *SecretsError) NotFound() bool { - return self.Tag() == 2 -} - -var stringsSecretsError = [3]string{ - "upstream", - "io", - "not-found", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v SecretsError) String() string { - return stringsSecretsError[v.Tag()] -} - -// SecretValue represents the variant "wasmcloud:secrets/store@0.1.0-draft#secret-value". -// -// variant secret-value { -// %string(string), -// bytes(list), -// } -type SecretValue cm.Variant[uint8, string, cm.List[uint8]] - -// SecretValueString_ returns a [SecretValue] of case "string". -func SecretValueString_(data string) SecretValue { - return cm.New[SecretValue](0, data) -} - -// String_ returns a non-nil *[string] if [SecretValue] represents the variant case "string". -func (self *SecretValue) String_() *string { - return cm.Case[string](self, 0) -} - -// SecretValueBytes returns a [SecretValue] of case "bytes". -func SecretValueBytes(data cm.List[uint8]) SecretValue { - return cm.New[SecretValue](1, data) -} - -// Bytes returns a non-nil *[cm.List[uint8]] if [SecretValue] represents the variant case "bytes". -func (self *SecretValue) Bytes() *cm.List[uint8] { - return cm.Case[cm.List[uint8]](self, 1) -} - -var stringsSecretValue = [2]string{ - "string", - "bytes", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v SecretValue) String() string { - return stringsSecretValue[v.Tag()] -} - -// Secret represents the imported resource "wasmcloud:secrets/store@0.1.0-draft#secret". -// -// resource secret -type Secret cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "secret". -// -// Drops a resource handle. -// -//go:nosplit -func (self Secret) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_SecretResourceDrop((uint32)(self0)) - return -} - -// Get represents the imported function "get". -// -// get: func(key: string) -// -//go:nosplit -func Get(key string) { - key0, key1 := cm.LowerString(key) - wasmimport_Get((*uint8)(key0), (uint32)(key1)) - return -} diff --git a/examples/component/invoke/.gitignore b/examples/component/invoke/.gitignore index e69de29b..eaec1317 100644 --- a/examples/component/invoke/.gitignore +++ b/examples/component/invoke/.gitignore @@ -0,0 +1,2 @@ +gen/* +build/* \ No newline at end of file diff --git a/examples/component/invoke/gen/example/invoker/example/example.wit b/examples/component/invoke/gen/example/invoker/example/example.wit deleted file mode 100755 index 76c29b80..00000000 --- a/examples/component/invoke/gen/example/invoker/example/example.wit +++ /dev/null @@ -1,704 +0,0 @@ -package example:invoker; - -interface invoker { - call: func() -> string; -} - -world example { - import wasi:logging/logging@0.1.0-draft; - import wasi:config/runtime@0.2.0-draft; - import wasi:io/poll@0.2.0; - import wasi:clocks/monotonic-clock@0.2.0; - import wasi:io/error@0.2.0; - import wasi:io/streams@0.2.0; - import wasi:http/types@0.2.0; - import wasi:http/outgoing-handler@0.2.0; - import wasmcloud:bus/lattice@1.0.0; - import wasmcloud:secrets/store@0.1.0-draft; - import wasmcloud:secrets/reveal@0.1.0-draft; - import wasi:cli/environment@0.2.0; - import wasi:cli/exit@0.2.0; - import wasi:cli/stdin@0.2.0; - import wasi:cli/stdout@0.2.0; - import wasi:cli/stderr@0.2.0; - import wasi:cli/terminal-input@0.2.0; - import wasi:cli/terminal-output@0.2.0; - import wasi:cli/terminal-stdin@0.2.0; - import wasi:cli/terminal-stdout@0.2.0; - import wasi:cli/terminal-stderr@0.2.0; - import wasi:clocks/wall-clock@0.2.0; - import wasi:filesystem/types@0.2.0; - import wasi:filesystem/preopens@0.2.0; - import wasi:sockets/network@0.2.0; - import wasi:sockets/instance-network@0.2.0; - import wasi:sockets/udp@0.2.0; - import wasi:sockets/udp-create-socket@0.2.0; - import wasi:sockets/tcp@0.2.0; - import wasi:sockets/tcp-create-socket@0.2.0; - import wasi:sockets/ip-name-lookup@0.2.0; - import wasi:random/random@0.2.0; - import wasi:random/insecure@0.2.0; - import wasi:random/insecure-seed@0.2.0; - export invoker; -} - -package wasi:cli@0.2.0 { - interface environment { - get-environment: func() -> list>; - get-arguments: func() -> list; - initial-cwd: func() -> option; - } - - interface exit { - exit: func(status: result); - } - - interface stdin { - use wasi:io/streams@0.2.0.{input-stream}; - get-stdin: func() -> input-stream; - } - - interface stdout { - use wasi:io/streams@0.2.0.{output-stream}; - get-stdout: func() -> output-stream; - } - - interface stderr { - use wasi:io/streams@0.2.0.{output-stream}; - get-stderr: func() -> output-stream; - } - - interface terminal-input { - resource terminal-input; - } - - interface terminal-output { - resource terminal-output; - } - - interface terminal-stdin { - use terminal-input.{terminal-input}; - get-terminal-stdin: func() -> option; - } - - interface terminal-stdout { - use terminal-output.{terminal-output}; - get-terminal-stdout: func() -> option; - } - - interface terminal-stderr { - use terminal-output.{terminal-output}; - get-terminal-stderr: func() -> option; - } -} - -package wasi:config@0.2.0-draft { - interface runtime { - variant config-error { - upstream(string), - io(string), - } - get: func(key: string) -> result, config-error>; - get-all: func() -> result>, config-error>; - } -} - -package wasi:filesystem@0.2.0 { - interface types { - use wasi:io/streams@0.2.0.{input-stream}; - use wasi:io/streams@0.2.0.{output-stream}; - use wasi:io/streams@0.2.0.{error}; - use wasi:clocks/wall-clock@0.2.0.{datetime}; - type filesize = u64; - enum descriptor-type { - unknown, - block-device, - character-device, - directory, - fifo, - symbolic-link, - regular-file, - socket - } - flags descriptor-flags { - read, - write, - file-integrity-sync, - data-integrity-sync, - requested-write-sync, - mutate-directory, - } - flags path-flags { symlink-follow } - flags open-flags { - create, - directory, - exclusive, - truncate, - } - type link-count = u64; - record descriptor-stat { - %type: descriptor-type, - link-count: link-count, - size: filesize, - data-access-timestamp: option, - data-modification-timestamp: option, - status-change-timestamp: option, - } - variant new-timestamp { - no-change, - now, - timestamp(datetime), - } - record directory-entry { - %type: descriptor-type, - name: string, - } - enum error-code { - access, - would-block, - already, - bad-descriptor, - busy, - deadlock, - quota, - exist, - file-too-large, - illegal-byte-sequence, - in-progress, - interrupted, - invalid, - io, - is-directory, - loop, - too-many-links, - message-size, - name-too-long, - no-device, - no-entry, - no-lock, - insufficient-memory, - insufficient-space, - not-directory, - not-empty, - not-recoverable, - unsupported, - no-tty, - no-such-device, - overflow, - not-permitted, - pipe, - read-only, - invalid-seek, - text-file-busy, - cross-device - } - enum advice { - normal, - sequential, - random, - will-need, - dont-need, - no-reuse - } - record metadata-hash-value { - lower: u64, - upper: u64, - } - resource descriptor { - advise: func(offset: filesize, length: filesize, advice: advice) -> result<_, error-code>; - append-via-stream: func() -> result; - create-directory-at: func(path: string) -> result<_, error-code>; - get-flags: func() -> result; - get-type: func() -> result; - is-same-object: func(other: borrow) -> bool; - link-at: func(old-path-flags: path-flags, old-path: string, new-descriptor: borrow, new-path: string) -> result<_, error-code>; - metadata-hash: func() -> result; - metadata-hash-at: func(path-flags: path-flags, path: string) -> result; - open-at: func(path-flags: path-flags, path: string, open-flags: open-flags, %flags: descriptor-flags) -> result; - read: func(length: filesize, offset: filesize) -> result, bool>, error-code>; - read-directory: func() -> result; - read-via-stream: func(offset: filesize) -> result; - readlink-at: func(path: string) -> result; - remove-directory-at: func(path: string) -> result<_, error-code>; - rename-at: func(old-path: string, new-descriptor: borrow, new-path: string) -> result<_, error-code>; - set-size: func(size: filesize) -> result<_, error-code>; - set-times: func(data-access-timestamp: new-timestamp, data-modification-timestamp: new-timestamp) -> result<_, error-code>; - set-times-at: func(path-flags: path-flags, path: string, data-access-timestamp: new-timestamp, data-modification-timestamp: new-timestamp) -> result<_, error-code>; - stat: func() -> result; - stat-at: func(path-flags: path-flags, path: string) -> result; - symlink-at: func(old-path: string, new-path: string) -> result<_, error-code>; - sync: func() -> result<_, error-code>; - sync-data: func() -> result<_, error-code>; - unlink-file-at: func(path: string) -> result<_, error-code>; - write: func(buffer: list, offset: filesize) -> result; - write-via-stream: func(offset: filesize) -> result; - } - resource directory-entry-stream { - read-directory-entry: func() -> result, error-code>; - } - filesystem-error-code: func(err: borrow) -> option; - } - - interface preopens { - use types.{descriptor}; - get-directories: func() -> list>; - } -} - -package wasi:http@0.2.0 { - interface types { - use wasi:clocks/monotonic-clock@0.2.0.{duration}; - use wasi:io/streams@0.2.0.{input-stream}; - use wasi:io/streams@0.2.0.{output-stream}; - use wasi:io/error@0.2.0.{error as io-error}; - use wasi:io/poll@0.2.0.{pollable}; - variant method { - get, - head, - post, - put, - delete, - connect, - options, - trace, - patch, - other(string), - } - variant scheme { HTTP, HTTPS, other(string) } - record DNS-error-payload { - rcode: option, - info-code: option, - } - record TLS-alert-received-payload { - alert-id: option, - alert-message: option, - } - record field-size-payload { - field-name: option, - field-size: option, - } - variant error-code { - DNS-timeout, - DNS-error(DNS-error-payload), - destination-not-found, - destination-unavailable, - destination-IP-prohibited, - destination-IP-unroutable, - connection-refused, - connection-terminated, - connection-timeout, - connection-read-timeout, - connection-write-timeout, - connection-limit-reached, - TLS-protocol-error, - TLS-certificate-error, - TLS-alert-received(TLS-alert-received-payload), - HTTP-request-denied, - HTTP-request-length-required, - HTTP-request-body-size(option), - HTTP-request-method-invalid, - HTTP-request-URI-invalid, - HTTP-request-URI-too-long, - HTTP-request-header-section-size(option), - HTTP-request-header-size(option), - HTTP-request-trailer-section-size(option), - HTTP-request-trailer-size(field-size-payload), - HTTP-response-incomplete, - HTTP-response-header-section-size(option), - HTTP-response-header-size(field-size-payload), - HTTP-response-body-size(option), - HTTP-response-trailer-section-size(option), - HTTP-response-trailer-size(field-size-payload), - HTTP-response-transfer-coding(option), - HTTP-response-content-coding(option), - HTTP-response-timeout, - HTTP-upgrade-failed, - HTTP-protocol-error, - loop-detected, - configuration-error, - internal-error(option), - } - variant header-error { - invalid-syntax, - forbidden, - immutable, - } - type field-key = string; - type field-value = list; - resource fields { - constructor(); - append: func(name: field-key, value: field-value) -> result<_, header-error>; - clone: func() -> fields; - delete: func(name: field-key) -> result<_, header-error>; - entries: func() -> list>; - get: func(name: field-key) -> list; - has: func(name: field-key) -> bool; - set: func(name: field-key, value: list) -> result<_, header-error>; - from-list: static func(entries: list>) -> result; - } - type headers = fields; - type trailers = fields; - resource incoming-request { - authority: func() -> option; - consume: func() -> result; - headers: func() -> headers; - method: func() -> method; - path-with-query: func() -> option; - scheme: func() -> option; - } - resource outgoing-request { - constructor(headers: headers); - authority: func() -> option; - body: func() -> result; - headers: func() -> headers; - method: func() -> method; - path-with-query: func() -> option; - scheme: func() -> option; - set-authority: func(authority: option) -> result; - set-method: func(method: method) -> result; - set-path-with-query: func(path-with-query: option) -> result; - set-scheme: func(scheme: option) -> result; - } - resource request-options { - constructor(); - between-bytes-timeout: func() -> option; - connect-timeout: func() -> option; - first-byte-timeout: func() -> option; - set-between-bytes-timeout: func(duration: option) -> result; - set-connect-timeout: func(duration: option) -> result; - set-first-byte-timeout: func(duration: option) -> result; - } - resource response-outparam { - set: static func(param: response-outparam, response: result); - } - type status-code = u16; - resource incoming-response { - consume: func() -> result; - headers: func() -> headers; - status: func() -> status-code; - } - resource incoming-body { - %stream: func() -> result; - finish: static func(this: incoming-body) -> future-trailers; - } - resource future-trailers { - get: func() -> option, error-code>>>; - subscribe: func() -> pollable; - } - resource outgoing-response { - constructor(headers: headers); - body: func() -> result; - headers: func() -> headers; - set-status-code: func(status-code: status-code) -> result; - status-code: func() -> status-code; - } - resource outgoing-body { - write: func() -> result; - finish: static func(this: outgoing-body, trailers: option) -> result<_, error-code>; - } - resource future-incoming-response { - get: func() -> option>>; - subscribe: func() -> pollable; - } - http-error-code: func(err: borrow) -> option; - } - - interface outgoing-handler { - use types.{outgoing-request}; - use types.{request-options}; - use types.{future-incoming-response}; - use types.{error-code}; - handle: func(request: outgoing-request, options: option) -> result; - } -} - -package wasi:logging@0.1.0-draft { - interface logging { - enum level { - trace, - debug, - info, - warn, - error, - critical - } - log: func(level: level, context: string, message: string); - } -} - -package wasi:random@0.2.0 { - interface random { - get-random-bytes: func(len: u64) -> list; - get-random-u64: func() -> u64; - } - - interface insecure { - get-insecure-random-bytes: func(len: u64) -> list; - get-insecure-random-u64: func() -> u64; - } - - interface insecure-seed { - insecure-seed: func() -> tuple; - } -} - -package wasi:sockets@0.2.0 { - interface network { - resource network; - enum error-code { - unknown, - access-denied, - not-supported, - invalid-argument, - out-of-memory, - timeout, - concurrency-conflict, - not-in-progress, - would-block, - invalid-state, - new-socket-limit, - address-not-bindable, - address-in-use, - remote-unreachable, - connection-refused, - connection-reset, - connection-aborted, - datagram-too-large, - name-unresolvable, - temporary-resolver-failure, - permanent-resolver-failure - } - enum ip-address-family { ipv4, ipv6 } - type ipv4-address = tuple; - type ipv6-address = tuple; - variant ip-address { - ipv4(ipv4-address), - ipv6(ipv6-address), - } - record ipv4-socket-address { - port: u16, - address: ipv4-address, - } - record ipv6-socket-address { - port: u16, - flow-info: u32, - address: ipv6-address, - scope-id: u32, - } - variant ip-socket-address { - ipv4(ipv4-socket-address), - ipv6(ipv6-socket-address), - } - } - - interface instance-network { - use network.{network}; - instance-network: func() -> network; - } - - interface udp { - use wasi:io/poll@0.2.0.{pollable}; - use network.{network}; - use network.{error-code}; - use network.{ip-socket-address}; - use network.{ip-address-family}; - record incoming-datagram { - data: list, - remote-address: ip-socket-address, - } - record outgoing-datagram { - data: list, - remote-address: option, - } - resource udp-socket { - address-family: func() -> ip-address-family; - finish-bind: func() -> result<_, error-code>; - local-address: func() -> result; - receive-buffer-size: func() -> result; - remote-address: func() -> result; - send-buffer-size: func() -> result; - set-receive-buffer-size: func(value: u64) -> result<_, error-code>; - set-send-buffer-size: func(value: u64) -> result<_, error-code>; - set-unicast-hop-limit: func(value: u8) -> result<_, error-code>; - start-bind: func(network: borrow, local-address: ip-socket-address) -> result<_, error-code>; - %stream: func(remote-address: option) -> result, error-code>; - subscribe: func() -> pollable; - unicast-hop-limit: func() -> result; - } - resource incoming-datagram-stream { - receive: func(max-results: u64) -> result, error-code>; - subscribe: func() -> pollable; - } - resource outgoing-datagram-stream { - check-send: func() -> result; - send: func(datagrams: list) -> result; - subscribe: func() -> pollable; - } - } - - interface udp-create-socket { - use network.{network}; - use network.{error-code}; - use network.{ip-address-family}; - use udp.{udp-socket}; - create-udp-socket: func(address-family: ip-address-family) -> result; - } - - interface tcp { - use wasi:io/streams@0.2.0.{input-stream}; - use wasi:io/streams@0.2.0.{output-stream}; - use wasi:io/poll@0.2.0.{pollable}; - use wasi:clocks/monotonic-clock@0.2.0.{duration}; - use network.{network}; - use network.{error-code}; - use network.{ip-socket-address}; - use network.{ip-address-family}; - enum shutdown-type { receive, send, both } - resource tcp-socket { - accept: func() -> result, error-code>; - address-family: func() -> ip-address-family; - finish-bind: func() -> result<_, error-code>; - finish-connect: func() -> result, error-code>; - finish-listen: func() -> result<_, error-code>; - hop-limit: func() -> result; - is-listening: func() -> bool; - keep-alive-count: func() -> result; - keep-alive-enabled: func() -> result; - keep-alive-idle-time: func() -> result; - keep-alive-interval: func() -> result; - local-address: func() -> result; - receive-buffer-size: func() -> result; - remote-address: func() -> result; - send-buffer-size: func() -> result; - set-hop-limit: func(value: u8) -> result<_, error-code>; - set-keep-alive-count: func(value: u32) -> result<_, error-code>; - set-keep-alive-enabled: func(value: bool) -> result<_, error-code>; - set-keep-alive-idle-time: func(value: duration) -> result<_, error-code>; - set-keep-alive-interval: func(value: duration) -> result<_, error-code>; - set-listen-backlog-size: func(value: u64) -> result<_, error-code>; - set-receive-buffer-size: func(value: u64) -> result<_, error-code>; - set-send-buffer-size: func(value: u64) -> result<_, error-code>; - shutdown: func(shutdown-type: shutdown-type) -> result<_, error-code>; - start-bind: func(network: borrow, local-address: ip-socket-address) -> result<_, error-code>; - start-connect: func(network: borrow, remote-address: ip-socket-address) -> result<_, error-code>; - start-listen: func() -> result<_, error-code>; - subscribe: func() -> pollable; - } - } - - interface tcp-create-socket { - use network.{network}; - use network.{error-code}; - use network.{ip-address-family}; - use tcp.{tcp-socket}; - create-tcp-socket: func(address-family: ip-address-family) -> result; - } - - interface ip-name-lookup { - use wasi:io/poll@0.2.0.{pollable}; - use network.{network}; - use network.{error-code}; - use network.{ip-address}; - resource resolve-address-stream { - resolve-next-address: func() -> result, error-code>; - subscribe: func() -> pollable; - } - resolve-addresses: func(network: borrow, name: string) -> result; - } -} - -package wasi:clocks@0.2.0 { - interface monotonic-clock { - use wasi:io/poll@0.2.0.{pollable}; - type instant = u64; - type duration = u64; - now: func() -> instant; - resolution: func() -> duration; - subscribe-instant: func(when: instant) -> pollable; - subscribe-duration: func(when: duration) -> pollable; - } - - interface wall-clock { - record datetime { - seconds: u64, - nanoseconds: u32, - } - now: func() -> datetime; - resolution: func() -> datetime; - } -} - -package wasi:io@0.2.0 { - interface poll { - resource pollable { - block: func(); - ready: func() -> bool; - } - poll: func(in: list>) -> list; - } - - interface error { - resource error { - to-debug-string: func() -> string; - } - } - - interface streams { - use error.{error}; - use poll.{pollable}; - variant stream-error { - last-operation-failed(error), - closed, - } - resource input-stream { - blocking-read: func(len: u64) -> result, stream-error>; - blocking-skip: func(len: u64) -> result; - read: func(len: u64) -> result, stream-error>; - skip: func(len: u64) -> result; - subscribe: func() -> pollable; - } - resource output-stream { - blocking-flush: func() -> result<_, stream-error>; - blocking-splice: func(src: borrow, len: u64) -> result; - blocking-write-and-flush: func(contents: list) -> result<_, stream-error>; - blocking-write-zeroes-and-flush: func(len: u64) -> result<_, stream-error>; - check-write: func() -> result; - flush: func() -> result<_, stream-error>; - splice: func(src: borrow, len: u64) -> result; - subscribe: func() -> pollable; - write: func(contents: list) -> result<_, stream-error>; - write-zeroes: func(len: u64) -> result<_, stream-error>; - } - } -} - -package wasmcloud:bus@1.0.0 { - interface lattice { - resource call-target-interface { - constructor(namespace: string, %package: string, %interface: string); - } - set-link-name: func(name: string, interfaces: list); - } -} - -package wasmcloud:secrets@0.1.0-draft { - interface store { - variant secrets-error { - upstream(string), - io(string), - not-found, - } - variant secret-value { - %string(string), - bytes(list), - } - resource secret; - get: func(key: string) -> result; - } - - interface reveal { - use store.{secret}; - use store.{secret-value}; - reveal: func(s: borrow) -> secret-value; - } -} diff --git a/examples/component/invoke/gen/example/invoker/example/example.wit.go b/examples/component/invoke/gen/example/invoker/example/example.wit.go deleted file mode 100644 index 292720f1..00000000 --- a/examples/component/invoke/gen/example/invoker/example/example.wit.go +++ /dev/null @@ -1,4 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package example represents the world "example:invoker/example". -package example diff --git a/examples/component/invoke/gen/example/invoker/invoker/empty.s b/examples/component/invoke/gen/example/invoker/invoker/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/example/invoker/invoker/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/example/invoker/invoker/invoker.exports.go b/examples/component/invoke/gen/example/invoker/invoker/invoker.exports.go deleted file mode 100644 index a7000266..00000000 --- a/examples/component/invoke/gen/example/invoker/invoker/invoker.exports.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package invoker - -// Exports represents the caller-defined exports from "example:invoker/invoker". -var Exports struct { - // Call represents the caller-defined, exported function "call". - // - // call: func() -> string - Call func() (result string) -} diff --git a/examples/component/invoke/gen/example/invoker/invoker/invoker.wasm.go b/examples/component/invoke/gen/example/invoker/invoker/invoker.wasm.go deleted file mode 100755 index ada6c4c9..00000000 --- a/examples/component/invoke/gen/example/invoker/invoker/invoker.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package invoker - -// This file contains wasmimport and wasmexport declarations for "example:invoker". - -//go:wasmexport example:invoker/invoker#call -//export example:invoker/invoker#call -func wasmexport_Call() (result *string) { - result_ := Exports.Call() - result = &result_ - return -} diff --git a/examples/component/invoke/gen/example/invoker/invoker/invoker.wit.go b/examples/component/invoke/gen/example/invoker/invoker/invoker.wit.go deleted file mode 100644 index 304d5ed7..00000000 --- a/examples/component/invoke/gen/example/invoker/invoker/invoker.wit.go +++ /dev/null @@ -1,4 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package invoker represents the exported interface "example:invoker/invoker". -package invoker diff --git a/examples/component/invoke/gen/wasi/cli/environment/empty.s b/examples/component/invoke/gen/wasi/cli/environment/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/cli/environment/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/cli/environment/environment.wasm.go b/examples/component/invoke/gen/wasi/cli/environment/environment.wasm.go deleted file mode 100755 index 89bb596b..00000000 --- a/examples/component/invoke/gen/wasi/cli/environment/environment.wasm.go +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package environment - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/environment@0.2.0 get-environment -//go:noescape -func wasmimport_GetEnvironment(result *cm.List[[2]string]) - -//go:wasmimport wasi:cli/environment@0.2.0 get-arguments -//go:noescape -func wasmimport_GetArguments(result *cm.List[string]) - -//go:wasmimport wasi:cli/environment@0.2.0 initial-cwd -//go:noescape -func wasmimport_InitialCWD(result *cm.Option[string]) diff --git a/examples/component/invoke/gen/wasi/cli/environment/environment.wit.go b/examples/component/invoke/gen/wasi/cli/environment/environment.wit.go deleted file mode 100644 index 068bed33..00000000 --- a/examples/component/invoke/gen/wasi/cli/environment/environment.wit.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package environment represents the imported interface "wasi:cli/environment@0.2.0". -package environment - -import ( - "go.bytecodealliance.org/cm" -) - -// GetEnvironment represents the imported function "get-environment". -// -// get-environment: func() -> list> -// -//go:nosplit -func GetEnvironment() (result cm.List[[2]string]) { - wasmimport_GetEnvironment(&result) - return -} - -// GetArguments represents the imported function "get-arguments". -// -// get-arguments: func() -> list -// -//go:nosplit -func GetArguments() (result cm.List[string]) { - wasmimport_GetArguments(&result) - return -} - -// InitialCWD represents the imported function "initial-cwd". -// -// initial-cwd: func() -> option -// -//go:nosplit -func InitialCWD() (result cm.Option[string]) { - wasmimport_InitialCWD(&result) - return -} diff --git a/examples/component/invoke/gen/wasi/cli/exit/empty.s b/examples/component/invoke/gen/wasi/cli/exit/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/cli/exit/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/cli/exit/exit.wasm.go b/examples/component/invoke/gen/wasi/cli/exit/exit.wasm.go deleted file mode 100755 index 849d5f50..00000000 --- a/examples/component/invoke/gen/wasi/cli/exit/exit.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package exit - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/exit@0.2.0 exit -//go:noescape -func wasmimport_Exit(status0 uint32) diff --git a/examples/component/invoke/gen/wasi/cli/exit/exit.wit.go b/examples/component/invoke/gen/wasi/cli/exit/exit.wit.go deleted file mode 100644 index 7a347b60..00000000 --- a/examples/component/invoke/gen/wasi/cli/exit/exit.wit.go +++ /dev/null @@ -1,19 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package exit represents the imported interface "wasi:cli/exit@0.2.0". -package exit - -import ( - "go.bytecodealliance.org/cm" -) - -// Exit represents the imported function "exit". -// -// exit: func(status: result) -// -//go:nosplit -func Exit(status cm.BoolResult) { - status0 := (uint32)(cm.BoolToU32(status)) - wasmimport_Exit((uint32)(status0)) - return -} diff --git a/examples/component/invoke/gen/wasi/cli/stderr/empty.s b/examples/component/invoke/gen/wasi/cli/stderr/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/cli/stderr/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/cli/stderr/stderr.wasm.go b/examples/component/invoke/gen/wasi/cli/stderr/stderr.wasm.go deleted file mode 100755 index 462cf172..00000000 --- a/examples/component/invoke/gen/wasi/cli/stderr/stderr.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package stderr - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/stderr@0.2.0 get-stderr -//go:noescape -func wasmimport_GetStderr() (result0 uint32) diff --git a/examples/component/invoke/gen/wasi/cli/stderr/stderr.wit.go b/examples/component/invoke/gen/wasi/cli/stderr/stderr.wit.go deleted file mode 100644 index 521ede56..00000000 --- a/examples/component/invoke/gen/wasi/cli/stderr/stderr.wit.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package stderr represents the imported interface "wasi:cli/stderr@0.2.0". -package stderr - -import ( - "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/io/streams" - "go.bytecodealliance.org/cm" -) - -// OutputStream represents the imported type alias "wasi:cli/stderr@0.2.0#output-stream". -// -// See [streams.OutputStream] for more information. -type OutputStream = streams.OutputStream - -// GetStderr represents the imported function "get-stderr". -// -// get-stderr: func() -> output-stream -// -//go:nosplit -func GetStderr() (result OutputStream) { - result0 := wasmimport_GetStderr() - result = cm.Reinterpret[OutputStream]((uint32)(result0)) - return -} diff --git a/examples/component/invoke/gen/wasi/cli/stdin/empty.s b/examples/component/invoke/gen/wasi/cli/stdin/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/cli/stdin/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/cli/stdin/stdin.wasm.go b/examples/component/invoke/gen/wasi/cli/stdin/stdin.wasm.go deleted file mode 100755 index 374eb253..00000000 --- a/examples/component/invoke/gen/wasi/cli/stdin/stdin.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package stdin - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/stdin@0.2.0 get-stdin -//go:noescape -func wasmimport_GetStdin() (result0 uint32) diff --git a/examples/component/invoke/gen/wasi/cli/stdin/stdin.wit.go b/examples/component/invoke/gen/wasi/cli/stdin/stdin.wit.go deleted file mode 100644 index 5879e407..00000000 --- a/examples/component/invoke/gen/wasi/cli/stdin/stdin.wit.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package stdin represents the imported interface "wasi:cli/stdin@0.2.0". -package stdin - -import ( - "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/io/streams" - "go.bytecodealliance.org/cm" -) - -// InputStream represents the imported type alias "wasi:cli/stdin@0.2.0#input-stream". -// -// See [streams.InputStream] for more information. -type InputStream = streams.InputStream - -// GetStdin represents the imported function "get-stdin". -// -// get-stdin: func() -> input-stream -// -//go:nosplit -func GetStdin() (result InputStream) { - result0 := wasmimport_GetStdin() - result = cm.Reinterpret[InputStream]((uint32)(result0)) - return -} diff --git a/examples/component/invoke/gen/wasi/cli/stdout/empty.s b/examples/component/invoke/gen/wasi/cli/stdout/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/cli/stdout/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/cli/stdout/stdout.wasm.go b/examples/component/invoke/gen/wasi/cli/stdout/stdout.wasm.go deleted file mode 100755 index 68e4a3da..00000000 --- a/examples/component/invoke/gen/wasi/cli/stdout/stdout.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package stdout - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/stdout@0.2.0 get-stdout -//go:noescape -func wasmimport_GetStdout() (result0 uint32) diff --git a/examples/component/invoke/gen/wasi/cli/stdout/stdout.wit.go b/examples/component/invoke/gen/wasi/cli/stdout/stdout.wit.go deleted file mode 100644 index 3cb97304..00000000 --- a/examples/component/invoke/gen/wasi/cli/stdout/stdout.wit.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package stdout represents the imported interface "wasi:cli/stdout@0.2.0". -package stdout - -import ( - "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/io/streams" - "go.bytecodealliance.org/cm" -) - -// OutputStream represents the imported type alias "wasi:cli/stdout@0.2.0#output-stream". -// -// See [streams.OutputStream] for more information. -type OutputStream = streams.OutputStream - -// GetStdout represents the imported function "get-stdout". -// -// get-stdout: func() -> output-stream -// -//go:nosplit -func GetStdout() (result OutputStream) { - result0 := wasmimport_GetStdout() - result = cm.Reinterpret[OutputStream]((uint32)(result0)) - return -} diff --git a/examples/component/invoke/gen/wasi/cli/terminal-input/empty.s b/examples/component/invoke/gen/wasi/cli/terminal-input/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/cli/terminal-input/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/cli/terminal-input/terminal-input.wit.go b/examples/component/invoke/gen/wasi/cli/terminal-input/terminal-input.wit.go deleted file mode 100644 index 18b9a9d7..00000000 --- a/examples/component/invoke/gen/wasi/cli/terminal-input/terminal-input.wit.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package terminalinput represents the imported interface "wasi:cli/terminal-input@0.2.0". -package terminalinput - -import ( - "go.bytecodealliance.org/cm" -) - -// TerminalInput represents the imported resource "wasi:cli/terminal-input@0.2.0#terminal-input". -// -// resource terminal-input -type TerminalInput cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "terminal-input". -// -// Drops a resource handle. -// -//go:nosplit -func (self TerminalInput) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TerminalInputResourceDrop((uint32)(self0)) - return -} diff --git a/examples/component/invoke/gen/wasi/cli/terminal-input/terminalinput.wasm.go b/examples/component/invoke/gen/wasi/cli/terminal-input/terminalinput.wasm.go deleted file mode 100755 index 1df3794f..00000000 --- a/examples/component/invoke/gen/wasi/cli/terminal-input/terminalinput.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package terminalinput - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/terminal-input@0.2.0 [resource-drop]terminal-input -//go:noescape -func wasmimport_TerminalInputResourceDrop(self0 uint32) diff --git a/examples/component/invoke/gen/wasi/cli/terminal-output/empty.s b/examples/component/invoke/gen/wasi/cli/terminal-output/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/cli/terminal-output/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/cli/terminal-output/terminal-output.wit.go b/examples/component/invoke/gen/wasi/cli/terminal-output/terminal-output.wit.go deleted file mode 100644 index 823aaf52..00000000 --- a/examples/component/invoke/gen/wasi/cli/terminal-output/terminal-output.wit.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package terminaloutput represents the imported interface "wasi:cli/terminal-output@0.2.0". -package terminaloutput - -import ( - "go.bytecodealliance.org/cm" -) - -// TerminalOutput represents the imported resource "wasi:cli/terminal-output@0.2.0#terminal-output". -// -// resource terminal-output -type TerminalOutput cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "terminal-output". -// -// Drops a resource handle. -// -//go:nosplit -func (self TerminalOutput) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TerminalOutputResourceDrop((uint32)(self0)) - return -} diff --git a/examples/component/invoke/gen/wasi/cli/terminal-output/terminaloutput.wasm.go b/examples/component/invoke/gen/wasi/cli/terminal-output/terminaloutput.wasm.go deleted file mode 100755 index fb35fc41..00000000 --- a/examples/component/invoke/gen/wasi/cli/terminal-output/terminaloutput.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package terminaloutput - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/terminal-output@0.2.0 [resource-drop]terminal-output -//go:noescape -func wasmimport_TerminalOutputResourceDrop(self0 uint32) diff --git a/examples/component/invoke/gen/wasi/cli/terminal-stderr/empty.s b/examples/component/invoke/gen/wasi/cli/terminal-stderr/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/cli/terminal-stderr/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go b/examples/component/invoke/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go deleted file mode 100644 index d5eabbf9..00000000 --- a/examples/component/invoke/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package terminalstderr represents the imported interface "wasi:cli/terminal-stderr@0.2.0". -package terminalstderr - -import ( - terminaloutput "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/cli/terminal-output" - "go.bytecodealliance.org/cm" -) - -// TerminalOutput represents the imported type alias "wasi:cli/terminal-stderr@0.2.0#terminal-output". -// -// See [terminaloutput.TerminalOutput] for more information. -type TerminalOutput = terminaloutput.TerminalOutput - -// GetTerminalStderr represents the imported function "get-terminal-stderr". -// -// get-terminal-stderr: func() -> option -// -//go:nosplit -func GetTerminalStderr() (result cm.Option[TerminalOutput]) { - wasmimport_GetTerminalStderr(&result) - return -} diff --git a/examples/component/invoke/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go b/examples/component/invoke/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go deleted file mode 100755 index be9af72f..00000000 --- a/examples/component/invoke/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package terminalstderr - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/terminal-stderr@0.2.0 get-terminal-stderr -//go:noescape -func wasmimport_GetTerminalStderr(result *cm.Option[TerminalOutput]) diff --git a/examples/component/invoke/gen/wasi/cli/terminal-stdin/empty.s b/examples/component/invoke/gen/wasi/cli/terminal-stdin/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/cli/terminal-stdin/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go b/examples/component/invoke/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go deleted file mode 100644 index 258b405a..00000000 --- a/examples/component/invoke/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package terminalstdin represents the imported interface "wasi:cli/terminal-stdin@0.2.0". -package terminalstdin - -import ( - terminalinput "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/cli/terminal-input" - "go.bytecodealliance.org/cm" -) - -// TerminalInput represents the imported type alias "wasi:cli/terminal-stdin@0.2.0#terminal-input". -// -// See [terminalinput.TerminalInput] for more information. -type TerminalInput = terminalinput.TerminalInput - -// GetTerminalStdin represents the imported function "get-terminal-stdin". -// -// get-terminal-stdin: func() -> option -// -//go:nosplit -func GetTerminalStdin() (result cm.Option[TerminalInput]) { - wasmimport_GetTerminalStdin(&result) - return -} diff --git a/examples/component/invoke/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go b/examples/component/invoke/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go deleted file mode 100755 index e3b3ac61..00000000 --- a/examples/component/invoke/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package terminalstdin - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/terminal-stdin@0.2.0 get-terminal-stdin -//go:noescape -func wasmimport_GetTerminalStdin(result *cm.Option[TerminalInput]) diff --git a/examples/component/invoke/gen/wasi/cli/terminal-stdout/empty.s b/examples/component/invoke/gen/wasi/cli/terminal-stdout/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/cli/terminal-stdout/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go b/examples/component/invoke/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go deleted file mode 100644 index a5d9d223..00000000 --- a/examples/component/invoke/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package terminalstdout represents the imported interface "wasi:cli/terminal-stdout@0.2.0". -package terminalstdout - -import ( - terminaloutput "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/cli/terminal-output" - "go.bytecodealliance.org/cm" -) - -// TerminalOutput represents the imported type alias "wasi:cli/terminal-stdout@0.2.0#terminal-output". -// -// See [terminaloutput.TerminalOutput] for more information. -type TerminalOutput = terminaloutput.TerminalOutput - -// GetTerminalStdout represents the imported function "get-terminal-stdout". -// -// get-terminal-stdout: func() -> option -// -//go:nosplit -func GetTerminalStdout() (result cm.Option[TerminalOutput]) { - wasmimport_GetTerminalStdout(&result) - return -} diff --git a/examples/component/invoke/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go b/examples/component/invoke/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go deleted file mode 100755 index fa750ad9..00000000 --- a/examples/component/invoke/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package terminalstdout - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/terminal-stdout@0.2.0 get-terminal-stdout -//go:noescape -func wasmimport_GetTerminalStdout(result *cm.Option[TerminalOutput]) diff --git a/examples/component/invoke/gen/wasi/clocks/monotonic-clock/empty.s b/examples/component/invoke/gen/wasi/clocks/monotonic-clock/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/clocks/monotonic-clock/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go b/examples/component/invoke/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go deleted file mode 100644 index 12670de0..00000000 --- a/examples/component/invoke/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package monotonicclock represents the imported interface "wasi:clocks/monotonic-clock@0.2.0". -package monotonicclock - -import ( - "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/io/poll" - "go.bytecodealliance.org/cm" -) - -// Pollable represents the imported type alias "wasi:clocks/monotonic-clock@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// Instant represents the u64 "wasi:clocks/monotonic-clock@0.2.0#instant". -// -// type instant = u64 -type Instant uint64 - -// Duration represents the u64 "wasi:clocks/monotonic-clock@0.2.0#duration". -// -// type duration = u64 -type Duration uint64 - -// Now represents the imported function "now". -// -// now: func() -> instant -// -//go:nosplit -func Now() (result Instant) { - result0 := wasmimport_Now() - result = (Instant)((uint64)(result0)) - return -} - -// Resolution represents the imported function "resolution". -// -// resolution: func() -> duration -// -//go:nosplit -func Resolution() (result Duration) { - result0 := wasmimport_Resolution() - result = (Duration)((uint64)(result0)) - return -} - -// SubscribeInstant represents the imported function "subscribe-instant". -// -// subscribe-instant: func(when: instant) -> pollable -// -//go:nosplit -func SubscribeInstant(when Instant) (result Pollable) { - when0 := (uint64)(when) - result0 := wasmimport_SubscribeInstant((uint64)(when0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) - return -} - -// SubscribeDuration represents the imported function "subscribe-duration". -// -// subscribe-duration: func(when: duration) -> pollable -// -//go:nosplit -func SubscribeDuration(when Duration) (result Pollable) { - when0 := (uint64)(when) - result0 := wasmimport_SubscribeDuration((uint64)(when0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) - return -} diff --git a/examples/component/invoke/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go b/examples/component/invoke/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go deleted file mode 100755 index 36a1720a..00000000 --- a/examples/component/invoke/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package monotonicclock - -// This file contains wasmimport and wasmexport declarations for "wasi:clocks@0.2.0". - -//go:wasmimport wasi:clocks/monotonic-clock@0.2.0 now -//go:noescape -func wasmimport_Now() (result0 uint64) - -//go:wasmimport wasi:clocks/monotonic-clock@0.2.0 resolution -//go:noescape -func wasmimport_Resolution() (result0 uint64) - -//go:wasmimport wasi:clocks/monotonic-clock@0.2.0 subscribe-instant -//go:noescape -func wasmimport_SubscribeInstant(when0 uint64) (result0 uint32) - -//go:wasmimport wasi:clocks/monotonic-clock@0.2.0 subscribe-duration -//go:noescape -func wasmimport_SubscribeDuration(when0 uint64) (result0 uint32) diff --git a/examples/component/invoke/gen/wasi/clocks/wall-clock/empty.s b/examples/component/invoke/gen/wasi/clocks/wall-clock/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/clocks/wall-clock/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/clocks/wall-clock/wall-clock.wit.go b/examples/component/invoke/gen/wasi/clocks/wall-clock/wall-clock.wit.go deleted file mode 100644 index e3f35395..00000000 --- a/examples/component/invoke/gen/wasi/clocks/wall-clock/wall-clock.wit.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package wallclock represents the imported interface "wasi:clocks/wall-clock@0.2.0". -package wallclock - -import ( - "go.bytecodealliance.org/cm" -) - -// DateTime represents the record "wasi:clocks/wall-clock@0.2.0#datetime". -// -// record datetime { -// seconds: u64, -// nanoseconds: u32, -// } -type DateTime struct { - _ cm.HostLayout - Seconds uint64 - Nanoseconds uint32 -} - -// Now represents the imported function "now". -// -// now: func() -> datetime -// -//go:nosplit -func Now() (result DateTime) { - wasmimport_Now(&result) - return -} - -// Resolution represents the imported function "resolution". -// -// resolution: func() -> datetime -// -//go:nosplit -func Resolution() (result DateTime) { - wasmimport_Resolution(&result) - return -} diff --git a/examples/component/invoke/gen/wasi/clocks/wall-clock/wallclock.wasm.go b/examples/component/invoke/gen/wasi/clocks/wall-clock/wallclock.wasm.go deleted file mode 100755 index 321ff3f1..00000000 --- a/examples/component/invoke/gen/wasi/clocks/wall-clock/wallclock.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package wallclock - -// This file contains wasmimport and wasmexport declarations for "wasi:clocks@0.2.0". - -//go:wasmimport wasi:clocks/wall-clock@0.2.0 now -//go:noescape -func wasmimport_Now(result *DateTime) - -//go:wasmimport wasi:clocks/wall-clock@0.2.0 resolution -//go:noescape -func wasmimport_Resolution(result *DateTime) diff --git a/examples/component/invoke/gen/wasi/config/runtime/abi.go b/examples/component/invoke/gen/wasi/config/runtime/abi.go deleted file mode 100644 index 61412cbe..00000000 --- a/examples/component/invoke/gen/wasi/config/runtime/abi.go +++ /dev/null @@ -1,20 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package runtime - -import ( - "go.bytecodealliance.org/cm" - "unsafe" -) - -// OptionStringShape is used for storage in variant or result types. -type OptionStringShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Option[string]{})]byte -} - -// ConfigErrorShape is used for storage in variant or result types. -type ConfigErrorShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(ConfigError{})]byte -} diff --git a/examples/component/invoke/gen/wasi/config/runtime/empty.s b/examples/component/invoke/gen/wasi/config/runtime/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/config/runtime/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/config/runtime/runtime.wasm.go b/examples/component/invoke/gen/wasi/config/runtime/runtime.wasm.go deleted file mode 100755 index 8ce17d5e..00000000 --- a/examples/component/invoke/gen/wasi/config/runtime/runtime.wasm.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package runtime - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:config@0.2.0-draft". - -//go:wasmimport wasi:config/runtime@0.2.0-draft get -//go:noescape -func wasmimport_Get(key0 *uint8, key1 uint32, result *cm.Result[OptionStringShape, cm.Option[string], ConfigError]) - -//go:wasmimport wasi:config/runtime@0.2.0-draft get-all -//go:noescape -func wasmimport_GetAll(result *cm.Result[ConfigErrorShape, cm.List[[2]string], ConfigError]) diff --git a/examples/component/invoke/gen/wasi/config/runtime/runtime.wit.go b/examples/component/invoke/gen/wasi/config/runtime/runtime.wit.go deleted file mode 100644 index 99a739d1..00000000 --- a/examples/component/invoke/gen/wasi/config/runtime/runtime.wit.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package runtime represents the imported interface "wasi:config/runtime@0.2.0-draft". -package runtime - -import ( - "go.bytecodealliance.org/cm" -) - -// ConfigError represents the variant "wasi:config/runtime@0.2.0-draft#config-error". -// -// variant config-error { -// upstream(string), -// io(string), -// } -type ConfigError cm.Variant[uint8, string, string] - -// ConfigErrorUpstream returns a [ConfigError] of case "upstream". -func ConfigErrorUpstream(data string) ConfigError { - return cm.New[ConfigError](0, data) -} - -// Upstream returns a non-nil *[string] if [ConfigError] represents the variant case "upstream". -func (self *ConfigError) Upstream() *string { - return cm.Case[string](self, 0) -} - -// ConfigErrorIO returns a [ConfigError] of case "io". -func ConfigErrorIO(data string) ConfigError { - return cm.New[ConfigError](1, data) -} - -// IO returns a non-nil *[string] if [ConfigError] represents the variant case "io". -func (self *ConfigError) IO() *string { - return cm.Case[string](self, 1) -} - -var stringsConfigError = [2]string{ - "upstream", - "io", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v ConfigError) String() string { - return stringsConfigError[v.Tag()] -} - -// Get represents the imported function "get". -// -// get: func(key: string) -> result, config-error> -// -//go:nosplit -func Get(key string) (result cm.Result[OptionStringShape, cm.Option[string], ConfigError]) { - key0, key1 := cm.LowerString(key) - wasmimport_Get((*uint8)(key0), (uint32)(key1), &result) - return -} - -// GetAll represents the imported function "get-all". -// -// get-all: func() -> result>, config-error> -// -//go:nosplit -func GetAll() (result cm.Result[ConfigErrorShape, cm.List[[2]string], ConfigError]) { - wasmimport_GetAll(&result) - return -} diff --git a/examples/component/invoke/gen/wasi/filesystem/preopens/empty.s b/examples/component/invoke/gen/wasi/filesystem/preopens/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/filesystem/preopens/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/filesystem/preopens/preopens.wasm.go b/examples/component/invoke/gen/wasi/filesystem/preopens/preopens.wasm.go deleted file mode 100755 index 1bcd416a..00000000 --- a/examples/component/invoke/gen/wasi/filesystem/preopens/preopens.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package preopens - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:filesystem@0.2.0". - -//go:wasmimport wasi:filesystem/preopens@0.2.0 get-directories -//go:noescape -func wasmimport_GetDirectories(result *cm.List[cm.Tuple[Descriptor, string]]) diff --git a/examples/component/invoke/gen/wasi/filesystem/preopens/preopens.wit.go b/examples/component/invoke/gen/wasi/filesystem/preopens/preopens.wit.go deleted file mode 100644 index d21bde16..00000000 --- a/examples/component/invoke/gen/wasi/filesystem/preopens/preopens.wit.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package preopens represents the imported interface "wasi:filesystem/preopens@0.2.0". -package preopens - -import ( - "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/filesystem/types" - "go.bytecodealliance.org/cm" -) - -// Descriptor represents the imported type alias "wasi:filesystem/preopens@0.2.0#descriptor". -// -// See [types.Descriptor] for more information. -type Descriptor = types.Descriptor - -// GetDirectories represents the imported function "get-directories". -// -// get-directories: func() -> list> -// -//go:nosplit -func GetDirectories() (result cm.List[cm.Tuple[Descriptor, string]]) { - wasmimport_GetDirectories(&result) - return -} diff --git a/examples/component/invoke/gen/wasi/filesystem/types/abi.go b/examples/component/invoke/gen/wasi/filesystem/types/abi.go deleted file mode 100644 index f7d57cde..00000000 --- a/examples/component/invoke/gen/wasi/filesystem/types/abi.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package types - -import ( - wallclock "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/clocks/wall-clock" - "go.bytecodealliance.org/cm" - "unsafe" -) - -// MetadataHashValueShape is used for storage in variant or result types. -type MetadataHashValueShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(MetadataHashValue{})]byte -} - -// TupleListU8BoolShape is used for storage in variant or result types. -type TupleListU8BoolShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Tuple[cm.List[uint8], bool]{})]byte -} - -func lower_DateTime(v wallclock.DateTime) (f0 uint64, f1 uint32) { - f0 = (uint64)(v.Seconds) - f1 = (uint32)(v.Nanoseconds) - return -} - -func lower_NewTimestamp(v NewTimestamp) (f0 uint32, f1 uint64, f2 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 2: // timestamp - v1, v2 := lower_DateTime(*cm.Case[DateTime](&v, 2)) - f1 = (uint64)(v1) - f2 = (uint32)(v2) - } - return -} - -// DescriptorStatShape is used for storage in variant or result types. -type DescriptorStatShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(DescriptorStat{})]byte -} - -// OptionDirectoryEntryShape is used for storage in variant or result types. -type OptionDirectoryEntryShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Option[DirectoryEntry]{})]byte -} diff --git a/examples/component/invoke/gen/wasi/filesystem/types/empty.s b/examples/component/invoke/gen/wasi/filesystem/types/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/filesystem/types/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/filesystem/types/types.wasm.go b/examples/component/invoke/gen/wasi/filesystem/types/types.wasm.go deleted file mode 100755 index b97dad84..00000000 --- a/examples/component/invoke/gen/wasi/filesystem/types/types.wasm.go +++ /dev/null @@ -1,133 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package types - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:filesystem@0.2.0". - -//go:wasmimport wasi:filesystem/types@0.2.0 [resource-drop]descriptor -//go:noescape -func wasmimport_DescriptorResourceDrop(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.advise -//go:noescape -func wasmimport_DescriptorAdvise(self0 uint32, offset0 uint64, length0 uint64, advice0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.append-via-stream -//go:noescape -func wasmimport_DescriptorAppendViaStream(self0 uint32, result *cm.Result[OutputStream, OutputStream, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.create-directory-at -//go:noescape -func wasmimport_DescriptorCreateDirectoryAt(self0 uint32, path0 *uint8, path1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.get-flags -//go:noescape -func wasmimport_DescriptorGetFlags(self0 uint32, result *cm.Result[DescriptorFlags, DescriptorFlags, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.get-type -//go:noescape -func wasmimport_DescriptorGetType(self0 uint32, result *cm.Result[DescriptorType, DescriptorType, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.is-same-object -//go:noescape -func wasmimport_DescriptorIsSameObject(self0 uint32, other0 uint32) (result0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.link-at -//go:noescape -func wasmimport_DescriptorLinkAt(self0 uint32, oldPathFlags0 uint32, oldPath0 *uint8, oldPath1 uint32, newDescriptor0 uint32, newPath0 *uint8, newPath1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.metadata-hash -//go:noescape -func wasmimport_DescriptorMetadataHash(self0 uint32, result *cm.Result[MetadataHashValueShape, MetadataHashValue, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.metadata-hash-at -//go:noescape -func wasmimport_DescriptorMetadataHashAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, result *cm.Result[MetadataHashValueShape, MetadataHashValue, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.open-at -//go:noescape -func wasmimport_DescriptorOpenAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, openFlags0 uint32, flags0 uint32, result *cm.Result[Descriptor, Descriptor, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.read -//go:noescape -func wasmimport_DescriptorRead(self0 uint32, length0 uint64, offset0 uint64, result *cm.Result[TupleListU8BoolShape, cm.Tuple[cm.List[uint8], bool], ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.read-directory -//go:noescape -func wasmimport_DescriptorReadDirectory(self0 uint32, result *cm.Result[DirectoryEntryStream, DirectoryEntryStream, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.read-via-stream -//go:noescape -func wasmimport_DescriptorReadViaStream(self0 uint32, offset0 uint64, result *cm.Result[InputStream, InputStream, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.readlink-at -//go:noescape -func wasmimport_DescriptorReadLinkAt(self0 uint32, path0 *uint8, path1 uint32, result *cm.Result[string, string, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.remove-directory-at -//go:noescape -func wasmimport_DescriptorRemoveDirectoryAt(self0 uint32, path0 *uint8, path1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.rename-at -//go:noescape -func wasmimport_DescriptorRenameAt(self0 uint32, oldPath0 *uint8, oldPath1 uint32, newDescriptor0 uint32, newPath0 *uint8, newPath1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.set-size -//go:noescape -func wasmimport_DescriptorSetSize(self0 uint32, size0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.set-times -//go:noescape -func wasmimport_DescriptorSetTimes(self0 uint32, dataAccessTimestamp0 uint32, dataAccessTimestamp1 uint64, dataAccessTimestamp2 uint32, dataModificationTimestamp0 uint32, dataModificationTimestamp1 uint64, dataModificationTimestamp2 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.set-times-at -//go:noescape -func wasmimport_DescriptorSetTimesAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, dataAccessTimestamp0 uint32, dataAccessTimestamp1 uint64, dataAccessTimestamp2 uint32, dataModificationTimestamp0 uint32, dataModificationTimestamp1 uint64, dataModificationTimestamp2 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.stat -//go:noescape -func wasmimport_DescriptorStat(self0 uint32, result *cm.Result[DescriptorStatShape, DescriptorStat, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.stat-at -//go:noescape -func wasmimport_DescriptorStatAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, result *cm.Result[DescriptorStatShape, DescriptorStat, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.symlink-at -//go:noescape -func wasmimport_DescriptorSymlinkAt(self0 uint32, oldPath0 *uint8, oldPath1 uint32, newPath0 *uint8, newPath1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.sync -//go:noescape -func wasmimport_DescriptorSync(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.sync-data -//go:noescape -func wasmimport_DescriptorSyncData(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.unlink-file-at -//go:noescape -func wasmimport_DescriptorUnlinkFileAt(self0 uint32, path0 *uint8, path1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.write -//go:noescape -func wasmimport_DescriptorWrite(self0 uint32, buffer0 *uint8, buffer1 uint32, offset0 uint64, result *cm.Result[uint64, FileSize, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.write-via-stream -//go:noescape -func wasmimport_DescriptorWriteViaStream(self0 uint32, offset0 uint64, result *cm.Result[OutputStream, OutputStream, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [resource-drop]directory-entry-stream -//go:noescape -func wasmimport_DirectoryEntryStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]directory-entry-stream.read-directory-entry -//go:noescape -func wasmimport_DirectoryEntryStreamReadDirectoryEntry(self0 uint32, result *cm.Result[OptionDirectoryEntryShape, cm.Option[DirectoryEntry], ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 filesystem-error-code -//go:noescape -func wasmimport_FilesystemErrorCode(err0 uint32, result *cm.Option[ErrorCode]) diff --git a/examples/component/invoke/gen/wasi/filesystem/types/types.wit.go b/examples/component/invoke/gen/wasi/filesystem/types/types.wit.go deleted file mode 100644 index d095f471..00000000 --- a/examples/component/invoke/gen/wasi/filesystem/types/types.wit.go +++ /dev/null @@ -1,787 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package types represents the imported interface "wasi:filesystem/types@0.2.0". -package types - -import ( - wallclock "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/clocks/wall-clock" - "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/io/streams" - "go.bytecodealliance.org/cm" -) - -// InputStream represents the imported type alias "wasi:filesystem/types@0.2.0#input-stream". -// -// See [streams.InputStream] for more information. -type InputStream = streams.InputStream - -// OutputStream represents the imported type alias "wasi:filesystem/types@0.2.0#output-stream". -// -// See [streams.OutputStream] for more information. -type OutputStream = streams.OutputStream - -// Error represents the imported type alias "wasi:filesystem/types@0.2.0#error". -// -// See [streams.Error] for more information. -type Error = streams.Error - -// DateTime represents the type alias "wasi:filesystem/types@0.2.0#datetime". -// -// See [wallclock.DateTime] for more information. -type DateTime = wallclock.DateTime - -// FileSize represents the u64 "wasi:filesystem/types@0.2.0#filesize". -// -// type filesize = u64 -type FileSize uint64 - -// DescriptorType represents the enum "wasi:filesystem/types@0.2.0#descriptor-type". -// -// enum descriptor-type { -// unknown, -// block-device, -// character-device, -// directory, -// fifo, -// symbolic-link, -// regular-file, -// socket -// } -type DescriptorType uint8 - -const ( - DescriptorTypeUnknown DescriptorType = iota - DescriptorTypeBlockDevice - DescriptorTypeCharacterDevice - DescriptorTypeDirectory - DescriptorTypeFIFO - DescriptorTypeSymbolicLink - DescriptorTypeRegularFile - DescriptorTypeSocket -) - -var stringsDescriptorType = [8]string{ - "unknown", - "block-device", - "character-device", - "directory", - "fifo", - "symbolic-link", - "regular-file", - "socket", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e DescriptorType) String() string { - return stringsDescriptorType[e] -} - -// DescriptorFlags represents the flags "wasi:filesystem/types@0.2.0#descriptor-flags". -// -// flags descriptor-flags { -// read, -// write, -// file-integrity-sync, -// data-integrity-sync, -// requested-write-sync, -// mutate-directory, -// } -type DescriptorFlags uint8 - -const ( - DescriptorFlagsRead DescriptorFlags = 1 << iota - DescriptorFlagsWrite - DescriptorFlagsFileIntegritySync - DescriptorFlagsDataIntegritySync - DescriptorFlagsRequestedWriteSync - DescriptorFlagsMutateDirectory -) - -// PathFlags represents the flags "wasi:filesystem/types@0.2.0#path-flags". -// -// flags path-flags { -// symlink-follow, -// } -type PathFlags uint8 - -const ( - PathFlagsSymlinkFollow PathFlags = 1 << iota -) - -// OpenFlags represents the flags "wasi:filesystem/types@0.2.0#open-flags". -// -// flags open-flags { -// create, -// directory, -// exclusive, -// truncate, -// } -type OpenFlags uint8 - -const ( - OpenFlagsCreate OpenFlags = 1 << iota - OpenFlagsDirectory - OpenFlagsExclusive - OpenFlagsTruncate -) - -// LinkCount represents the u64 "wasi:filesystem/types@0.2.0#link-count". -// -// type link-count = u64 -type LinkCount uint64 - -// DescriptorStat represents the record "wasi:filesystem/types@0.2.0#descriptor-stat". -// -// record descriptor-stat { -// %type: descriptor-type, -// link-count: link-count, -// size: filesize, -// data-access-timestamp: option, -// data-modification-timestamp: option, -// status-change-timestamp: option, -// } -type DescriptorStat struct { - _ cm.HostLayout - Type DescriptorType - LinkCount LinkCount - Size FileSize - DataAccessTimestamp cm.Option[DateTime] - DataModificationTimestamp cm.Option[DateTime] - StatusChangeTimestamp cm.Option[DateTime] -} - -// NewTimestamp represents the variant "wasi:filesystem/types@0.2.0#new-timestamp". -// -// variant new-timestamp { -// no-change, -// now, -// timestamp(datetime), -// } -type NewTimestamp cm.Variant[uint8, DateTime, DateTime] - -// NewTimestampNoChange returns a [NewTimestamp] of case "no-change". -func NewTimestampNoChange() NewTimestamp { - var data struct{} - return cm.New[NewTimestamp](0, data) -} - -// NoChange returns true if [NewTimestamp] represents the variant case "no-change". -func (self *NewTimestamp) NoChange() bool { - return self.Tag() == 0 -} - -// NewTimestampNow returns a [NewTimestamp] of case "now". -func NewTimestampNow() NewTimestamp { - var data struct{} - return cm.New[NewTimestamp](1, data) -} - -// Now returns true if [NewTimestamp] represents the variant case "now". -func (self *NewTimestamp) Now() bool { - return self.Tag() == 1 -} - -// NewTimestampTimestamp returns a [NewTimestamp] of case "timestamp". -func NewTimestampTimestamp(data DateTime) NewTimestamp { - return cm.New[NewTimestamp](2, data) -} - -// Timestamp returns a non-nil *[DateTime] if [NewTimestamp] represents the variant case "timestamp". -func (self *NewTimestamp) Timestamp() *DateTime { - return cm.Case[DateTime](self, 2) -} - -var stringsNewTimestamp = [3]string{ - "no-change", - "now", - "timestamp", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v NewTimestamp) String() string { - return stringsNewTimestamp[v.Tag()] -} - -// DirectoryEntry represents the record "wasi:filesystem/types@0.2.0#directory-entry". -// -// record directory-entry { -// %type: descriptor-type, -// name: string, -// } -type DirectoryEntry struct { - _ cm.HostLayout - Type DescriptorType - Name string -} - -// ErrorCode represents the enum "wasi:filesystem/types@0.2.0#error-code". -// -// enum error-code { -// access, -// would-block, -// already, -// bad-descriptor, -// busy, -// deadlock, -// quota, -// exist, -// file-too-large, -// illegal-byte-sequence, -// in-progress, -// interrupted, -// invalid, -// io, -// is-directory, -// loop, -// too-many-links, -// message-size, -// name-too-long, -// no-device, -// no-entry, -// no-lock, -// insufficient-memory, -// insufficient-space, -// not-directory, -// not-empty, -// not-recoverable, -// unsupported, -// no-tty, -// no-such-device, -// overflow, -// not-permitted, -// pipe, -// read-only, -// invalid-seek, -// text-file-busy, -// cross-device -// } -type ErrorCode uint8 - -const ( - ErrorCodeAccess ErrorCode = iota - ErrorCodeWouldBlock - ErrorCodeAlready - ErrorCodeBadDescriptor - ErrorCodeBusy - ErrorCodeDeadlock - ErrorCodeQuota - ErrorCodeExist - ErrorCodeFileTooLarge - ErrorCodeIllegalByteSequence - ErrorCodeInProgress - ErrorCodeInterrupted - ErrorCodeInvalid - ErrorCodeIO - ErrorCodeIsDirectory - ErrorCodeLoop - ErrorCodeTooManyLinks - ErrorCodeMessageSize - ErrorCodeNameTooLong - ErrorCodeNoDevice - ErrorCodeNoEntry - ErrorCodeNoLock - ErrorCodeInsufficientMemory - ErrorCodeInsufficientSpace - ErrorCodeNotDirectory - ErrorCodeNotEmpty - ErrorCodeNotRecoverable - ErrorCodeUnsupported - ErrorCodeNoTTY - ErrorCodeNoSuchDevice - ErrorCodeOverflow - ErrorCodeNotPermitted - ErrorCodePipe - ErrorCodeReadOnly - ErrorCodeInvalidSeek - ErrorCodeTextFileBusy - ErrorCodeCrossDevice -) - -var stringsErrorCode = [37]string{ - "access", - "would-block", - "already", - "bad-descriptor", - "busy", - "deadlock", - "quota", - "exist", - "file-too-large", - "illegal-byte-sequence", - "in-progress", - "interrupted", - "invalid", - "io", - "is-directory", - "loop", - "too-many-links", - "message-size", - "name-too-long", - "no-device", - "no-entry", - "no-lock", - "insufficient-memory", - "insufficient-space", - "not-directory", - "not-empty", - "not-recoverable", - "unsupported", - "no-tty", - "no-such-device", - "overflow", - "not-permitted", - "pipe", - "read-only", - "invalid-seek", - "text-file-busy", - "cross-device", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e ErrorCode) String() string { - return stringsErrorCode[e] -} - -// Advice represents the enum "wasi:filesystem/types@0.2.0#advice". -// -// enum advice { -// normal, -// sequential, -// random, -// will-need, -// dont-need, -// no-reuse -// } -type Advice uint8 - -const ( - AdviceNormal Advice = iota - AdviceSequential - AdviceRandom - AdviceWillNeed - AdviceDontNeed - AdviceNoReuse -) - -var stringsAdvice = [6]string{ - "normal", - "sequential", - "random", - "will-need", - "dont-need", - "no-reuse", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e Advice) String() string { - return stringsAdvice[e] -} - -// MetadataHashValue represents the record "wasi:filesystem/types@0.2.0#metadata-hash-value". -// -// record metadata-hash-value { -// lower: u64, -// upper: u64, -// } -type MetadataHashValue struct { - _ cm.HostLayout - Lower uint64 - Upper uint64 -} - -// Descriptor represents the imported resource "wasi:filesystem/types@0.2.0#descriptor". -// -// resource descriptor -type Descriptor cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "descriptor". -// -// Drops a resource handle. -// -//go:nosplit -func (self Descriptor) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorResourceDrop((uint32)(self0)) - return -} - -// Advise represents the imported method "advise". -// -// advise: func(offset: filesize, length: filesize, advice: advice) -> result<_, error-code> -// -//go:nosplit -func (self Descriptor) Advise(offset FileSize, length FileSize, advice Advice) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - offset0 := (uint64)(offset) - length0 := (uint64)(length) - advice0 := (uint32)(advice) - wasmimport_DescriptorAdvise((uint32)(self0), (uint64)(offset0), (uint64)(length0), (uint32)(advice0), &result) - return -} - -// AppendViaStream represents the imported method "append-via-stream". -// -// append-via-stream: func() -> result -// -//go:nosplit -func (self Descriptor) AppendViaStream() (result cm.Result[OutputStream, OutputStream, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorAppendViaStream((uint32)(self0), &result) - return -} - -// CreateDirectoryAt represents the imported method "create-directory-at". -// -// create-directory-at: func(path: string) -> result<_, error-code> -// -//go:nosplit -func (self Descriptor) CreateDirectoryAt(path string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorCreateDirectoryAt((uint32)(self0), (*uint8)(path0), (uint32)(path1), &result) - return -} - -// GetFlags represents the imported method "get-flags". -// -// get-flags: func() -> result -// -//go:nosplit -func (self Descriptor) GetFlags() (result cm.Result[DescriptorFlags, DescriptorFlags, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorGetFlags((uint32)(self0), &result) - return -} - -// GetType represents the imported method "get-type". -// -// get-type: func() -> result -// -//go:nosplit -func (self Descriptor) GetType() (result cm.Result[DescriptorType, DescriptorType, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorGetType((uint32)(self0), &result) - return -} - -// IsSameObject represents the imported method "is-same-object". -// -// is-same-object: func(other: borrow) -> bool -// -//go:nosplit -func (self Descriptor) IsSameObject(other Descriptor) (result bool) { - self0 := cm.Reinterpret[uint32](self) - other0 := cm.Reinterpret[uint32](other) - result0 := wasmimport_DescriptorIsSameObject((uint32)(self0), (uint32)(other0)) - result = (bool)(cm.U32ToBool((uint32)(result0))) - return -} - -// LinkAt represents the imported method "link-at". -// -// link-at: func(old-path-flags: path-flags, old-path: string, new-descriptor: borrow, -// new-path: string) -> result<_, error-code> -// -//go:nosplit -func (self Descriptor) LinkAt(oldPathFlags PathFlags, oldPath string, newDescriptor Descriptor, newPath string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - oldPathFlags0 := (uint32)(oldPathFlags) - oldPath0, oldPath1 := cm.LowerString(oldPath) - newDescriptor0 := cm.Reinterpret[uint32](newDescriptor) - newPath0, newPath1 := cm.LowerString(newPath) - wasmimport_DescriptorLinkAt((uint32)(self0), (uint32)(oldPathFlags0), (*uint8)(oldPath0), (uint32)(oldPath1), (uint32)(newDescriptor0), (*uint8)(newPath0), (uint32)(newPath1), &result) - return -} - -// MetadataHash represents the imported method "metadata-hash". -// -// metadata-hash: func() -> result -// -//go:nosplit -func (self Descriptor) MetadataHash() (result cm.Result[MetadataHashValueShape, MetadataHashValue, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorMetadataHash((uint32)(self0), &result) - return -} - -// MetadataHashAt represents the imported method "metadata-hash-at". -// -// metadata-hash-at: func(path-flags: path-flags, path: string) -> result -// -//go:nosplit -func (self Descriptor) MetadataHashAt(pathFlags PathFlags, path string) (result cm.Result[MetadataHashValueShape, MetadataHashValue, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - pathFlags0 := (uint32)(pathFlags) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorMetadataHashAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), &result) - return -} - -// OpenAt represents the imported method "open-at". -// -// open-at: func(path-flags: path-flags, path: string, open-flags: open-flags, %flags: -// descriptor-flags) -> result -// -//go:nosplit -func (self Descriptor) OpenAt(pathFlags PathFlags, path string, openFlags OpenFlags, flags DescriptorFlags) (result cm.Result[Descriptor, Descriptor, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - pathFlags0 := (uint32)(pathFlags) - path0, path1 := cm.LowerString(path) - openFlags0 := (uint32)(openFlags) - flags0 := (uint32)(flags) - wasmimport_DescriptorOpenAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), (uint32)(openFlags0), (uint32)(flags0), &result) - return -} - -// Read represents the imported method "read". -// -// read: func(length: filesize, offset: filesize) -> result, bool>, -// error-code> -// -//go:nosplit -func (self Descriptor) Read(length FileSize, offset FileSize) (result cm.Result[TupleListU8BoolShape, cm.Tuple[cm.List[uint8], bool], ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - length0 := (uint64)(length) - offset0 := (uint64)(offset) - wasmimport_DescriptorRead((uint32)(self0), (uint64)(length0), (uint64)(offset0), &result) - return -} - -// ReadDirectory represents the imported method "read-directory". -// -// read-directory: func() -> result -// -//go:nosplit -func (self Descriptor) ReadDirectory() (result cm.Result[DirectoryEntryStream, DirectoryEntryStream, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorReadDirectory((uint32)(self0), &result) - return -} - -// ReadViaStream represents the imported method "read-via-stream". -// -// read-via-stream: func(offset: filesize) -> result -// -//go:nosplit -func (self Descriptor) ReadViaStream(offset FileSize) (result cm.Result[InputStream, InputStream, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - offset0 := (uint64)(offset) - wasmimport_DescriptorReadViaStream((uint32)(self0), (uint64)(offset0), &result) - return -} - -// ReadLinkAt represents the imported method "readlink-at". -// -// readlink-at: func(path: string) -> result -// -//go:nosplit -func (self Descriptor) ReadLinkAt(path string) (result cm.Result[string, string, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorReadLinkAt((uint32)(self0), (*uint8)(path0), (uint32)(path1), &result) - return -} - -// RemoveDirectoryAt represents the imported method "remove-directory-at". -// -// remove-directory-at: func(path: string) -> result<_, error-code> -// -//go:nosplit -func (self Descriptor) RemoveDirectoryAt(path string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorRemoveDirectoryAt((uint32)(self0), (*uint8)(path0), (uint32)(path1), &result) - return -} - -// RenameAt represents the imported method "rename-at". -// -// rename-at: func(old-path: string, new-descriptor: borrow, new-path: -// string) -> result<_, error-code> -// -//go:nosplit -func (self Descriptor) RenameAt(oldPath string, newDescriptor Descriptor, newPath string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - oldPath0, oldPath1 := cm.LowerString(oldPath) - newDescriptor0 := cm.Reinterpret[uint32](newDescriptor) - newPath0, newPath1 := cm.LowerString(newPath) - wasmimport_DescriptorRenameAt((uint32)(self0), (*uint8)(oldPath0), (uint32)(oldPath1), (uint32)(newDescriptor0), (*uint8)(newPath0), (uint32)(newPath1), &result) - return -} - -// SetSize represents the imported method "set-size". -// -// set-size: func(size: filesize) -> result<_, error-code> -// -//go:nosplit -func (self Descriptor) SetSize(size FileSize) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - size0 := (uint64)(size) - wasmimport_DescriptorSetSize((uint32)(self0), (uint64)(size0), &result) - return -} - -// SetTimes represents the imported method "set-times". -// -// set-times: func(data-access-timestamp: new-timestamp, data-modification-timestamp: -// new-timestamp) -> result<_, error-code> -// -//go:nosplit -func (self Descriptor) SetTimes(dataAccessTimestamp NewTimestamp, dataModificationTimestamp NewTimestamp) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - dataAccessTimestamp0, dataAccessTimestamp1, dataAccessTimestamp2 := lower_NewTimestamp(dataAccessTimestamp) - dataModificationTimestamp0, dataModificationTimestamp1, dataModificationTimestamp2 := lower_NewTimestamp(dataModificationTimestamp) - wasmimport_DescriptorSetTimes((uint32)(self0), (uint32)(dataAccessTimestamp0), (uint64)(dataAccessTimestamp1), (uint32)(dataAccessTimestamp2), (uint32)(dataModificationTimestamp0), (uint64)(dataModificationTimestamp1), (uint32)(dataModificationTimestamp2), &result) - return -} - -// SetTimesAt represents the imported method "set-times-at". -// -// set-times-at: func(path-flags: path-flags, path: string, data-access-timestamp: -// new-timestamp, data-modification-timestamp: new-timestamp) -> result<_, error-code> -// -//go:nosplit -func (self Descriptor) SetTimesAt(pathFlags PathFlags, path string, dataAccessTimestamp NewTimestamp, dataModificationTimestamp NewTimestamp) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - pathFlags0 := (uint32)(pathFlags) - path0, path1 := cm.LowerString(path) - dataAccessTimestamp0, dataAccessTimestamp1, dataAccessTimestamp2 := lower_NewTimestamp(dataAccessTimestamp) - dataModificationTimestamp0, dataModificationTimestamp1, dataModificationTimestamp2 := lower_NewTimestamp(dataModificationTimestamp) - wasmimport_DescriptorSetTimesAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), (uint32)(dataAccessTimestamp0), (uint64)(dataAccessTimestamp1), (uint32)(dataAccessTimestamp2), (uint32)(dataModificationTimestamp0), (uint64)(dataModificationTimestamp1), (uint32)(dataModificationTimestamp2), &result) - return -} - -// Stat represents the imported method "stat". -// -// stat: func() -> result -// -//go:nosplit -func (self Descriptor) Stat() (result cm.Result[DescriptorStatShape, DescriptorStat, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorStat((uint32)(self0), &result) - return -} - -// StatAt represents the imported method "stat-at". -// -// stat-at: func(path-flags: path-flags, path: string) -> result -// -//go:nosplit -func (self Descriptor) StatAt(pathFlags PathFlags, path string) (result cm.Result[DescriptorStatShape, DescriptorStat, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - pathFlags0 := (uint32)(pathFlags) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorStatAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), &result) - return -} - -// SymlinkAt represents the imported method "symlink-at". -// -// symlink-at: func(old-path: string, new-path: string) -> result<_, error-code> -// -//go:nosplit -func (self Descriptor) SymlinkAt(oldPath string, newPath string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - oldPath0, oldPath1 := cm.LowerString(oldPath) - newPath0, newPath1 := cm.LowerString(newPath) - wasmimport_DescriptorSymlinkAt((uint32)(self0), (*uint8)(oldPath0), (uint32)(oldPath1), (*uint8)(newPath0), (uint32)(newPath1), &result) - return -} - -// Sync represents the imported method "sync". -// -// sync: func() -> result<_, error-code> -// -//go:nosplit -func (self Descriptor) Sync() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorSync((uint32)(self0), &result) - return -} - -// SyncData represents the imported method "sync-data". -// -// sync-data: func() -> result<_, error-code> -// -//go:nosplit -func (self Descriptor) SyncData() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorSyncData((uint32)(self0), &result) - return -} - -// UnlinkFileAt represents the imported method "unlink-file-at". -// -// unlink-file-at: func(path: string) -> result<_, error-code> -// -//go:nosplit -func (self Descriptor) UnlinkFileAt(path string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorUnlinkFileAt((uint32)(self0), (*uint8)(path0), (uint32)(path1), &result) - return -} - -// Write represents the imported method "write". -// -// write: func(buffer: list, offset: filesize) -> result -// -//go:nosplit -func (self Descriptor) Write(buffer cm.List[uint8], offset FileSize) (result cm.Result[uint64, FileSize, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - buffer0, buffer1 := cm.LowerList(buffer) - offset0 := (uint64)(offset) - wasmimport_DescriptorWrite((uint32)(self0), (*uint8)(buffer0), (uint32)(buffer1), (uint64)(offset0), &result) - return -} - -// WriteViaStream represents the imported method "write-via-stream". -// -// write-via-stream: func(offset: filesize) -> result -// -//go:nosplit -func (self Descriptor) WriteViaStream(offset FileSize) (result cm.Result[OutputStream, OutputStream, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - offset0 := (uint64)(offset) - wasmimport_DescriptorWriteViaStream((uint32)(self0), (uint64)(offset0), &result) - return -} - -// DirectoryEntryStream represents the imported resource "wasi:filesystem/types@0.2.0#directory-entry-stream". -// -// resource directory-entry-stream -type DirectoryEntryStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "directory-entry-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self DirectoryEntryStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DirectoryEntryStreamResourceDrop((uint32)(self0)) - return -} - -// ReadDirectoryEntry represents the imported method "read-directory-entry". -// -// read-directory-entry: func() -> result, error-code> -// -//go:nosplit -func (self DirectoryEntryStream) ReadDirectoryEntry() (result cm.Result[OptionDirectoryEntryShape, cm.Option[DirectoryEntry], ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DirectoryEntryStreamReadDirectoryEntry((uint32)(self0), &result) - return -} - -// FilesystemErrorCode represents the imported function "filesystem-error-code". -// -// filesystem-error-code: func(err: borrow) -> option -// -//go:nosplit -func FilesystemErrorCode(err Error) (result cm.Option[ErrorCode]) { - err0 := cm.Reinterpret[uint32](err) - wasmimport_FilesystemErrorCode((uint32)(err0), &result) - return -} diff --git a/examples/component/invoke/gen/wasi/http/outgoing-handler/abi.go b/examples/component/invoke/gen/wasi/http/outgoing-handler/abi.go deleted file mode 100644 index 3c193143..00000000 --- a/examples/component/invoke/gen/wasi/http/outgoing-handler/abi.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package outgoinghandler - -import ( - "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/http/types" - "go.bytecodealliance.org/cm" - "unsafe" -) - -// ErrorCodeShape is used for storage in variant or result types. -type ErrorCodeShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(types.ErrorCode{})]byte -} - -func lower_OptionRequestOptions(v cm.Option[RequestOptions]) (f0 uint32, f1 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := cm.Reinterpret[uint32](*some) - f1 = (uint32)(v1) - } - return -} diff --git a/examples/component/invoke/gen/wasi/http/outgoing-handler/empty.s b/examples/component/invoke/gen/wasi/http/outgoing-handler/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/http/outgoing-handler/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go b/examples/component/invoke/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go deleted file mode 100644 index 68550053..00000000 --- a/examples/component/invoke/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package outgoinghandler represents the imported interface "wasi:http/outgoing-handler@0.2.0". -package outgoinghandler - -import ( - "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/http/types" - "go.bytecodealliance.org/cm" -) - -// OutgoingRequest represents the imported type alias "wasi:http/outgoing-handler@0.2.0#outgoing-request". -// -// See [types.OutgoingRequest] for more information. -type OutgoingRequest = types.OutgoingRequest - -// RequestOptions represents the imported type alias "wasi:http/outgoing-handler@0.2.0#request-options". -// -// See [types.RequestOptions] for more information. -type RequestOptions = types.RequestOptions - -// FutureIncomingResponse represents the imported type alias "wasi:http/outgoing-handler@0.2.0#future-incoming-response". -// -// See [types.FutureIncomingResponse] for more information. -type FutureIncomingResponse = types.FutureIncomingResponse - -// ErrorCode represents the type alias "wasi:http/outgoing-handler@0.2.0#error-code". -// -// See [types.ErrorCode] for more information. -type ErrorCode = types.ErrorCode - -// Handle represents the imported function "handle". -// -// handle: func(request: outgoing-request, options: option) -> result -// -//go:nosplit -func Handle(request OutgoingRequest, options cm.Option[RequestOptions]) (result cm.Result[ErrorCodeShape, FutureIncomingResponse, ErrorCode]) { - request0 := cm.Reinterpret[uint32](request) - options0, options1 := lower_OptionRequestOptions(options) - wasmimport_Handle((uint32)(request0), (uint32)(options0), (uint32)(options1), &result) - return -} diff --git a/examples/component/invoke/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go b/examples/component/invoke/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go deleted file mode 100755 index 6b3f3828..00000000 --- a/examples/component/invoke/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package outgoinghandler - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:http@0.2.0". - -//go:wasmimport wasi:http/outgoing-handler@0.2.0 handle -//go:noescape -func wasmimport_Handle(request0 uint32, options0 uint32, options1 uint32, result *cm.Result[ErrorCodeShape, FutureIncomingResponse, ErrorCode]) diff --git a/examples/component/invoke/gen/wasi/http/types/abi.go b/examples/component/invoke/gen/wasi/http/types/abi.go deleted file mode 100644 index 6ffb1fdd..00000000 --- a/examples/component/invoke/gen/wasi/http/types/abi.go +++ /dev/null @@ -1,264 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package types - -import ( - "go.bytecodealliance.org/cm" - "unsafe" -) - -// OptionFieldSizePayloadShape is used for storage in variant or result types. -type OptionFieldSizePayloadShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Option[FieldSizePayload]{})]byte -} - -func lower_OptionString(v cm.Option[string]) (f0 uint32, f1 *uint8, f2 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1, v2 := cm.LowerString(*some) - f1 = (*uint8)(v1) - f2 = (uint32)(v2) - } - return -} - -func lower_Method(v Method) (f0 uint32, f1 *uint8, f2 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 9: // other - v1, v2 := cm.LowerString(*cm.Case[string](&v, 9)) - f1 = (*uint8)(v1) - f2 = (uint32)(v2) - } - return -} - -func lower_Scheme(v Scheme) (f0 uint32, f1 *uint8, f2 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 2: // other - v1, v2 := cm.LowerString(*cm.Case[string](&v, 2)) - f1 = (*uint8)(v1) - f2 = (uint32)(v2) - } - return -} - -func lower_OptionScheme(v cm.Option[Scheme]) (f0 uint32, f1 uint32, f2 *uint8, f3 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1, v2, v3 := lower_Scheme(*some) - f1 = (uint32)(v1) - f2 = (*uint8)(v2) - f3 = (uint32)(v3) - } - return -} - -func lower_OptionDuration(v cm.Option[Duration]) (f0 uint32, f1 uint64) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := (uint64)(*some) - f1 = (uint64)(v1) - } - return -} - -// ErrorCodeShape is used for storage in variant or result types. -type ErrorCodeShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(ErrorCode{})]byte -} - -func lower_OptionU16(v cm.Option[uint16]) (f0 uint32, f1 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := (uint32)(*some) - f1 = (uint32)(v1) - } - return -} - -func lower_DNSErrorPayload(v DNSErrorPayload) (f0 uint32, f1 *uint8, f2 uint32, f3 uint32, f4 uint32) { - f0, f1, f2 = lower_OptionString(v.Rcode) - f3, f4 = lower_OptionU16(v.InfoCode) - return -} - -func lower_OptionU8(v cm.Option[uint8]) (f0 uint32, f1 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := (uint32)(*some) - f1 = (uint32)(v1) - } - return -} - -func lower_TLSAlertReceivedPayload(v TLSAlertReceivedPayload) (f0 uint32, f1 uint32, f2 uint32, f3 *uint8, f4 uint32) { - f0, f1 = lower_OptionU8(v.AlertID) - f2, f3, f4 = lower_OptionString(v.AlertMessage) - return -} - -func lower_OptionU64(v cm.Option[uint64]) (f0 uint32, f1 uint64) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := (uint64)(*some) - f1 = (uint64)(v1) - } - return -} - -func lower_OptionU32(v cm.Option[uint32]) (f0 uint32, f1 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := (uint32)(*some) - f1 = (uint32)(v1) - } - return -} - -func lower_FieldSizePayload(v FieldSizePayload) (f0 uint32, f1 *uint8, f2 uint32, f3 uint32, f4 uint32) { - f0, f1, f2 = lower_OptionString(v.FieldName) - f3, f4 = lower_OptionU32(v.FieldSize) - return -} - -func lower_OptionFieldSizePayload(v cm.Option[FieldSizePayload]) (f0 uint32, f1 uint32, f2 *uint8, f3 uint32, f4 uint32, f5 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1, v2, v3, v4, v5 := lower_FieldSizePayload(*some) - f1 = (uint32)(v1) - f2 = (*uint8)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - } - return -} - -func lower_ErrorCode(v ErrorCode) (f0 uint32, f1 uint32, f2 uint64, f3 uint32, f4 uint32, f5 uint32, f6 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 1: // DNS-error - v1, v2, v3, v4, v5 := lower_DNSErrorPayload(*cm.Case[DNSErrorPayload](&v, 1)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 14: // TLS-alert-received - v1, v2, v3, v4, v5 := lower_TLSAlertReceivedPayload(*cm.Case[TLSAlertReceivedPayload](&v, 14)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(cm.PointerToU32(v4)) - f5 = (uint32)(v5) - case 17: // HTTP-request-body-size - v1, v2 := lower_OptionU64(*cm.Case[cm.Option[uint64]](&v, 17)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 21: // HTTP-request-header-section-size - v1, v2 := lower_OptionU32(*cm.Case[cm.Option[uint32]](&v, 21)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 22: // HTTP-request-header-size - v1, v2, v3, v4, v5, v6 := lower_OptionFieldSizePayload(*cm.Case[cm.Option[FieldSizePayload]](&v, 22)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - f3 = (uint32)(cm.PointerToU32(v3)) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - f6 = (uint32)(v6) - case 23: // HTTP-request-trailer-section-size - v1, v2 := lower_OptionU32(*cm.Case[cm.Option[uint32]](&v, 23)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 24: // HTTP-request-trailer-size - v1, v2, v3, v4, v5 := lower_FieldSizePayload(*cm.Case[FieldSizePayload](&v, 24)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 26: // HTTP-response-header-section-size - v1, v2 := lower_OptionU32(*cm.Case[cm.Option[uint32]](&v, 26)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 27: // HTTP-response-header-size - v1, v2, v3, v4, v5 := lower_FieldSizePayload(*cm.Case[FieldSizePayload](&v, 27)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 28: // HTTP-response-body-size - v1, v2 := lower_OptionU64(*cm.Case[cm.Option[uint64]](&v, 28)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 29: // HTTP-response-trailer-section-size - v1, v2 := lower_OptionU32(*cm.Case[cm.Option[uint32]](&v, 29)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 30: // HTTP-response-trailer-size - v1, v2, v3, v4, v5 := lower_FieldSizePayload(*cm.Case[FieldSizePayload](&v, 30)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 31: // HTTP-response-transfer-coding - v1, v2, v3 := lower_OptionString(*cm.Case[cm.Option[string]](&v, 31)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - case 32: // HTTP-response-content-coding - v1, v2, v3 := lower_OptionString(*cm.Case[cm.Option[string]](&v, 32)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - case 38: // internal-error - v1, v2, v3 := lower_OptionString(*cm.Case[cm.Option[string]](&v, 38)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - } - return -} - -func lower_ResultOutgoingResponseErrorCode(v cm.Result[ErrorCodeShape, OutgoingResponse, ErrorCode]) (f0 uint32, f1 uint32, f2 uint32, f3 uint64, f4 uint32, f5 uint32, f6 uint32, f7 uint32) { - if v.IsOK() { - v1 := cm.Reinterpret[uint32](*v.OK()) - f1 = (uint32)(v1) - } else { - f0 = 1 - v1, v2, v3, v4, v5, v6, v7 := lower_ErrorCode(*v.Err()) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint64)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - f6 = (uint32)(v6) - f7 = (uint32)(v7) - } - return -} - -func lower_OptionTrailers(v cm.Option[Trailers]) (f0 uint32, f1 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := cm.Reinterpret[uint32](*some) - f1 = (uint32)(v1) - } - return -} diff --git a/examples/component/invoke/gen/wasi/http/types/empty.s b/examples/component/invoke/gen/wasi/http/types/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/http/types/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/http/types/types.wasm.go b/examples/component/invoke/gen/wasi/http/types/types.wasm.go deleted file mode 100755 index b025b2af..00000000 --- a/examples/component/invoke/gen/wasi/http/types/types.wasm.go +++ /dev/null @@ -1,257 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package types - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:http@0.2.0". - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]fields -//go:noescape -func wasmimport_FieldsResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [constructor]fields -//go:noescape -func wasmimport_NewFields() (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [static]fields.from-list -//go:noescape -func wasmimport_FieldsFromList(entries0 *cm.Tuple[FieldKey, FieldValue], entries1 uint32, result *cm.Result[Fields, Fields, HeaderError]) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.append -//go:noescape -func wasmimport_FieldsAppend(self0 uint32, name0 *uint8, name1 uint32, value0 *uint8, value1 uint32, result *cm.Result[HeaderError, struct{}, HeaderError]) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.clone -//go:noescape -func wasmimport_FieldsClone(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.delete -//go:noescape -func wasmimport_FieldsDelete(self0 uint32, name0 *uint8, name1 uint32, result *cm.Result[HeaderError, struct{}, HeaderError]) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.entries -//go:noescape -func wasmimport_FieldsEntries(self0 uint32, result *cm.List[cm.Tuple[FieldKey, FieldValue]]) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.get -//go:noescape -func wasmimport_FieldsGet(self0 uint32, name0 *uint8, name1 uint32, result *cm.List[FieldValue]) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.has -//go:noescape -func wasmimport_FieldsHas(self0 uint32, name0 *uint8, name1 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.set -//go:noescape -func wasmimport_FieldsSet(self0 uint32, name0 *uint8, name1 uint32, value0 *FieldValue, value1 uint32, result *cm.Result[HeaderError, struct{}, HeaderError]) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]incoming-request -//go:noescape -func wasmimport_IncomingRequestResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.authority -//go:noescape -func wasmimport_IncomingRequestAuthority(self0 uint32, result *cm.Option[string]) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.consume -//go:noescape -func wasmimport_IncomingRequestConsume(self0 uint32, result *cm.Result[IncomingBody, IncomingBody, struct{}]) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.headers -//go:noescape -func wasmimport_IncomingRequestHeaders(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.method -//go:noescape -func wasmimport_IncomingRequestMethod(self0 uint32, result *Method) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.path-with-query -//go:noescape -func wasmimport_IncomingRequestPathWithQuery(self0 uint32, result *cm.Option[string]) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.scheme -//go:noescape -func wasmimport_IncomingRequestScheme(self0 uint32, result *cm.Option[Scheme]) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]outgoing-request -//go:noescape -func wasmimport_OutgoingRequestResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [constructor]outgoing-request -//go:noescape -func wasmimport_NewOutgoingRequest(headers0 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.authority -//go:noescape -func wasmimport_OutgoingRequestAuthority(self0 uint32, result *cm.Option[string]) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.body -//go:noescape -func wasmimport_OutgoingRequestBody(self0 uint32, result *cm.Result[OutgoingBody, OutgoingBody, struct{}]) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.headers -//go:noescape -func wasmimport_OutgoingRequestHeaders(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.method -//go:noescape -func wasmimport_OutgoingRequestMethod(self0 uint32, result *Method) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.path-with-query -//go:noescape -func wasmimport_OutgoingRequestPathWithQuery(self0 uint32, result *cm.Option[string]) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.scheme -//go:noescape -func wasmimport_OutgoingRequestScheme(self0 uint32, result *cm.Option[Scheme]) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-authority -//go:noescape -func wasmimport_OutgoingRequestSetAuthority(self0 uint32, authority0 uint32, authority1 *uint8, authority2 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-method -//go:noescape -func wasmimport_OutgoingRequestSetMethod(self0 uint32, method0 uint32, method1 *uint8, method2 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-path-with-query -//go:noescape -func wasmimport_OutgoingRequestSetPathWithQuery(self0 uint32, pathWithQuery0 uint32, pathWithQuery1 *uint8, pathWithQuery2 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-scheme -//go:noescape -func wasmimport_OutgoingRequestSetScheme(self0 uint32, scheme0 uint32, scheme1 uint32, scheme2 *uint8, scheme3 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]request-options -//go:noescape -func wasmimport_RequestOptionsResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [constructor]request-options -//go:noescape -func wasmimport_NewRequestOptions() (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.between-bytes-timeout -//go:noescape -func wasmimport_RequestOptionsBetweenBytesTimeout(self0 uint32, result *cm.Option[Duration]) - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.connect-timeout -//go:noescape -func wasmimport_RequestOptionsConnectTimeout(self0 uint32, result *cm.Option[Duration]) - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.first-byte-timeout -//go:noescape -func wasmimport_RequestOptionsFirstByteTimeout(self0 uint32, result *cm.Option[Duration]) - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.set-between-bytes-timeout -//go:noescape -func wasmimport_RequestOptionsSetBetweenBytesTimeout(self0 uint32, duration0 uint32, duration1 uint64) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.set-connect-timeout -//go:noescape -func wasmimport_RequestOptionsSetConnectTimeout(self0 uint32, duration0 uint32, duration1 uint64) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.set-first-byte-timeout -//go:noescape -func wasmimport_RequestOptionsSetFirstByteTimeout(self0 uint32, duration0 uint32, duration1 uint64) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]response-outparam -//go:noescape -func wasmimport_ResponseOutparamResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [static]response-outparam.set -//go:noescape -func wasmimport_ResponseOutparamSet(param0 uint32, response0 uint32, response1 uint32, response2 uint32, response3 uint64, response4 uint32, response5 uint32, response6 uint32, response7 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]incoming-response -//go:noescape -func wasmimport_IncomingResponseResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-response.consume -//go:noescape -func wasmimport_IncomingResponseConsume(self0 uint32, result *cm.Result[IncomingBody, IncomingBody, struct{}]) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-response.headers -//go:noescape -func wasmimport_IncomingResponseHeaders(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-response.status -//go:noescape -func wasmimport_IncomingResponseStatus(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]incoming-body -//go:noescape -func wasmimport_IncomingBodyResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [static]incoming-body.finish -//go:noescape -func wasmimport_IncomingBodyFinish(this0 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-body.stream -//go:noescape -func wasmimport_IncomingBodyStream(self0 uint32, result *cm.Result[InputStream, InputStream, struct{}]) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]future-trailers -//go:noescape -func wasmimport_FutureTrailersResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]future-trailers.get -//go:noescape -func wasmimport_FutureTrailersGet(self0 uint32, result *cm.Option[cm.Result[cm.Result[ErrorCodeShape, cm.Option[Trailers], ErrorCode], cm.Result[ErrorCodeShape, cm.Option[Trailers], ErrorCode], struct{}]]) - -//go:wasmimport wasi:http/types@0.2.0 [method]future-trailers.subscribe -//go:noescape -func wasmimport_FutureTrailersSubscribe(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]outgoing-response -//go:noescape -func wasmimport_OutgoingResponseResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [constructor]outgoing-response -//go:noescape -func wasmimport_NewOutgoingResponse(headers0 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.body -//go:noescape -func wasmimport_OutgoingResponseBody(self0 uint32, result *cm.Result[OutgoingBody, OutgoingBody, struct{}]) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.headers -//go:noescape -func wasmimport_OutgoingResponseHeaders(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.set-status-code -//go:noescape -func wasmimport_OutgoingResponseSetStatusCode(self0 uint32, statusCode0 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.status-code -//go:noescape -func wasmimport_OutgoingResponseStatusCode(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]outgoing-body -//go:noescape -func wasmimport_OutgoingBodyResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [static]outgoing-body.finish -//go:noescape -func wasmimport_OutgoingBodyFinish(this0 uint32, trailers0 uint32, trailers1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-body.write -//go:noescape -func wasmimport_OutgoingBodyWrite(self0 uint32, result *cm.Result[OutputStream, OutputStream, struct{}]) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]future-incoming-response -//go:noescape -func wasmimport_FutureIncomingResponseResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]future-incoming-response.get -//go:noescape -func wasmimport_FutureIncomingResponseGet(self0 uint32, result *cm.Option[cm.Result[cm.Result[ErrorCodeShape, IncomingResponse, ErrorCode], cm.Result[ErrorCodeShape, IncomingResponse, ErrorCode], struct{}]]) - -//go:wasmimport wasi:http/types@0.2.0 [method]future-incoming-response.subscribe -//go:noescape -func wasmimport_FutureIncomingResponseSubscribe(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 http-error-code -//go:noescape -func wasmimport_HTTPErrorCode(err0 uint32, result *cm.Option[ErrorCode]) diff --git a/examples/component/invoke/gen/wasi/http/types/types.wit.go b/examples/component/invoke/gen/wasi/http/types/types.wit.go deleted file mode 100644 index 2e1903ea..00000000 --- a/examples/component/invoke/gen/wasi/http/types/types.wit.go +++ /dev/null @@ -1,1603 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package types represents the imported interface "wasi:http/types@0.2.0". -package types - -import ( - monotonicclock "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/clocks/monotonic-clock" - ioerror "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/io/error" - "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/io/poll" - "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/io/streams" - "go.bytecodealliance.org/cm" -) - -// Duration represents the type alias "wasi:http/types@0.2.0#duration". -// -// See [monotonicclock.Duration] for more information. -type Duration = monotonicclock.Duration - -// InputStream represents the imported type alias "wasi:http/types@0.2.0#input-stream". -// -// See [streams.InputStream] for more information. -type InputStream = streams.InputStream - -// OutputStream represents the imported type alias "wasi:http/types@0.2.0#output-stream". -// -// See [streams.OutputStream] for more information. -type OutputStream = streams.OutputStream - -// IOError represents the imported type alias "wasi:http/types@0.2.0#io-error". -// -// See [ioerror.Error] for more information. -type IOError = ioerror.Error - -// Pollable represents the imported type alias "wasi:http/types@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// Method represents the variant "wasi:http/types@0.2.0#method". -// -// variant method { -// get, -// head, -// post, -// put, -// delete, -// connect, -// options, -// trace, -// patch, -// other(string), -// } -type Method cm.Variant[uint8, string, string] - -// MethodGet returns a [Method] of case "get". -func MethodGet() Method { - var data struct{} - return cm.New[Method](0, data) -} - -// Get returns true if [Method] represents the variant case "get". -func (self *Method) Get() bool { - return self.Tag() == 0 -} - -// MethodHead returns a [Method] of case "head". -func MethodHead() Method { - var data struct{} - return cm.New[Method](1, data) -} - -// Head returns true if [Method] represents the variant case "head". -func (self *Method) Head() bool { - return self.Tag() == 1 -} - -// MethodPost returns a [Method] of case "post". -func MethodPost() Method { - var data struct{} - return cm.New[Method](2, data) -} - -// Post returns true if [Method] represents the variant case "post". -func (self *Method) Post() bool { - return self.Tag() == 2 -} - -// MethodPut returns a [Method] of case "put". -func MethodPut() Method { - var data struct{} - return cm.New[Method](3, data) -} - -// Put returns true if [Method] represents the variant case "put". -func (self *Method) Put() bool { - return self.Tag() == 3 -} - -// MethodDelete returns a [Method] of case "delete". -func MethodDelete() Method { - var data struct{} - return cm.New[Method](4, data) -} - -// Delete returns true if [Method] represents the variant case "delete". -func (self *Method) Delete() bool { - return self.Tag() == 4 -} - -// MethodConnect returns a [Method] of case "connect". -func MethodConnect() Method { - var data struct{} - return cm.New[Method](5, data) -} - -// Connect returns true if [Method] represents the variant case "connect". -func (self *Method) Connect() bool { - return self.Tag() == 5 -} - -// MethodOptions returns a [Method] of case "options". -func MethodOptions() Method { - var data struct{} - return cm.New[Method](6, data) -} - -// Options returns true if [Method] represents the variant case "options". -func (self *Method) Options() bool { - return self.Tag() == 6 -} - -// MethodTrace returns a [Method] of case "trace". -func MethodTrace() Method { - var data struct{} - return cm.New[Method](7, data) -} - -// Trace returns true if [Method] represents the variant case "trace". -func (self *Method) Trace() bool { - return self.Tag() == 7 -} - -// MethodPatch returns a [Method] of case "patch". -func MethodPatch() Method { - var data struct{} - return cm.New[Method](8, data) -} - -// Patch returns true if [Method] represents the variant case "patch". -func (self *Method) Patch() bool { - return self.Tag() == 8 -} - -// MethodOther returns a [Method] of case "other". -func MethodOther(data string) Method { - return cm.New[Method](9, data) -} - -// Other returns a non-nil *[string] if [Method] represents the variant case "other". -func (self *Method) Other() *string { - return cm.Case[string](self, 9) -} - -var stringsMethod = [10]string{ - "get", - "head", - "post", - "put", - "delete", - "connect", - "options", - "trace", - "patch", - "other", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v Method) String() string { - return stringsMethod[v.Tag()] -} - -// Scheme represents the variant "wasi:http/types@0.2.0#scheme". -// -// variant scheme { -// HTTP, -// HTTPS, -// other(string), -// } -type Scheme cm.Variant[uint8, string, string] - -// SchemeHTTP returns a [Scheme] of case "HTTP". -func SchemeHTTP() Scheme { - var data struct{} - return cm.New[Scheme](0, data) -} - -// HTTP returns true if [Scheme] represents the variant case "HTTP". -func (self *Scheme) HTTP() bool { - return self.Tag() == 0 -} - -// SchemeHTTPS returns a [Scheme] of case "HTTPS". -func SchemeHTTPS() Scheme { - var data struct{} - return cm.New[Scheme](1, data) -} - -// HTTPS returns true if [Scheme] represents the variant case "HTTPS". -func (self *Scheme) HTTPS() bool { - return self.Tag() == 1 -} - -// SchemeOther returns a [Scheme] of case "other". -func SchemeOther(data string) Scheme { - return cm.New[Scheme](2, data) -} - -// Other returns a non-nil *[string] if [Scheme] represents the variant case "other". -func (self *Scheme) Other() *string { - return cm.Case[string](self, 2) -} - -var stringsScheme = [3]string{ - "HTTP", - "HTTPS", - "other", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v Scheme) String() string { - return stringsScheme[v.Tag()] -} - -// DNSErrorPayload represents the record "wasi:http/types@0.2.0#DNS-error-payload". -// -// record DNS-error-payload { -// rcode: option, -// info-code: option, -// } -type DNSErrorPayload struct { - _ cm.HostLayout - Rcode cm.Option[string] - InfoCode cm.Option[uint16] -} - -// TLSAlertReceivedPayload represents the record "wasi:http/types@0.2.0#TLS-alert-received-payload". -// -// record TLS-alert-received-payload { -// alert-id: option, -// alert-message: option, -// } -type TLSAlertReceivedPayload struct { - _ cm.HostLayout - AlertID cm.Option[uint8] - AlertMessage cm.Option[string] -} - -// FieldSizePayload represents the record "wasi:http/types@0.2.0#field-size-payload". -// -// record field-size-payload { -// field-name: option, -// field-size: option, -// } -type FieldSizePayload struct { - _ cm.HostLayout - FieldName cm.Option[string] - FieldSize cm.Option[uint32] -} - -// ErrorCode represents the variant "wasi:http/types@0.2.0#error-code". -// -// variant error-code { -// DNS-timeout, -// DNS-error(DNS-error-payload), -// destination-not-found, -// destination-unavailable, -// destination-IP-prohibited, -// destination-IP-unroutable, -// connection-refused, -// connection-terminated, -// connection-timeout, -// connection-read-timeout, -// connection-write-timeout, -// connection-limit-reached, -// TLS-protocol-error, -// TLS-certificate-error, -// TLS-alert-received(TLS-alert-received-payload), -// HTTP-request-denied, -// HTTP-request-length-required, -// HTTP-request-body-size(option), -// HTTP-request-method-invalid, -// HTTP-request-URI-invalid, -// HTTP-request-URI-too-long, -// HTTP-request-header-section-size(option), -// HTTP-request-header-size(option), -// HTTP-request-trailer-section-size(option), -// HTTP-request-trailer-size(field-size-payload), -// HTTP-response-incomplete, -// HTTP-response-header-section-size(option), -// HTTP-response-header-size(field-size-payload), -// HTTP-response-body-size(option), -// HTTP-response-trailer-section-size(option), -// HTTP-response-trailer-size(field-size-payload), -// HTTP-response-transfer-coding(option), -// HTTP-response-content-coding(option), -// HTTP-response-timeout, -// HTTP-upgrade-failed, -// HTTP-protocol-error, -// loop-detected, -// configuration-error, -// internal-error(option), -// } -type ErrorCode cm.Variant[uint8, OptionFieldSizePayloadShape, cm.Option[uint64]] - -// ErrorCodeDNSTimeout returns a [ErrorCode] of case "DNS-timeout". -func ErrorCodeDNSTimeout() ErrorCode { - var data struct{} - return cm.New[ErrorCode](0, data) -} - -// DNSTimeout returns true if [ErrorCode] represents the variant case "DNS-timeout". -func (self *ErrorCode) DNSTimeout() bool { - return self.Tag() == 0 -} - -// ErrorCodeDNSError returns a [ErrorCode] of case "DNS-error". -func ErrorCodeDNSError(data DNSErrorPayload) ErrorCode { - return cm.New[ErrorCode](1, data) -} - -// DNSError returns a non-nil *[DNSErrorPayload] if [ErrorCode] represents the variant case "DNS-error". -func (self *ErrorCode) DNSError() *DNSErrorPayload { - return cm.Case[DNSErrorPayload](self, 1) -} - -// ErrorCodeDestinationNotFound returns a [ErrorCode] of case "destination-not-found". -func ErrorCodeDestinationNotFound() ErrorCode { - var data struct{} - return cm.New[ErrorCode](2, data) -} - -// DestinationNotFound returns true if [ErrorCode] represents the variant case "destination-not-found". -func (self *ErrorCode) DestinationNotFound() bool { - return self.Tag() == 2 -} - -// ErrorCodeDestinationUnavailable returns a [ErrorCode] of case "destination-unavailable". -func ErrorCodeDestinationUnavailable() ErrorCode { - var data struct{} - return cm.New[ErrorCode](3, data) -} - -// DestinationUnavailable returns true if [ErrorCode] represents the variant case "destination-unavailable". -func (self *ErrorCode) DestinationUnavailable() bool { - return self.Tag() == 3 -} - -// ErrorCodeDestinationIPProhibited returns a [ErrorCode] of case "destination-IP-prohibited". -func ErrorCodeDestinationIPProhibited() ErrorCode { - var data struct{} - return cm.New[ErrorCode](4, data) -} - -// DestinationIPProhibited returns true if [ErrorCode] represents the variant case "destination-IP-prohibited". -func (self *ErrorCode) DestinationIPProhibited() bool { - return self.Tag() == 4 -} - -// ErrorCodeDestinationIPUnroutable returns a [ErrorCode] of case "destination-IP-unroutable". -func ErrorCodeDestinationIPUnroutable() ErrorCode { - var data struct{} - return cm.New[ErrorCode](5, data) -} - -// DestinationIPUnroutable returns true if [ErrorCode] represents the variant case "destination-IP-unroutable". -func (self *ErrorCode) DestinationIPUnroutable() bool { - return self.Tag() == 5 -} - -// ErrorCodeConnectionRefused returns a [ErrorCode] of case "connection-refused". -func ErrorCodeConnectionRefused() ErrorCode { - var data struct{} - return cm.New[ErrorCode](6, data) -} - -// ConnectionRefused returns true if [ErrorCode] represents the variant case "connection-refused". -func (self *ErrorCode) ConnectionRefused() bool { - return self.Tag() == 6 -} - -// ErrorCodeConnectionTerminated returns a [ErrorCode] of case "connection-terminated". -func ErrorCodeConnectionTerminated() ErrorCode { - var data struct{} - return cm.New[ErrorCode](7, data) -} - -// ConnectionTerminated returns true if [ErrorCode] represents the variant case "connection-terminated". -func (self *ErrorCode) ConnectionTerminated() bool { - return self.Tag() == 7 -} - -// ErrorCodeConnectionTimeout returns a [ErrorCode] of case "connection-timeout". -func ErrorCodeConnectionTimeout() ErrorCode { - var data struct{} - return cm.New[ErrorCode](8, data) -} - -// ConnectionTimeout returns true if [ErrorCode] represents the variant case "connection-timeout". -func (self *ErrorCode) ConnectionTimeout() bool { - return self.Tag() == 8 -} - -// ErrorCodeConnectionReadTimeout returns a [ErrorCode] of case "connection-read-timeout". -func ErrorCodeConnectionReadTimeout() ErrorCode { - var data struct{} - return cm.New[ErrorCode](9, data) -} - -// ConnectionReadTimeout returns true if [ErrorCode] represents the variant case "connection-read-timeout". -func (self *ErrorCode) ConnectionReadTimeout() bool { - return self.Tag() == 9 -} - -// ErrorCodeConnectionWriteTimeout returns a [ErrorCode] of case "connection-write-timeout". -func ErrorCodeConnectionWriteTimeout() ErrorCode { - var data struct{} - return cm.New[ErrorCode](10, data) -} - -// ConnectionWriteTimeout returns true if [ErrorCode] represents the variant case "connection-write-timeout". -func (self *ErrorCode) ConnectionWriteTimeout() bool { - return self.Tag() == 10 -} - -// ErrorCodeConnectionLimitReached returns a [ErrorCode] of case "connection-limit-reached". -func ErrorCodeConnectionLimitReached() ErrorCode { - var data struct{} - return cm.New[ErrorCode](11, data) -} - -// ConnectionLimitReached returns true if [ErrorCode] represents the variant case "connection-limit-reached". -func (self *ErrorCode) ConnectionLimitReached() bool { - return self.Tag() == 11 -} - -// ErrorCodeTLSProtocolError returns a [ErrorCode] of case "TLS-protocol-error". -func ErrorCodeTLSProtocolError() ErrorCode { - var data struct{} - return cm.New[ErrorCode](12, data) -} - -// TLSProtocolError returns true if [ErrorCode] represents the variant case "TLS-protocol-error". -func (self *ErrorCode) TLSProtocolError() bool { - return self.Tag() == 12 -} - -// ErrorCodeTLSCertificateError returns a [ErrorCode] of case "TLS-certificate-error". -func ErrorCodeTLSCertificateError() ErrorCode { - var data struct{} - return cm.New[ErrorCode](13, data) -} - -// TLSCertificateError returns true if [ErrorCode] represents the variant case "TLS-certificate-error". -func (self *ErrorCode) TLSCertificateError() bool { - return self.Tag() == 13 -} - -// ErrorCodeTLSAlertReceived returns a [ErrorCode] of case "TLS-alert-received". -func ErrorCodeTLSAlertReceived(data TLSAlertReceivedPayload) ErrorCode { - return cm.New[ErrorCode](14, data) -} - -// TLSAlertReceived returns a non-nil *[TLSAlertReceivedPayload] if [ErrorCode] represents the variant case "TLS-alert-received". -func (self *ErrorCode) TLSAlertReceived() *TLSAlertReceivedPayload { - return cm.Case[TLSAlertReceivedPayload](self, 14) -} - -// ErrorCodeHTTPRequestDenied returns a [ErrorCode] of case "HTTP-request-denied". -func ErrorCodeHTTPRequestDenied() ErrorCode { - var data struct{} - return cm.New[ErrorCode](15, data) -} - -// HTTPRequestDenied returns true if [ErrorCode] represents the variant case "HTTP-request-denied". -func (self *ErrorCode) HTTPRequestDenied() bool { - return self.Tag() == 15 -} - -// ErrorCodeHTTPRequestLengthRequired returns a [ErrorCode] of case "HTTP-request-length-required". -func ErrorCodeHTTPRequestLengthRequired() ErrorCode { - var data struct{} - return cm.New[ErrorCode](16, data) -} - -// HTTPRequestLengthRequired returns true if [ErrorCode] represents the variant case "HTTP-request-length-required". -func (self *ErrorCode) HTTPRequestLengthRequired() bool { - return self.Tag() == 16 -} - -// ErrorCodeHTTPRequestBodySize returns a [ErrorCode] of case "HTTP-request-body-size". -func ErrorCodeHTTPRequestBodySize(data cm.Option[uint64]) ErrorCode { - return cm.New[ErrorCode](17, data) -} - -// HTTPRequestBodySize returns a non-nil *[cm.Option[uint64]] if [ErrorCode] represents the variant case "HTTP-request-body-size". -func (self *ErrorCode) HTTPRequestBodySize() *cm.Option[uint64] { - return cm.Case[cm.Option[uint64]](self, 17) -} - -// ErrorCodeHTTPRequestMethodInvalid returns a [ErrorCode] of case "HTTP-request-method-invalid". -func ErrorCodeHTTPRequestMethodInvalid() ErrorCode { - var data struct{} - return cm.New[ErrorCode](18, data) -} - -// HTTPRequestMethodInvalid returns true if [ErrorCode] represents the variant case "HTTP-request-method-invalid". -func (self *ErrorCode) HTTPRequestMethodInvalid() bool { - return self.Tag() == 18 -} - -// ErrorCodeHTTPRequestURIInvalid returns a [ErrorCode] of case "HTTP-request-URI-invalid". -func ErrorCodeHTTPRequestURIInvalid() ErrorCode { - var data struct{} - return cm.New[ErrorCode](19, data) -} - -// HTTPRequestURIInvalid returns true if [ErrorCode] represents the variant case "HTTP-request-URI-invalid". -func (self *ErrorCode) HTTPRequestURIInvalid() bool { - return self.Tag() == 19 -} - -// ErrorCodeHTTPRequestURITooLong returns a [ErrorCode] of case "HTTP-request-URI-too-long". -func ErrorCodeHTTPRequestURITooLong() ErrorCode { - var data struct{} - return cm.New[ErrorCode](20, data) -} - -// HTTPRequestURITooLong returns true if [ErrorCode] represents the variant case "HTTP-request-URI-too-long". -func (self *ErrorCode) HTTPRequestURITooLong() bool { - return self.Tag() == 20 -} - -// ErrorCodeHTTPRequestHeaderSectionSize returns a [ErrorCode] of case "HTTP-request-header-section-size". -func ErrorCodeHTTPRequestHeaderSectionSize(data cm.Option[uint32]) ErrorCode { - return cm.New[ErrorCode](21, data) -} - -// HTTPRequestHeaderSectionSize returns a non-nil *[cm.Option[uint32]] if [ErrorCode] represents the variant case "HTTP-request-header-section-size". -func (self *ErrorCode) HTTPRequestHeaderSectionSize() *cm.Option[uint32] { - return cm.Case[cm.Option[uint32]](self, 21) -} - -// ErrorCodeHTTPRequestHeaderSize returns a [ErrorCode] of case "HTTP-request-header-size". -func ErrorCodeHTTPRequestHeaderSize(data cm.Option[FieldSizePayload]) ErrorCode { - return cm.New[ErrorCode](22, data) -} - -// HTTPRequestHeaderSize returns a non-nil *[cm.Option[FieldSizePayload]] if [ErrorCode] represents the variant case "HTTP-request-header-size". -func (self *ErrorCode) HTTPRequestHeaderSize() *cm.Option[FieldSizePayload] { - return cm.Case[cm.Option[FieldSizePayload]](self, 22) -} - -// ErrorCodeHTTPRequestTrailerSectionSize returns a [ErrorCode] of case "HTTP-request-trailer-section-size". -func ErrorCodeHTTPRequestTrailerSectionSize(data cm.Option[uint32]) ErrorCode { - return cm.New[ErrorCode](23, data) -} - -// HTTPRequestTrailerSectionSize returns a non-nil *[cm.Option[uint32]] if [ErrorCode] represents the variant case "HTTP-request-trailer-section-size". -func (self *ErrorCode) HTTPRequestTrailerSectionSize() *cm.Option[uint32] { - return cm.Case[cm.Option[uint32]](self, 23) -} - -// ErrorCodeHTTPRequestTrailerSize returns a [ErrorCode] of case "HTTP-request-trailer-size". -func ErrorCodeHTTPRequestTrailerSize(data FieldSizePayload) ErrorCode { - return cm.New[ErrorCode](24, data) -} - -// HTTPRequestTrailerSize returns a non-nil *[FieldSizePayload] if [ErrorCode] represents the variant case "HTTP-request-trailer-size". -func (self *ErrorCode) HTTPRequestTrailerSize() *FieldSizePayload { - return cm.Case[FieldSizePayload](self, 24) -} - -// ErrorCodeHTTPResponseIncomplete returns a [ErrorCode] of case "HTTP-response-incomplete". -func ErrorCodeHTTPResponseIncomplete() ErrorCode { - var data struct{} - return cm.New[ErrorCode](25, data) -} - -// HTTPResponseIncomplete returns true if [ErrorCode] represents the variant case "HTTP-response-incomplete". -func (self *ErrorCode) HTTPResponseIncomplete() bool { - return self.Tag() == 25 -} - -// ErrorCodeHTTPResponseHeaderSectionSize returns a [ErrorCode] of case "HTTP-response-header-section-size". -func ErrorCodeHTTPResponseHeaderSectionSize(data cm.Option[uint32]) ErrorCode { - return cm.New[ErrorCode](26, data) -} - -// HTTPResponseHeaderSectionSize returns a non-nil *[cm.Option[uint32]] if [ErrorCode] represents the variant case "HTTP-response-header-section-size". -func (self *ErrorCode) HTTPResponseHeaderSectionSize() *cm.Option[uint32] { - return cm.Case[cm.Option[uint32]](self, 26) -} - -// ErrorCodeHTTPResponseHeaderSize returns a [ErrorCode] of case "HTTP-response-header-size". -func ErrorCodeHTTPResponseHeaderSize(data FieldSizePayload) ErrorCode { - return cm.New[ErrorCode](27, data) -} - -// HTTPResponseHeaderSize returns a non-nil *[FieldSizePayload] if [ErrorCode] represents the variant case "HTTP-response-header-size". -func (self *ErrorCode) HTTPResponseHeaderSize() *FieldSizePayload { - return cm.Case[FieldSizePayload](self, 27) -} - -// ErrorCodeHTTPResponseBodySize returns a [ErrorCode] of case "HTTP-response-body-size". -func ErrorCodeHTTPResponseBodySize(data cm.Option[uint64]) ErrorCode { - return cm.New[ErrorCode](28, data) -} - -// HTTPResponseBodySize returns a non-nil *[cm.Option[uint64]] if [ErrorCode] represents the variant case "HTTP-response-body-size". -func (self *ErrorCode) HTTPResponseBodySize() *cm.Option[uint64] { - return cm.Case[cm.Option[uint64]](self, 28) -} - -// ErrorCodeHTTPResponseTrailerSectionSize returns a [ErrorCode] of case "HTTP-response-trailer-section-size". -func ErrorCodeHTTPResponseTrailerSectionSize(data cm.Option[uint32]) ErrorCode { - return cm.New[ErrorCode](29, data) -} - -// HTTPResponseTrailerSectionSize returns a non-nil *[cm.Option[uint32]] if [ErrorCode] represents the variant case "HTTP-response-trailer-section-size". -func (self *ErrorCode) HTTPResponseTrailerSectionSize() *cm.Option[uint32] { - return cm.Case[cm.Option[uint32]](self, 29) -} - -// ErrorCodeHTTPResponseTrailerSize returns a [ErrorCode] of case "HTTP-response-trailer-size". -func ErrorCodeHTTPResponseTrailerSize(data FieldSizePayload) ErrorCode { - return cm.New[ErrorCode](30, data) -} - -// HTTPResponseTrailerSize returns a non-nil *[FieldSizePayload] if [ErrorCode] represents the variant case "HTTP-response-trailer-size". -func (self *ErrorCode) HTTPResponseTrailerSize() *FieldSizePayload { - return cm.Case[FieldSizePayload](self, 30) -} - -// ErrorCodeHTTPResponseTransferCoding returns a [ErrorCode] of case "HTTP-response-transfer-coding". -func ErrorCodeHTTPResponseTransferCoding(data cm.Option[string]) ErrorCode { - return cm.New[ErrorCode](31, data) -} - -// HTTPResponseTransferCoding returns a non-nil *[cm.Option[string]] if [ErrorCode] represents the variant case "HTTP-response-transfer-coding". -func (self *ErrorCode) HTTPResponseTransferCoding() *cm.Option[string] { - return cm.Case[cm.Option[string]](self, 31) -} - -// ErrorCodeHTTPResponseContentCoding returns a [ErrorCode] of case "HTTP-response-content-coding". -func ErrorCodeHTTPResponseContentCoding(data cm.Option[string]) ErrorCode { - return cm.New[ErrorCode](32, data) -} - -// HTTPResponseContentCoding returns a non-nil *[cm.Option[string]] if [ErrorCode] represents the variant case "HTTP-response-content-coding". -func (self *ErrorCode) HTTPResponseContentCoding() *cm.Option[string] { - return cm.Case[cm.Option[string]](self, 32) -} - -// ErrorCodeHTTPResponseTimeout returns a [ErrorCode] of case "HTTP-response-timeout". -func ErrorCodeHTTPResponseTimeout() ErrorCode { - var data struct{} - return cm.New[ErrorCode](33, data) -} - -// HTTPResponseTimeout returns true if [ErrorCode] represents the variant case "HTTP-response-timeout". -func (self *ErrorCode) HTTPResponseTimeout() bool { - return self.Tag() == 33 -} - -// ErrorCodeHTTPUpgradeFailed returns a [ErrorCode] of case "HTTP-upgrade-failed". -func ErrorCodeHTTPUpgradeFailed() ErrorCode { - var data struct{} - return cm.New[ErrorCode](34, data) -} - -// HTTPUpgradeFailed returns true if [ErrorCode] represents the variant case "HTTP-upgrade-failed". -func (self *ErrorCode) HTTPUpgradeFailed() bool { - return self.Tag() == 34 -} - -// ErrorCodeHTTPProtocolError returns a [ErrorCode] of case "HTTP-protocol-error". -func ErrorCodeHTTPProtocolError() ErrorCode { - var data struct{} - return cm.New[ErrorCode](35, data) -} - -// HTTPProtocolError returns true if [ErrorCode] represents the variant case "HTTP-protocol-error". -func (self *ErrorCode) HTTPProtocolError() bool { - return self.Tag() == 35 -} - -// ErrorCodeLoopDetected returns a [ErrorCode] of case "loop-detected". -func ErrorCodeLoopDetected() ErrorCode { - var data struct{} - return cm.New[ErrorCode](36, data) -} - -// LoopDetected returns true if [ErrorCode] represents the variant case "loop-detected". -func (self *ErrorCode) LoopDetected() bool { - return self.Tag() == 36 -} - -// ErrorCodeConfigurationError returns a [ErrorCode] of case "configuration-error". -func ErrorCodeConfigurationError() ErrorCode { - var data struct{} - return cm.New[ErrorCode](37, data) -} - -// ConfigurationError returns true if [ErrorCode] represents the variant case "configuration-error". -func (self *ErrorCode) ConfigurationError() bool { - return self.Tag() == 37 -} - -// ErrorCodeInternalError returns a [ErrorCode] of case "internal-error". -func ErrorCodeInternalError(data cm.Option[string]) ErrorCode { - return cm.New[ErrorCode](38, data) -} - -// InternalError returns a non-nil *[cm.Option[string]] if [ErrorCode] represents the variant case "internal-error". -func (self *ErrorCode) InternalError() *cm.Option[string] { - return cm.Case[cm.Option[string]](self, 38) -} - -var stringsErrorCode = [39]string{ - "DNS-timeout", - "DNS-error", - "destination-not-found", - "destination-unavailable", - "destination-IP-prohibited", - "destination-IP-unroutable", - "connection-refused", - "connection-terminated", - "connection-timeout", - "connection-read-timeout", - "connection-write-timeout", - "connection-limit-reached", - "TLS-protocol-error", - "TLS-certificate-error", - "TLS-alert-received", - "HTTP-request-denied", - "HTTP-request-length-required", - "HTTP-request-body-size", - "HTTP-request-method-invalid", - "HTTP-request-URI-invalid", - "HTTP-request-URI-too-long", - "HTTP-request-header-section-size", - "HTTP-request-header-size", - "HTTP-request-trailer-section-size", - "HTTP-request-trailer-size", - "HTTP-response-incomplete", - "HTTP-response-header-section-size", - "HTTP-response-header-size", - "HTTP-response-body-size", - "HTTP-response-trailer-section-size", - "HTTP-response-trailer-size", - "HTTP-response-transfer-coding", - "HTTP-response-content-coding", - "HTTP-response-timeout", - "HTTP-upgrade-failed", - "HTTP-protocol-error", - "loop-detected", - "configuration-error", - "internal-error", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v ErrorCode) String() string { - return stringsErrorCode[v.Tag()] -} - -// HeaderError represents the variant "wasi:http/types@0.2.0#header-error". -// -// variant header-error { -// invalid-syntax, -// forbidden, -// immutable, -// } -type HeaderError uint8 - -const ( - HeaderErrorInvalidSyntax HeaderError = iota - HeaderErrorForbidden - HeaderErrorImmutable -) - -var stringsHeaderError = [3]string{ - "invalid-syntax", - "forbidden", - "immutable", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e HeaderError) String() string { - return stringsHeaderError[e] -} - -// FieldKey represents the string "wasi:http/types@0.2.0#field-key". -// -// type field-key = string -type FieldKey string - -// FieldValue represents the list "wasi:http/types@0.2.0#field-value". -// -// type field-value = list -type FieldValue cm.List[uint8] - -// Fields represents the imported resource "wasi:http/types@0.2.0#fields". -// -// resource fields -type Fields cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "fields". -// -// Drops a resource handle. -// -//go:nosplit -func (self Fields) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FieldsResourceDrop((uint32)(self0)) - return -} - -// NewFields represents the imported constructor for resource "fields". -// -// constructor() -// -//go:nosplit -func NewFields() (result Fields) { - result0 := wasmimport_NewFields() - result = cm.Reinterpret[Fields]((uint32)(result0)) - return -} - -// FieldsFromList represents the imported static function "from-list". -// -// from-list: static func(entries: list>) -> result -// -//go:nosplit -func FieldsFromList(entries cm.List[cm.Tuple[FieldKey, FieldValue]]) (result cm.Result[Fields, Fields, HeaderError]) { - entries0, entries1 := cm.LowerList(entries) - wasmimport_FieldsFromList((*cm.Tuple[FieldKey, FieldValue])(entries0), (uint32)(entries1), &result) - return -} - -// Append represents the imported method "append". -// -// append: func(name: field-key, value: field-value) -> result<_, header-error> -// -//go:nosplit -func (self Fields) Append(name FieldKey, value FieldValue) (result cm.Result[HeaderError, struct{}, HeaderError]) { - self0 := cm.Reinterpret[uint32](self) - name0, name1 := cm.LowerString(name) - value0, value1 := cm.LowerList(value) - wasmimport_FieldsAppend((uint32)(self0), (*uint8)(name0), (uint32)(name1), (*uint8)(value0), (uint32)(value1), &result) - return -} - -// Clone represents the imported method "clone". -// -// clone: func() -> fields -// -//go:nosplit -func (self Fields) Clone() (result Fields) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_FieldsClone((uint32)(self0)) - result = cm.Reinterpret[Fields]((uint32)(result0)) - return -} - -// Delete represents the imported method "delete". -// -// delete: func(name: field-key) -> result<_, header-error> -// -//go:nosplit -func (self Fields) Delete(name FieldKey) (result cm.Result[HeaderError, struct{}, HeaderError]) { - self0 := cm.Reinterpret[uint32](self) - name0, name1 := cm.LowerString(name) - wasmimport_FieldsDelete((uint32)(self0), (*uint8)(name0), (uint32)(name1), &result) - return -} - -// Entries represents the imported method "entries". -// -// entries: func() -> list> -// -//go:nosplit -func (self Fields) Entries() (result cm.List[cm.Tuple[FieldKey, FieldValue]]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FieldsEntries((uint32)(self0), &result) - return -} - -// Get represents the imported method "get". -// -// get: func(name: field-key) -> list -// -//go:nosplit -func (self Fields) Get(name FieldKey) (result cm.List[FieldValue]) { - self0 := cm.Reinterpret[uint32](self) - name0, name1 := cm.LowerString(name) - wasmimport_FieldsGet((uint32)(self0), (*uint8)(name0), (uint32)(name1), &result) - return -} - -// Has represents the imported method "has". -// -// has: func(name: field-key) -> bool -// -//go:nosplit -func (self Fields) Has(name FieldKey) (result bool) { - self0 := cm.Reinterpret[uint32](self) - name0, name1 := cm.LowerString(name) - result0 := wasmimport_FieldsHas((uint32)(self0), (*uint8)(name0), (uint32)(name1)) - result = (bool)(cm.U32ToBool((uint32)(result0))) - return -} - -// Set represents the imported method "set". -// -// set: func(name: field-key, value: list) -> result<_, header-error> -// -//go:nosplit -func (self Fields) Set(name FieldKey, value cm.List[FieldValue]) (result cm.Result[HeaderError, struct{}, HeaderError]) { - self0 := cm.Reinterpret[uint32](self) - name0, name1 := cm.LowerString(name) - value0, value1 := cm.LowerList(value) - wasmimport_FieldsSet((uint32)(self0), (*uint8)(name0), (uint32)(name1), (*FieldValue)(value0), (uint32)(value1), &result) - return -} - -// Headers represents the imported type alias "wasi:http/types@0.2.0#headers". -// -// See [Fields] for more information. -type Headers = Fields - -// Trailers represents the imported type alias "wasi:http/types@0.2.0#trailers". -// -// See [Fields] for more information. -type Trailers = Fields - -// IncomingRequest represents the imported resource "wasi:http/types@0.2.0#incoming-request". -// -// resource incoming-request -type IncomingRequest cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "incoming-request". -// -// Drops a resource handle. -// -//go:nosplit -func (self IncomingRequest) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestResourceDrop((uint32)(self0)) - return -} - -// Authority represents the imported method "authority". -// -// authority: func() -> option -// -//go:nosplit -func (self IncomingRequest) Authority() (result cm.Option[string]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestAuthority((uint32)(self0), &result) - return -} - -// Consume represents the imported method "consume". -// -// consume: func() -> result -// -//go:nosplit -func (self IncomingRequest) Consume() (result cm.Result[IncomingBody, IncomingBody, struct{}]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestConsume((uint32)(self0), &result) - return -} - -// Headers represents the imported method "headers". -// -// headers: func() -> headers -// -//go:nosplit -func (self IncomingRequest) Headers() (result Headers) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_IncomingRequestHeaders((uint32)(self0)) - result = cm.Reinterpret[Headers]((uint32)(result0)) - return -} - -// Method represents the imported method "method". -// -// method: func() -> method -// -//go:nosplit -func (self IncomingRequest) Method() (result Method) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestMethod((uint32)(self0), &result) - return -} - -// PathWithQuery represents the imported method "path-with-query". -// -// path-with-query: func() -> option -// -//go:nosplit -func (self IncomingRequest) PathWithQuery() (result cm.Option[string]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestPathWithQuery((uint32)(self0), &result) - return -} - -// Scheme represents the imported method "scheme". -// -// scheme: func() -> option -// -//go:nosplit -func (self IncomingRequest) Scheme() (result cm.Option[Scheme]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestScheme((uint32)(self0), &result) - return -} - -// OutgoingRequest represents the imported resource "wasi:http/types@0.2.0#outgoing-request". -// -// resource outgoing-request -type OutgoingRequest cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "outgoing-request". -// -// Drops a resource handle. -// -//go:nosplit -func (self OutgoingRequest) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestResourceDrop((uint32)(self0)) - return -} - -// NewOutgoingRequest represents the imported constructor for resource "outgoing-request". -// -// constructor(headers: headers) -// -//go:nosplit -func NewOutgoingRequest(headers Headers) (result OutgoingRequest) { - headers0 := cm.Reinterpret[uint32](headers) - result0 := wasmimport_NewOutgoingRequest((uint32)(headers0)) - result = cm.Reinterpret[OutgoingRequest]((uint32)(result0)) - return -} - -// Authority represents the imported method "authority". -// -// authority: func() -> option -// -//go:nosplit -func (self OutgoingRequest) Authority() (result cm.Option[string]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestAuthority((uint32)(self0), &result) - return -} - -// Body represents the imported method "body". -// -// body: func() -> result -// -//go:nosplit -func (self OutgoingRequest) Body() (result cm.Result[OutgoingBody, OutgoingBody, struct{}]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestBody((uint32)(self0), &result) - return -} - -// Headers represents the imported method "headers". -// -// headers: func() -> headers -// -//go:nosplit -func (self OutgoingRequest) Headers() (result Headers) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutgoingRequestHeaders((uint32)(self0)) - result = cm.Reinterpret[Headers]((uint32)(result0)) - return -} - -// Method represents the imported method "method". -// -// method: func() -> method -// -//go:nosplit -func (self OutgoingRequest) Method() (result Method) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestMethod((uint32)(self0), &result) - return -} - -// PathWithQuery represents the imported method "path-with-query". -// -// path-with-query: func() -> option -// -//go:nosplit -func (self OutgoingRequest) PathWithQuery() (result cm.Option[string]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestPathWithQuery((uint32)(self0), &result) - return -} - -// Scheme represents the imported method "scheme". -// -// scheme: func() -> option -// -//go:nosplit -func (self OutgoingRequest) Scheme() (result cm.Option[Scheme]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestScheme((uint32)(self0), &result) - return -} - -// SetAuthority represents the imported method "set-authority". -// -// set-authority: func(authority: option) -> result -// -//go:nosplit -func (self OutgoingRequest) SetAuthority(authority cm.Option[string]) (result cm.BoolResult) { - self0 := cm.Reinterpret[uint32](self) - authority0, authority1, authority2 := lower_OptionString(authority) - result0 := wasmimport_OutgoingRequestSetAuthority((uint32)(self0), (uint32)(authority0), (*uint8)(authority1), (uint32)(authority2)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) - return -} - -// SetMethod represents the imported method "set-method". -// -// set-method: func(method: method) -> result -// -//go:nosplit -func (self OutgoingRequest) SetMethod(method Method) (result cm.BoolResult) { - self0 := cm.Reinterpret[uint32](self) - method0, method1, method2 := lower_Method(method) - result0 := wasmimport_OutgoingRequestSetMethod((uint32)(self0), (uint32)(method0), (*uint8)(method1), (uint32)(method2)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) - return -} - -// SetPathWithQuery represents the imported method "set-path-with-query". -// -// set-path-with-query: func(path-with-query: option) -> result -// -//go:nosplit -func (self OutgoingRequest) SetPathWithQuery(pathWithQuery cm.Option[string]) (result cm.BoolResult) { - self0 := cm.Reinterpret[uint32](self) - pathWithQuery0, pathWithQuery1, pathWithQuery2 := lower_OptionString(pathWithQuery) - result0 := wasmimport_OutgoingRequestSetPathWithQuery((uint32)(self0), (uint32)(pathWithQuery0), (*uint8)(pathWithQuery1), (uint32)(pathWithQuery2)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) - return -} - -// SetScheme represents the imported method "set-scheme". -// -// set-scheme: func(scheme: option) -> result -// -//go:nosplit -func (self OutgoingRequest) SetScheme(scheme cm.Option[Scheme]) (result cm.BoolResult) { - self0 := cm.Reinterpret[uint32](self) - scheme0, scheme1, scheme2, scheme3 := lower_OptionScheme(scheme) - result0 := wasmimport_OutgoingRequestSetScheme((uint32)(self0), (uint32)(scheme0), (uint32)(scheme1), (*uint8)(scheme2), (uint32)(scheme3)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) - return -} - -// RequestOptions represents the imported resource "wasi:http/types@0.2.0#request-options". -// -// resource request-options -type RequestOptions cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "request-options". -// -// Drops a resource handle. -// -//go:nosplit -func (self RequestOptions) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsResourceDrop((uint32)(self0)) - return -} - -// NewRequestOptions represents the imported constructor for resource "request-options". -// -// constructor() -// -//go:nosplit -func NewRequestOptions() (result RequestOptions) { - result0 := wasmimport_NewRequestOptions() - result = cm.Reinterpret[RequestOptions]((uint32)(result0)) - return -} - -// BetweenBytesTimeout represents the imported method "between-bytes-timeout". -// -// between-bytes-timeout: func() -> option -// -//go:nosplit -func (self RequestOptions) BetweenBytesTimeout() (result cm.Option[Duration]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsBetweenBytesTimeout((uint32)(self0), &result) - return -} - -// ConnectTimeout represents the imported method "connect-timeout". -// -// connect-timeout: func() -> option -// -//go:nosplit -func (self RequestOptions) ConnectTimeout() (result cm.Option[Duration]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsConnectTimeout((uint32)(self0), &result) - return -} - -// FirstByteTimeout represents the imported method "first-byte-timeout". -// -// first-byte-timeout: func() -> option -// -//go:nosplit -func (self RequestOptions) FirstByteTimeout() (result cm.Option[Duration]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsFirstByteTimeout((uint32)(self0), &result) - return -} - -// SetBetweenBytesTimeout represents the imported method "set-between-bytes-timeout". -// -// set-between-bytes-timeout: func(duration: option) -> result -// -//go:nosplit -func (self RequestOptions) SetBetweenBytesTimeout(duration cm.Option[Duration]) (result cm.BoolResult) { - self0 := cm.Reinterpret[uint32](self) - duration0, duration1 := lower_OptionDuration(duration) - result0 := wasmimport_RequestOptionsSetBetweenBytesTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) - return -} - -// SetConnectTimeout represents the imported method "set-connect-timeout". -// -// set-connect-timeout: func(duration: option) -> result -// -//go:nosplit -func (self RequestOptions) SetConnectTimeout(duration cm.Option[Duration]) (result cm.BoolResult) { - self0 := cm.Reinterpret[uint32](self) - duration0, duration1 := lower_OptionDuration(duration) - result0 := wasmimport_RequestOptionsSetConnectTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) - return -} - -// SetFirstByteTimeout represents the imported method "set-first-byte-timeout". -// -// set-first-byte-timeout: func(duration: option) -> result -// -//go:nosplit -func (self RequestOptions) SetFirstByteTimeout(duration cm.Option[Duration]) (result cm.BoolResult) { - self0 := cm.Reinterpret[uint32](self) - duration0, duration1 := lower_OptionDuration(duration) - result0 := wasmimport_RequestOptionsSetFirstByteTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) - return -} - -// ResponseOutparam represents the imported resource "wasi:http/types@0.2.0#response-outparam". -// -// resource response-outparam -type ResponseOutparam cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "response-outparam". -// -// Drops a resource handle. -// -//go:nosplit -func (self ResponseOutparam) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_ResponseOutparamResourceDrop((uint32)(self0)) - return -} - -// ResponseOutparamSet represents the imported static function "set". -// -// set: static func(param: response-outparam, response: result) -// -//go:nosplit -func ResponseOutparamSet(param ResponseOutparam, response cm.Result[ErrorCodeShape, OutgoingResponse, ErrorCode]) { - param0 := cm.Reinterpret[uint32](param) - response0, response1, response2, response3, response4, response5, response6, response7 := lower_ResultOutgoingResponseErrorCode(response) - wasmimport_ResponseOutparamSet((uint32)(param0), (uint32)(response0), (uint32)(response1), (uint32)(response2), (uint64)(response3), (uint32)(response4), (uint32)(response5), (uint32)(response6), (uint32)(response7)) - return -} - -// StatusCode represents the u16 "wasi:http/types@0.2.0#status-code". -// -// type status-code = u16 -type StatusCode uint16 - -// IncomingResponse represents the imported resource "wasi:http/types@0.2.0#incoming-response". -// -// resource incoming-response -type IncomingResponse cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "incoming-response". -// -// Drops a resource handle. -// -//go:nosplit -func (self IncomingResponse) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingResponseResourceDrop((uint32)(self0)) - return -} - -// Consume represents the imported method "consume". -// -// consume: func() -> result -// -//go:nosplit -func (self IncomingResponse) Consume() (result cm.Result[IncomingBody, IncomingBody, struct{}]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingResponseConsume((uint32)(self0), &result) - return -} - -// Headers represents the imported method "headers". -// -// headers: func() -> headers -// -//go:nosplit -func (self IncomingResponse) Headers() (result Headers) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_IncomingResponseHeaders((uint32)(self0)) - result = cm.Reinterpret[Headers]((uint32)(result0)) - return -} - -// Status represents the imported method "status". -// -// status: func() -> status-code -// -//go:nosplit -func (self IncomingResponse) Status() (result StatusCode) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_IncomingResponseStatus((uint32)(self0)) - result = (StatusCode)((uint32)(result0)) - return -} - -// IncomingBody represents the imported resource "wasi:http/types@0.2.0#incoming-body". -// -// resource incoming-body -type IncomingBody cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "incoming-body". -// -// Drops a resource handle. -// -//go:nosplit -func (self IncomingBody) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingBodyResourceDrop((uint32)(self0)) - return -} - -// IncomingBodyFinish represents the imported static function "finish". -// -// finish: static func(this: incoming-body) -> future-trailers -// -//go:nosplit -func IncomingBodyFinish(this IncomingBody) (result FutureTrailers) { - this0 := cm.Reinterpret[uint32](this) - result0 := wasmimport_IncomingBodyFinish((uint32)(this0)) - result = cm.Reinterpret[FutureTrailers]((uint32)(result0)) - return -} - -// Stream represents the imported method "stream". -// -// %stream: func() -> result -// -//go:nosplit -func (self IncomingBody) Stream() (result cm.Result[InputStream, InputStream, struct{}]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingBodyStream((uint32)(self0), &result) - return -} - -// FutureTrailers represents the imported resource "wasi:http/types@0.2.0#future-trailers". -// -// resource future-trailers -type FutureTrailers cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "future-trailers". -// -// Drops a resource handle. -// -//go:nosplit -func (self FutureTrailers) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureTrailersResourceDrop((uint32)(self0)) - return -} - -// Get represents the imported method "get". -// -// get: func() -> option, error-code>>> -// -//go:nosplit -func (self FutureTrailers) Get() (result cm.Option[cm.Result[cm.Result[ErrorCodeShape, cm.Option[Trailers], ErrorCode], cm.Result[ErrorCodeShape, cm.Option[Trailers], ErrorCode], struct{}]]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureTrailersGet((uint32)(self0), &result) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -> pollable -// -//go:nosplit -func (self FutureTrailers) Subscribe() (result Pollable) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_FutureTrailersSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) - return -} - -// OutgoingResponse represents the imported resource "wasi:http/types@0.2.0#outgoing-response". -// -// resource outgoing-response -type OutgoingResponse cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "outgoing-response". -// -// Drops a resource handle. -// -//go:nosplit -func (self OutgoingResponse) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingResponseResourceDrop((uint32)(self0)) - return -} - -// NewOutgoingResponse represents the imported constructor for resource "outgoing-response". -// -// constructor(headers: headers) -// -//go:nosplit -func NewOutgoingResponse(headers Headers) (result OutgoingResponse) { - headers0 := cm.Reinterpret[uint32](headers) - result0 := wasmimport_NewOutgoingResponse((uint32)(headers0)) - result = cm.Reinterpret[OutgoingResponse]((uint32)(result0)) - return -} - -// Body represents the imported method "body". -// -// body: func() -> result -// -//go:nosplit -func (self OutgoingResponse) Body() (result cm.Result[OutgoingBody, OutgoingBody, struct{}]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingResponseBody((uint32)(self0), &result) - return -} - -// Headers represents the imported method "headers". -// -// headers: func() -> headers -// -//go:nosplit -func (self OutgoingResponse) Headers() (result Headers) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutgoingResponseHeaders((uint32)(self0)) - result = cm.Reinterpret[Headers]((uint32)(result0)) - return -} - -// SetStatusCode represents the imported method "set-status-code". -// -// set-status-code: func(status-code: status-code) -> result -// -//go:nosplit -func (self OutgoingResponse) SetStatusCode(statusCode StatusCode) (result cm.BoolResult) { - self0 := cm.Reinterpret[uint32](self) - statusCode0 := (uint32)(statusCode) - result0 := wasmimport_OutgoingResponseSetStatusCode((uint32)(self0), (uint32)(statusCode0)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) - return -} - -// StatusCode represents the imported method "status-code". -// -// status-code: func() -> status-code -// -//go:nosplit -func (self OutgoingResponse) StatusCode() (result StatusCode) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutgoingResponseStatusCode((uint32)(self0)) - result = (StatusCode)((uint32)(result0)) - return -} - -// OutgoingBody represents the imported resource "wasi:http/types@0.2.0#outgoing-body". -// -// resource outgoing-body -type OutgoingBody cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "outgoing-body". -// -// Drops a resource handle. -// -//go:nosplit -func (self OutgoingBody) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingBodyResourceDrop((uint32)(self0)) - return -} - -// OutgoingBodyFinish represents the imported static function "finish". -// -// finish: static func(this: outgoing-body, trailers: option) -> result<_, -// error-code> -// -//go:nosplit -func OutgoingBodyFinish(this OutgoingBody, trailers cm.Option[Trailers]) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - this0 := cm.Reinterpret[uint32](this) - trailers0, trailers1 := lower_OptionTrailers(trailers) - wasmimport_OutgoingBodyFinish((uint32)(this0), (uint32)(trailers0), (uint32)(trailers1), &result) - return -} - -// Write represents the imported method "write". -// -// write: func() -> result -// -//go:nosplit -func (self OutgoingBody) Write() (result cm.Result[OutputStream, OutputStream, struct{}]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingBodyWrite((uint32)(self0), &result) - return -} - -// FutureIncomingResponse represents the imported resource "wasi:http/types@0.2.0#future-incoming-response". -// -// resource future-incoming-response -type FutureIncomingResponse cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "future-incoming-response". -// -// Drops a resource handle. -// -//go:nosplit -func (self FutureIncomingResponse) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureIncomingResponseResourceDrop((uint32)(self0)) - return -} - -// Get represents the imported method "get". -// -// get: func() -> option>> -// -//go:nosplit -func (self FutureIncomingResponse) Get() (result cm.Option[cm.Result[cm.Result[ErrorCodeShape, IncomingResponse, ErrorCode], cm.Result[ErrorCodeShape, IncomingResponse, ErrorCode], struct{}]]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureIncomingResponseGet((uint32)(self0), &result) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -> pollable -// -//go:nosplit -func (self FutureIncomingResponse) Subscribe() (result Pollable) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_FutureIncomingResponseSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) - return -} - -// HTTPErrorCode represents the imported function "http-error-code". -// -// http-error-code: func(err: borrow) -> option -// -//go:nosplit -func HTTPErrorCode(err IOError) (result cm.Option[ErrorCode]) { - err0 := cm.Reinterpret[uint32](err) - wasmimport_HTTPErrorCode((uint32)(err0), &result) - return -} diff --git a/examples/component/invoke/gen/wasi/io/error/empty.s b/examples/component/invoke/gen/wasi/io/error/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/io/error/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/io/error/error.wit.go b/examples/component/invoke/gen/wasi/io/error/error.wit.go deleted file mode 100644 index 828e977e..00000000 --- a/examples/component/invoke/gen/wasi/io/error/error.wit.go +++ /dev/null @@ -1,35 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package ioerror represents the imported interface "wasi:io/error@0.2.0". -package ioerror - -import ( - "go.bytecodealliance.org/cm" -) - -// Error represents the imported resource "wasi:io/error@0.2.0#error". -// -// resource error -type Error cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "error". -// -// Drops a resource handle. -// -//go:nosplit -func (self Error) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_ErrorResourceDrop((uint32)(self0)) - return -} - -// ToDebugString represents the imported method "to-debug-string". -// -// to-debug-string: func() -> string -// -//go:nosplit -func (self Error) ToDebugString() (result string) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_ErrorToDebugString((uint32)(self0), &result) - return -} diff --git a/examples/component/invoke/gen/wasi/io/error/ioerror.wasm.go b/examples/component/invoke/gen/wasi/io/error/ioerror.wasm.go deleted file mode 100755 index e254b5d8..00000000 --- a/examples/component/invoke/gen/wasi/io/error/ioerror.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package ioerror - -// This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". - -//go:wasmimport wasi:io/error@0.2.0 [resource-drop]error -//go:noescape -func wasmimport_ErrorResourceDrop(self0 uint32) - -//go:wasmimport wasi:io/error@0.2.0 [method]error.to-debug-string -//go:noescape -func wasmimport_ErrorToDebugString(self0 uint32, result *string) diff --git a/examples/component/invoke/gen/wasi/io/poll/empty.s b/examples/component/invoke/gen/wasi/io/poll/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/io/poll/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/io/poll/poll.wasm.go b/examples/component/invoke/gen/wasi/io/poll/poll.wasm.go deleted file mode 100755 index f7c55c3d..00000000 --- a/examples/component/invoke/gen/wasi/io/poll/poll.wasm.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package poll - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". - -//go:wasmimport wasi:io/poll@0.2.0 [resource-drop]pollable -//go:noescape -func wasmimport_PollableResourceDrop(self0 uint32) - -//go:wasmimport wasi:io/poll@0.2.0 [method]pollable.block -//go:noescape -func wasmimport_PollableBlock(self0 uint32) - -//go:wasmimport wasi:io/poll@0.2.0 [method]pollable.ready -//go:noescape -func wasmimport_PollableReady(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:io/poll@0.2.0 poll -//go:noescape -func wasmimport_Poll(in0 *Pollable, in1 uint32, result *cm.List[uint32]) diff --git a/examples/component/invoke/gen/wasi/io/poll/poll.wit.go b/examples/component/invoke/gen/wasi/io/poll/poll.wit.go deleted file mode 100644 index ad9e9564..00000000 --- a/examples/component/invoke/gen/wasi/io/poll/poll.wit.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package poll represents the imported interface "wasi:io/poll@0.2.0". -package poll - -import ( - "go.bytecodealliance.org/cm" -) - -// Pollable represents the imported resource "wasi:io/poll@0.2.0#pollable". -// -// resource pollable -type Pollable cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "pollable". -// -// Drops a resource handle. -// -//go:nosplit -func (self Pollable) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_PollableResourceDrop((uint32)(self0)) - return -} - -// Block represents the imported method "block". -// -// block: func() -// -//go:nosplit -func (self Pollable) Block() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_PollableBlock((uint32)(self0)) - return -} - -// Ready represents the imported method "ready". -// -// ready: func() -> bool -// -//go:nosplit -func (self Pollable) Ready() (result bool) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_PollableReady((uint32)(self0)) - result = (bool)(cm.U32ToBool((uint32)(result0))) - return -} - -// Poll represents the imported function "poll". -// -// poll: func(in: list>) -> list -// -//go:nosplit -func Poll(in cm.List[Pollable]) (result cm.List[uint32]) { - in0, in1 := cm.LowerList(in) - wasmimport_Poll((*Pollable)(in0), (uint32)(in1), &result) - return -} diff --git a/examples/component/invoke/gen/wasi/io/streams/abi.go b/examples/component/invoke/gen/wasi/io/streams/abi.go deleted file mode 100644 index 5f150028..00000000 --- a/examples/component/invoke/gen/wasi/io/streams/abi.go +++ /dev/null @@ -1,12 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package streams - -import ( - "unsafe" -) - -// StreamErrorShape is used for storage in variant or result types. -type StreamErrorShape struct { - shape [unsafe.Sizeof(StreamError{})]byte -} diff --git a/examples/component/invoke/gen/wasi/io/streams/empty.s b/examples/component/invoke/gen/wasi/io/streams/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/io/streams/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/io/streams/streams.wasm.go b/examples/component/invoke/gen/wasi/io/streams/streams.wasm.go deleted file mode 100755 index eec56645..00000000 --- a/examples/component/invoke/gen/wasi/io/streams/streams.wasm.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package streams - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". - -//go:wasmimport wasi:io/streams@0.2.0 [resource-drop]input-stream -//go:noescape -func wasmimport_InputStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.blocking-read -//go:noescape -func wasmimport_InputStreamBlockingRead(self0 uint32, len0 uint64, result *cm.Result[cm.List[uint8], cm.List[uint8], StreamError]) - -//go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.blocking-skip -//go:noescape -func wasmimport_InputStreamBlockingSkip(self0 uint32, len0 uint64, result *cm.Result[uint64, uint64, StreamError]) - -//go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.read -//go:noescape -func wasmimport_InputStreamRead(self0 uint32, len0 uint64, result *cm.Result[cm.List[uint8], cm.List[uint8], StreamError]) - -//go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.skip -//go:noescape -func wasmimport_InputStreamSkip(self0 uint32, len0 uint64, result *cm.Result[uint64, uint64, StreamError]) - -//go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.subscribe -//go:noescape -func wasmimport_InputStreamSubscribe(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [resource-drop]output-stream -//go:noescape -func wasmimport_OutputStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-flush -//go:noescape -func wasmimport_OutputStreamBlockingFlush(self0 uint32, result *cm.Result[StreamError, struct{}, StreamError]) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-splice -//go:noescape -func wasmimport_OutputStreamBlockingSplice(self0 uint32, src0 uint32, len0 uint64, result *cm.Result[uint64, uint64, StreamError]) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-write-and-flush -//go:noescape -func wasmimport_OutputStreamBlockingWriteAndFlush(self0 uint32, contents0 *uint8, contents1 uint32, result *cm.Result[StreamError, struct{}, StreamError]) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-write-zeroes-and-flush -//go:noescape -func wasmimport_OutputStreamBlockingWriteZeroesAndFlush(self0 uint32, len0 uint64, result *cm.Result[StreamError, struct{}, StreamError]) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.check-write -//go:noescape -func wasmimport_OutputStreamCheckWrite(self0 uint32, result *cm.Result[uint64, uint64, StreamError]) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.flush -//go:noescape -func wasmimport_OutputStreamFlush(self0 uint32, result *cm.Result[StreamError, struct{}, StreamError]) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.splice -//go:noescape -func wasmimport_OutputStreamSplice(self0 uint32, src0 uint32, len0 uint64, result *cm.Result[uint64, uint64, StreamError]) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.subscribe -//go:noescape -func wasmimport_OutputStreamSubscribe(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.write -//go:noescape -func wasmimport_OutputStreamWrite(self0 uint32, contents0 *uint8, contents1 uint32, result *cm.Result[StreamError, struct{}, StreamError]) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.write-zeroes -//go:noescape -func wasmimport_OutputStreamWriteZeroes(self0 uint32, len0 uint64, result *cm.Result[StreamError, struct{}, StreamError]) diff --git a/examples/component/invoke/gen/wasi/io/streams/streams.wit.go b/examples/component/invoke/gen/wasi/io/streams/streams.wit.go deleted file mode 100644 index ce1cf719..00000000 --- a/examples/component/invoke/gen/wasi/io/streams/streams.wit.go +++ /dev/null @@ -1,270 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package streams represents the imported interface "wasi:io/streams@0.2.0". -package streams - -import ( - ioerror "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/io/error" - "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/io/poll" - "go.bytecodealliance.org/cm" -) - -// Error represents the imported type alias "wasi:io/streams@0.2.0#error". -// -// See [ioerror.Error] for more information. -type Error = ioerror.Error - -// Pollable represents the imported type alias "wasi:io/streams@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// StreamError represents the imported variant "wasi:io/streams@0.2.0#stream-error". -// -// variant stream-error { -// last-operation-failed(error), -// closed, -// } -type StreamError cm.Variant[uint8, Error, Error] - -// StreamErrorLastOperationFailed returns a [StreamError] of case "last-operation-failed". -func StreamErrorLastOperationFailed(data Error) StreamError { - return cm.New[StreamError](0, data) -} - -// LastOperationFailed returns a non-nil *[Error] if [StreamError] represents the variant case "last-operation-failed". -func (self *StreamError) LastOperationFailed() *Error { - return cm.Case[Error](self, 0) -} - -// StreamErrorClosed returns a [StreamError] of case "closed". -func StreamErrorClosed() StreamError { - var data struct{} - return cm.New[StreamError](1, data) -} - -// Closed returns true if [StreamError] represents the variant case "closed". -func (self *StreamError) Closed() bool { - return self.Tag() == 1 -} - -var stringsStreamError = [2]string{ - "last-operation-failed", - "closed", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v StreamError) String() string { - return stringsStreamError[v.Tag()] -} - -// InputStream represents the imported resource "wasi:io/streams@0.2.0#input-stream". -// -// resource input-stream -type InputStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "input-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self InputStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_InputStreamResourceDrop((uint32)(self0)) - return -} - -// BlockingRead represents the imported method "blocking-read". -// -// blocking-read: func(len: u64) -> result, stream-error> -// -//go:nosplit -func (self InputStream) BlockingRead(len_ uint64) (result cm.Result[cm.List[uint8], cm.List[uint8], StreamError]) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_InputStreamBlockingRead((uint32)(self0), (uint64)(len0), &result) - return -} - -// BlockingSkip represents the imported method "blocking-skip". -// -// blocking-skip: func(len: u64) -> result -// -//go:nosplit -func (self InputStream) BlockingSkip(len_ uint64) (result cm.Result[uint64, uint64, StreamError]) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_InputStreamBlockingSkip((uint32)(self0), (uint64)(len0), &result) - return -} - -// Read represents the imported method "read". -// -// read: func(len: u64) -> result, stream-error> -// -//go:nosplit -func (self InputStream) Read(len_ uint64) (result cm.Result[cm.List[uint8], cm.List[uint8], StreamError]) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_InputStreamRead((uint32)(self0), (uint64)(len0), &result) - return -} - -// Skip represents the imported method "skip". -// -// skip: func(len: u64) -> result -// -//go:nosplit -func (self InputStream) Skip(len_ uint64) (result cm.Result[uint64, uint64, StreamError]) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_InputStreamSkip((uint32)(self0), (uint64)(len0), &result) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -> pollable -// -//go:nosplit -func (self InputStream) Subscribe() (result Pollable) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_InputStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) - return -} - -// OutputStream represents the imported resource "wasi:io/streams@0.2.0#output-stream". -// -// resource output-stream -type OutputStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "output-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self OutputStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamResourceDrop((uint32)(self0)) - return -} - -// BlockingFlush represents the imported method "blocking-flush". -// -// blocking-flush: func() -> result<_, stream-error> -// -//go:nosplit -func (self OutputStream) BlockingFlush() (result cm.Result[StreamError, struct{}, StreamError]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamBlockingFlush((uint32)(self0), &result) - return -} - -// BlockingSplice represents the imported method "blocking-splice". -// -// blocking-splice: func(src: borrow, len: u64) -> result -// -//go:nosplit -func (self OutputStream) BlockingSplice(src InputStream, len_ uint64) (result cm.Result[uint64, uint64, StreamError]) { - self0 := cm.Reinterpret[uint32](self) - src0 := cm.Reinterpret[uint32](src) - len0 := (uint64)(len_) - wasmimport_OutputStreamBlockingSplice((uint32)(self0), (uint32)(src0), (uint64)(len0), &result) - return -} - -// BlockingWriteAndFlush represents the imported method "blocking-write-and-flush". -// -// blocking-write-and-flush: func(contents: list) -> result<_, stream-error> -// -//go:nosplit -func (self OutputStream) BlockingWriteAndFlush(contents cm.List[uint8]) (result cm.Result[StreamError, struct{}, StreamError]) { - self0 := cm.Reinterpret[uint32](self) - contents0, contents1 := cm.LowerList(contents) - wasmimport_OutputStreamBlockingWriteAndFlush((uint32)(self0), (*uint8)(contents0), (uint32)(contents1), &result) - return -} - -// BlockingWriteZeroesAndFlush represents the imported method "blocking-write-zeroes-and-flush". -// -// blocking-write-zeroes-and-flush: func(len: u64) -> result<_, stream-error> -// -//go:nosplit -func (self OutputStream) BlockingWriteZeroesAndFlush(len_ uint64) (result cm.Result[StreamError, struct{}, StreamError]) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_OutputStreamBlockingWriteZeroesAndFlush((uint32)(self0), (uint64)(len0), &result) - return -} - -// CheckWrite represents the imported method "check-write". -// -// check-write: func() -> result -// -//go:nosplit -func (self OutputStream) CheckWrite() (result cm.Result[uint64, uint64, StreamError]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamCheckWrite((uint32)(self0), &result) - return -} - -// Flush represents the imported method "flush". -// -// flush: func() -> result<_, stream-error> -// -//go:nosplit -func (self OutputStream) Flush() (result cm.Result[StreamError, struct{}, StreamError]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamFlush((uint32)(self0), &result) - return -} - -// Splice represents the imported method "splice". -// -// splice: func(src: borrow, len: u64) -> result -// -//go:nosplit -func (self OutputStream) Splice(src InputStream, len_ uint64) (result cm.Result[uint64, uint64, StreamError]) { - self0 := cm.Reinterpret[uint32](self) - src0 := cm.Reinterpret[uint32](src) - len0 := (uint64)(len_) - wasmimport_OutputStreamSplice((uint32)(self0), (uint32)(src0), (uint64)(len0), &result) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -> pollable -// -//go:nosplit -func (self OutputStream) Subscribe() (result Pollable) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutputStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) - return -} - -// Write represents the imported method "write". -// -// write: func(contents: list) -> result<_, stream-error> -// -//go:nosplit -func (self OutputStream) Write(contents cm.List[uint8]) (result cm.Result[StreamError, struct{}, StreamError]) { - self0 := cm.Reinterpret[uint32](self) - contents0, contents1 := cm.LowerList(contents) - wasmimport_OutputStreamWrite((uint32)(self0), (*uint8)(contents0), (uint32)(contents1), &result) - return -} - -// WriteZeroes represents the imported method "write-zeroes". -// -// write-zeroes: func(len: u64) -> result<_, stream-error> -// -//go:nosplit -func (self OutputStream) WriteZeroes(len_ uint64) (result cm.Result[StreamError, struct{}, StreamError]) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_OutputStreamWriteZeroes((uint32)(self0), (uint64)(len0), &result) - return -} diff --git a/examples/component/invoke/gen/wasi/logging/logging/empty.s b/examples/component/invoke/gen/wasi/logging/logging/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/logging/logging/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/logging/logging/logging.wasm.go b/examples/component/invoke/gen/wasi/logging/logging/logging.wasm.go deleted file mode 100755 index d2d27098..00000000 --- a/examples/component/invoke/gen/wasi/logging/logging/logging.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package logging - -// This file contains wasmimport and wasmexport declarations for "wasi:logging@0.1.0-draft". - -//go:wasmimport wasi:logging/logging@0.1.0-draft log -//go:noescape -func wasmimport_Log(level0 uint32, context0 *uint8, context1 uint32, message0 *uint8, message1 uint32) diff --git a/examples/component/invoke/gen/wasi/logging/logging/logging.wit.go b/examples/component/invoke/gen/wasi/logging/logging/logging.wit.go deleted file mode 100644 index 96e406ed..00000000 --- a/examples/component/invoke/gen/wasi/logging/logging/logging.wit.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package logging represents the imported interface "wasi:logging/logging@0.1.0-draft". -package logging - -import ( - "go.bytecodealliance.org/cm" -) - -// Level represents the enum "wasi:logging/logging@0.1.0-draft#level". -// -// enum level { -// trace, -// debug, -// info, -// warn, -// error, -// critical -// } -type Level uint8 - -const ( - LevelTrace Level = iota - LevelDebug - LevelInfo - LevelWarn - LevelError - LevelCritical -) - -var stringsLevel = [6]string{ - "trace", - "debug", - "info", - "warn", - "error", - "critical", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e Level) String() string { - return stringsLevel[e] -} - -// Log represents the imported function "log". -// -// log: func(level: level, context: string, message: string) -// -//go:nosplit -func Log(level Level, context string, message string) { - level0 := (uint32)(level) - context0, context1 := cm.LowerString(context) - message0, message1 := cm.LowerString(message) - wasmimport_Log((uint32)(level0), (*uint8)(context0), (uint32)(context1), (*uint8)(message0), (uint32)(message1)) - return -} diff --git a/examples/component/invoke/gen/wasi/random/insecure-seed/empty.s b/examples/component/invoke/gen/wasi/random/insecure-seed/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/random/insecure-seed/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/random/insecure-seed/insecure-seed.wit.go b/examples/component/invoke/gen/wasi/random/insecure-seed/insecure-seed.wit.go deleted file mode 100644 index e701d1b4..00000000 --- a/examples/component/invoke/gen/wasi/random/insecure-seed/insecure-seed.wit.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package insecureseed represents the imported interface "wasi:random/insecure-seed@0.2.0". -package insecureseed - -// InsecureSeed represents the imported function "insecure-seed". -// -// insecure-seed: func() -> tuple -// -//go:nosplit -func InsecureSeed() (result [2]uint64) { - wasmimport_InsecureSeed(&result) - return -} diff --git a/examples/component/invoke/gen/wasi/random/insecure-seed/insecureseed.wasm.go b/examples/component/invoke/gen/wasi/random/insecure-seed/insecureseed.wasm.go deleted file mode 100755 index e94356df..00000000 --- a/examples/component/invoke/gen/wasi/random/insecure-seed/insecureseed.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package insecureseed - -// This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". - -//go:wasmimport wasi:random/insecure-seed@0.2.0 insecure-seed -//go:noescape -func wasmimport_InsecureSeed(result *[2]uint64) diff --git a/examples/component/invoke/gen/wasi/random/insecure/empty.s b/examples/component/invoke/gen/wasi/random/insecure/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/random/insecure/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/random/insecure/insecure.wasm.go b/examples/component/invoke/gen/wasi/random/insecure/insecure.wasm.go deleted file mode 100755 index 498bfe4a..00000000 --- a/examples/component/invoke/gen/wasi/random/insecure/insecure.wasm.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package insecure - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". - -//go:wasmimport wasi:random/insecure@0.2.0 get-insecure-random-bytes -//go:noescape -func wasmimport_GetInsecureRandomBytes(len0 uint64, result *cm.List[uint8]) - -//go:wasmimport wasi:random/insecure@0.2.0 get-insecure-random-u64 -//go:noescape -func wasmimport_GetInsecureRandomU64() (result0 uint64) diff --git a/examples/component/invoke/gen/wasi/random/insecure/insecure.wit.go b/examples/component/invoke/gen/wasi/random/insecure/insecure.wit.go deleted file mode 100644 index f32282c6..00000000 --- a/examples/component/invoke/gen/wasi/random/insecure/insecure.wit.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package insecure represents the imported interface "wasi:random/insecure@0.2.0". -package insecure - -import ( - "go.bytecodealliance.org/cm" -) - -// GetInsecureRandomBytes represents the imported function "get-insecure-random-bytes". -// -// get-insecure-random-bytes: func(len: u64) -> list -// -//go:nosplit -func GetInsecureRandomBytes(len_ uint64) (result cm.List[uint8]) { - len0 := (uint64)(len_) - wasmimport_GetInsecureRandomBytes((uint64)(len0), &result) - return -} - -// GetInsecureRandomU64 represents the imported function "get-insecure-random-u64". -// -// get-insecure-random-u64: func() -> u64 -// -//go:nosplit -func GetInsecureRandomU64() (result uint64) { - result0 := wasmimport_GetInsecureRandomU64() - result = (uint64)((uint64)(result0)) - return -} diff --git a/examples/component/invoke/gen/wasi/random/random/empty.s b/examples/component/invoke/gen/wasi/random/random/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/random/random/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/random/random/random.wasm.go b/examples/component/invoke/gen/wasi/random/random/random.wasm.go deleted file mode 100755 index 9096457b..00000000 --- a/examples/component/invoke/gen/wasi/random/random/random.wasm.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package random - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". - -//go:wasmimport wasi:random/random@0.2.0 get-random-bytes -//go:noescape -func wasmimport_GetRandomBytes(len0 uint64, result *cm.List[uint8]) - -//go:wasmimport wasi:random/random@0.2.0 get-random-u64 -//go:noescape -func wasmimport_GetRandomU64() (result0 uint64) diff --git a/examples/component/invoke/gen/wasi/random/random/random.wit.go b/examples/component/invoke/gen/wasi/random/random/random.wit.go deleted file mode 100644 index 98bb7779..00000000 --- a/examples/component/invoke/gen/wasi/random/random/random.wit.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package random represents the imported interface "wasi:random/random@0.2.0". -package random - -import ( - "go.bytecodealliance.org/cm" -) - -// GetRandomBytes represents the imported function "get-random-bytes". -// -// get-random-bytes: func(len: u64) -> list -// -//go:nosplit -func GetRandomBytes(len_ uint64) (result cm.List[uint8]) { - len0 := (uint64)(len_) - wasmimport_GetRandomBytes((uint64)(len0), &result) - return -} - -// GetRandomU64 represents the imported function "get-random-u64". -// -// get-random-u64: func() -> u64 -// -//go:nosplit -func GetRandomU64() (result uint64) { - result0 := wasmimport_GetRandomU64() - result = (uint64)((uint64)(result0)) - return -} diff --git a/examples/component/invoke/gen/wasi/sockets/instance-network/empty.s b/examples/component/invoke/gen/wasi/sockets/instance-network/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/sockets/instance-network/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/sockets/instance-network/instance-network.wit.go b/examples/component/invoke/gen/wasi/sockets/instance-network/instance-network.wit.go deleted file mode 100644 index 73529fe3..00000000 --- a/examples/component/invoke/gen/wasi/sockets/instance-network/instance-network.wit.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package instancenetwork represents the imported interface "wasi:sockets/instance-network@0.2.0". -package instancenetwork - -import ( - "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/sockets/network" - "go.bytecodealliance.org/cm" -) - -// Network represents the imported type alias "wasi:sockets/instance-network@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// InstanceNetwork represents the imported function "instance-network". -// -// instance-network: func() -> network -// -//go:nosplit -func InstanceNetwork() (result Network) { - result0 := wasmimport_InstanceNetwork() - result = cm.Reinterpret[Network]((uint32)(result0)) - return -} diff --git a/examples/component/invoke/gen/wasi/sockets/instance-network/instancenetwork.wasm.go b/examples/component/invoke/gen/wasi/sockets/instance-network/instancenetwork.wasm.go deleted file mode 100755 index eb113e21..00000000 --- a/examples/component/invoke/gen/wasi/sockets/instance-network/instancenetwork.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package instancenetwork - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/instance-network@0.2.0 instance-network -//go:noescape -func wasmimport_InstanceNetwork() (result0 uint32) diff --git a/examples/component/invoke/gen/wasi/sockets/ip-name-lookup/abi.go b/examples/component/invoke/gen/wasi/sockets/ip-name-lookup/abi.go deleted file mode 100644 index a63f0d01..00000000 --- a/examples/component/invoke/gen/wasi/sockets/ip-name-lookup/abi.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package ipnamelookup - -import ( - "go.bytecodealliance.org/cm" - "unsafe" -) - -// OptionIPAddressShape is used for storage in variant or result types. -type OptionIPAddressShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Option[IPAddress]{})]byte -} diff --git a/examples/component/invoke/gen/wasi/sockets/ip-name-lookup/empty.s b/examples/component/invoke/gen/wasi/sockets/ip-name-lookup/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/sockets/ip-name-lookup/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go b/examples/component/invoke/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go deleted file mode 100644 index fb98aba4..00000000 --- a/examples/component/invoke/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package ipnamelookup represents the imported interface "wasi:sockets/ip-name-lookup@0.2.0". -package ipnamelookup - -import ( - "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/io/poll" - "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/sockets/network" - "go.bytecodealliance.org/cm" -) - -// Pollable represents the imported type alias "wasi:sockets/ip-name-lookup@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// Network represents the imported type alias "wasi:sockets/ip-name-lookup@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// ErrorCode represents the type alias "wasi:sockets/ip-name-lookup@0.2.0#error-code". -// -// See [network.ErrorCode] for more information. -type ErrorCode = network.ErrorCode - -// IPAddress represents the type alias "wasi:sockets/ip-name-lookup@0.2.0#ip-address". -// -// See [network.IPAddress] for more information. -type IPAddress = network.IPAddress - -// ResolveAddressStream represents the imported resource "wasi:sockets/ip-name-lookup@0.2.0#resolve-address-stream". -// -// resource resolve-address-stream -type ResolveAddressStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "resolve-address-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self ResolveAddressStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_ResolveAddressStreamResourceDrop((uint32)(self0)) - return -} - -// ResolveNextAddress represents the imported method "resolve-next-address". -// -// resolve-next-address: func() -> result, error-code> -// -//go:nosplit -func (self ResolveAddressStream) ResolveNextAddress() (result cm.Result[OptionIPAddressShape, cm.Option[IPAddress], ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_ResolveAddressStreamResolveNextAddress((uint32)(self0), &result) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -> pollable -// -//go:nosplit -func (self ResolveAddressStream) Subscribe() (result Pollable) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_ResolveAddressStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) - return -} - -// ResolveAddresses represents the imported function "resolve-addresses". -// -// resolve-addresses: func(network: borrow, name: string) -> result -// -//go:nosplit -func ResolveAddresses(network_ Network, name string) (result cm.Result[ResolveAddressStream, ResolveAddressStream, ErrorCode]) { - network0 := cm.Reinterpret[uint32](network_) - name0, name1 := cm.LowerString(name) - wasmimport_ResolveAddresses((uint32)(network0), (*uint8)(name0), (uint32)(name1), &result) - return -} diff --git a/examples/component/invoke/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go b/examples/component/invoke/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go deleted file mode 100755 index da5fb000..00000000 --- a/examples/component/invoke/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package ipnamelookup - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 [resource-drop]resolve-address-stream -//go:noescape -func wasmimport_ResolveAddressStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 [method]resolve-address-stream.resolve-next-address -//go:noescape -func wasmimport_ResolveAddressStreamResolveNextAddress(self0 uint32, result *cm.Result[OptionIPAddressShape, cm.Option[IPAddress], ErrorCode]) - -//go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 [method]resolve-address-stream.subscribe -//go:noescape -func wasmimport_ResolveAddressStreamSubscribe(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 resolve-addresses -//go:noescape -func wasmimport_ResolveAddresses(network0 uint32, name0 *uint8, name1 uint32, result *cm.Result[ResolveAddressStream, ResolveAddressStream, ErrorCode]) diff --git a/examples/component/invoke/gen/wasi/sockets/network/abi.go b/examples/component/invoke/gen/wasi/sockets/network/abi.go deleted file mode 100644 index a088bd1d..00000000 --- a/examples/component/invoke/gen/wasi/sockets/network/abi.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package network - -import ( - "go.bytecodealliance.org/cm" - "unsafe" -) - -// IPv6SocketAddressShape is used for storage in variant or result types. -type IPv6SocketAddressShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(IPv6SocketAddress{})]byte -} diff --git a/examples/component/invoke/gen/wasi/sockets/network/empty.s b/examples/component/invoke/gen/wasi/sockets/network/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/sockets/network/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/sockets/network/network.wasm.go b/examples/component/invoke/gen/wasi/sockets/network/network.wasm.go deleted file mode 100755 index 012a79ff..00000000 --- a/examples/component/invoke/gen/wasi/sockets/network/network.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package network - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/network@0.2.0 [resource-drop]network -//go:noescape -func wasmimport_NetworkResourceDrop(self0 uint32) diff --git a/examples/component/invoke/gen/wasi/sockets/network/network.wit.go b/examples/component/invoke/gen/wasi/sockets/network/network.wit.go deleted file mode 100644 index f0fb7eef..00000000 --- a/examples/component/invoke/gen/wasi/sockets/network/network.wit.go +++ /dev/null @@ -1,241 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package network represents the imported interface "wasi:sockets/network@0.2.0". -package network - -import ( - "go.bytecodealliance.org/cm" -) - -// Network represents the imported resource "wasi:sockets/network@0.2.0#network". -// -// resource network -type Network cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "network". -// -// Drops a resource handle. -// -//go:nosplit -func (self Network) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_NetworkResourceDrop((uint32)(self0)) - return -} - -// ErrorCode represents the enum "wasi:sockets/network@0.2.0#error-code". -// -// enum error-code { -// unknown, -// access-denied, -// not-supported, -// invalid-argument, -// out-of-memory, -// timeout, -// concurrency-conflict, -// not-in-progress, -// would-block, -// invalid-state, -// new-socket-limit, -// address-not-bindable, -// address-in-use, -// remote-unreachable, -// connection-refused, -// connection-reset, -// connection-aborted, -// datagram-too-large, -// name-unresolvable, -// temporary-resolver-failure, -// permanent-resolver-failure -// } -type ErrorCode uint8 - -const ( - ErrorCodeUnknown ErrorCode = iota - ErrorCodeAccessDenied - ErrorCodeNotSupported - ErrorCodeInvalidArgument - ErrorCodeOutOfMemory - ErrorCodeTimeout - ErrorCodeConcurrencyConflict - ErrorCodeNotInProgress - ErrorCodeWouldBlock - ErrorCodeInvalidState - ErrorCodeNewSocketLimit - ErrorCodeAddressNotBindable - ErrorCodeAddressInUse - ErrorCodeRemoteUnreachable - ErrorCodeConnectionRefused - ErrorCodeConnectionReset - ErrorCodeConnectionAborted - ErrorCodeDatagramTooLarge - ErrorCodeNameUnresolvable - ErrorCodeTemporaryResolverFailure - ErrorCodePermanentResolverFailure -) - -var stringsErrorCode = [21]string{ - "unknown", - "access-denied", - "not-supported", - "invalid-argument", - "out-of-memory", - "timeout", - "concurrency-conflict", - "not-in-progress", - "would-block", - "invalid-state", - "new-socket-limit", - "address-not-bindable", - "address-in-use", - "remote-unreachable", - "connection-refused", - "connection-reset", - "connection-aborted", - "datagram-too-large", - "name-unresolvable", - "temporary-resolver-failure", - "permanent-resolver-failure", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e ErrorCode) String() string { - return stringsErrorCode[e] -} - -// IPAddressFamily represents the enum "wasi:sockets/network@0.2.0#ip-address-family". -// -// enum ip-address-family { -// ipv4, -// ipv6 -// } -type IPAddressFamily uint8 - -const ( - IPAddressFamilyIPv4 IPAddressFamily = iota - IPAddressFamilyIPv6 -) - -var stringsIPAddressFamily = [2]string{ - "ipv4", - "ipv6", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e IPAddressFamily) String() string { - return stringsIPAddressFamily[e] -} - -// IPv4Address represents the tuple "wasi:sockets/network@0.2.0#ipv4-address". -// -// type ipv4-address = tuple -type IPv4Address [4]uint8 - -// IPv6Address represents the tuple "wasi:sockets/network@0.2.0#ipv6-address". -// -// type ipv6-address = tuple -type IPv6Address [8]uint16 - -// IPAddress represents the variant "wasi:sockets/network@0.2.0#ip-address". -// -// variant ip-address { -// ipv4(ipv4-address), -// ipv6(ipv6-address), -// } -type IPAddress cm.Variant[uint8, IPv6Address, IPv6Address] - -// IPAddressIPv4 returns a [IPAddress] of case "ipv4". -func IPAddressIPv4(data IPv4Address) IPAddress { - return cm.New[IPAddress](0, data) -} - -// IPv4 returns a non-nil *[IPv4Address] if [IPAddress] represents the variant case "ipv4". -func (self *IPAddress) IPv4() *IPv4Address { - return cm.Case[IPv4Address](self, 0) -} - -// IPAddressIPv6 returns a [IPAddress] of case "ipv6". -func IPAddressIPv6(data IPv6Address) IPAddress { - return cm.New[IPAddress](1, data) -} - -// IPv6 returns a non-nil *[IPv6Address] if [IPAddress] represents the variant case "ipv6". -func (self *IPAddress) IPv6() *IPv6Address { - return cm.Case[IPv6Address](self, 1) -} - -var stringsIPAddress = [2]string{ - "ipv4", - "ipv6", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v IPAddress) String() string { - return stringsIPAddress[v.Tag()] -} - -// IPv4SocketAddress represents the record "wasi:sockets/network@0.2.0#ipv4-socket-address". -// -// record ipv4-socket-address { -// port: u16, -// address: ipv4-address, -// } -type IPv4SocketAddress struct { - _ cm.HostLayout - Port uint16 - Address IPv4Address -} - -// IPv6SocketAddress represents the record "wasi:sockets/network@0.2.0#ipv6-socket-address". -// -// record ipv6-socket-address { -// port: u16, -// flow-info: u32, -// address: ipv6-address, -// scope-id: u32, -// } -type IPv6SocketAddress struct { - _ cm.HostLayout - Port uint16 - FlowInfo uint32 - Address IPv6Address - ScopeID uint32 -} - -// IPSocketAddress represents the variant "wasi:sockets/network@0.2.0#ip-socket-address". -// -// variant ip-socket-address { -// ipv4(ipv4-socket-address), -// ipv6(ipv6-socket-address), -// } -type IPSocketAddress cm.Variant[uint8, IPv6SocketAddressShape, IPv6SocketAddress] - -// IPSocketAddressIPv4 returns a [IPSocketAddress] of case "ipv4". -func IPSocketAddressIPv4(data IPv4SocketAddress) IPSocketAddress { - return cm.New[IPSocketAddress](0, data) -} - -// IPv4 returns a non-nil *[IPv4SocketAddress] if [IPSocketAddress] represents the variant case "ipv4". -func (self *IPSocketAddress) IPv4() *IPv4SocketAddress { - return cm.Case[IPv4SocketAddress](self, 0) -} - -// IPSocketAddressIPv6 returns a [IPSocketAddress] of case "ipv6". -func IPSocketAddressIPv6(data IPv6SocketAddress) IPSocketAddress { - return cm.New[IPSocketAddress](1, data) -} - -// IPv6 returns a non-nil *[IPv6SocketAddress] if [IPSocketAddress] represents the variant case "ipv6". -func (self *IPSocketAddress) IPv6() *IPv6SocketAddress { - return cm.Case[IPv6SocketAddress](self, 1) -} - -var stringsIPSocketAddress = [2]string{ - "ipv4", - "ipv6", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v IPSocketAddress) String() string { - return stringsIPSocketAddress[v.Tag()] -} diff --git a/examples/component/invoke/gen/wasi/sockets/tcp-create-socket/empty.s b/examples/component/invoke/gen/wasi/sockets/tcp-create-socket/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/sockets/tcp-create-socket/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go b/examples/component/invoke/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go deleted file mode 100644 index 1144092f..00000000 --- a/examples/component/invoke/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package tcpcreatesocket represents the imported interface "wasi:sockets/tcp-create-socket@0.2.0". -package tcpcreatesocket - -import ( - "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/sockets/network" - "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/sockets/tcp" - "go.bytecodealliance.org/cm" -) - -// Network represents the imported type alias "wasi:sockets/tcp-create-socket@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// ErrorCode represents the type alias "wasi:sockets/tcp-create-socket@0.2.0#error-code". -// -// See [network.ErrorCode] for more information. -type ErrorCode = network.ErrorCode - -// IPAddressFamily represents the type alias "wasi:sockets/tcp-create-socket@0.2.0#ip-address-family". -// -// See [network.IPAddressFamily] for more information. -type IPAddressFamily = network.IPAddressFamily - -// TCPSocket represents the imported type alias "wasi:sockets/tcp-create-socket@0.2.0#tcp-socket". -// -// See [tcp.TCPSocket] for more information. -type TCPSocket = tcp.TCPSocket - -// CreateTCPSocket represents the imported function "create-tcp-socket". -// -// create-tcp-socket: func(address-family: ip-address-family) -> result -// -//go:nosplit -func CreateTCPSocket(addressFamily IPAddressFamily) (result cm.Result[TCPSocket, TCPSocket, ErrorCode]) { - addressFamily0 := (uint32)(addressFamily) - wasmimport_CreateTCPSocket((uint32)(addressFamily0), &result) - return -} diff --git a/examples/component/invoke/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go b/examples/component/invoke/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go deleted file mode 100755 index b7b43155..00000000 --- a/examples/component/invoke/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package tcpcreatesocket - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/tcp-create-socket@0.2.0 create-tcp-socket -//go:noescape -func wasmimport_CreateTCPSocket(addressFamily0 uint32, result *cm.Result[TCPSocket, TCPSocket, ErrorCode]) diff --git a/examples/component/invoke/gen/wasi/sockets/tcp/abi.go b/examples/component/invoke/gen/wasi/sockets/tcp/abi.go deleted file mode 100644 index 4d31d8bb..00000000 --- a/examples/component/invoke/gen/wasi/sockets/tcp/abi.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package tcp - -import ( - "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/sockets/network" - "go.bytecodealliance.org/cm" - "unsafe" -) - -// TupleTCPSocketInputStreamOutputStreamShape is used for storage in variant or result types. -type TupleTCPSocketInputStreamOutputStreamShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Tuple3[TCPSocket, InputStream, OutputStream]{})]byte -} - -// TupleInputStreamOutputStreamShape is used for storage in variant or result types. -type TupleInputStreamOutputStreamShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Tuple[InputStream, OutputStream]{})]byte -} - -// IPSocketAddressShape is used for storage in variant or result types. -type IPSocketAddressShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(network.IPSocketAddress{})]byte -} - -func lower_IPv4Address(v network.IPv4Address) (f0 uint32, f1 uint32, f2 uint32, f3 uint32) { - f0 = (uint32)(v[0]) - f1 = (uint32)(v[1]) - f2 = (uint32)(v[2]) - f3 = (uint32)(v[3]) - return -} - -func lower_IPv4SocketAddress(v network.IPv4SocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32) { - f0 = (uint32)(v.Port) - f1, f2, f3, f4 = lower_IPv4Address(v.Address) - return -} - -func lower_IPv6Address(v network.IPv6Address) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32) { - f0 = (uint32)(v[0]) - f1 = (uint32)(v[1]) - f2 = (uint32)(v[2]) - f3 = (uint32)(v[3]) - f4 = (uint32)(v[4]) - f5 = (uint32)(v[5]) - f6 = (uint32)(v[6]) - f7 = (uint32)(v[7]) - return -} - -func lower_IPv6SocketAddress(v network.IPv6SocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32) { - f0 = (uint32)(v.Port) - f1 = (uint32)(v.FlowInfo) - f2, f3, f4, f5, f6, f7, f8, f9 = lower_IPv6Address(v.Address) - f10 = (uint32)(v.ScopeID) - return -} - -func lower_IPSocketAddress(v network.IPSocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32, f11 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 0: // ipv4 - v1, v2, v3, v4, v5 := lower_IPv4SocketAddress(*cm.Case[network.IPv4SocketAddress](&v, 0)) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 1: // ipv6 - v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11 := lower_IPv6SocketAddress(*cm.Case[network.IPv6SocketAddress](&v, 1)) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - f6 = (uint32)(v6) - f7 = (uint32)(v7) - f8 = (uint32)(v8) - f9 = (uint32)(v9) - f10 = (uint32)(v10) - f11 = (uint32)(v11) - } - return -} diff --git a/examples/component/invoke/gen/wasi/sockets/tcp/empty.s b/examples/component/invoke/gen/wasi/sockets/tcp/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/sockets/tcp/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/sockets/tcp/tcp.wasm.go b/examples/component/invoke/gen/wasi/sockets/tcp/tcp.wasm.go deleted file mode 100755 index 56247525..00000000 --- a/examples/component/invoke/gen/wasi/sockets/tcp/tcp.wasm.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package tcp - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/tcp@0.2.0 [resource-drop]tcp-socket -//go:noescape -func wasmimport_TCPSocketResourceDrop(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.accept -//go:noescape -func wasmimport_TCPSocketAccept(self0 uint32, result *cm.Result[TupleTCPSocketInputStreamOutputStreamShape, cm.Tuple3[TCPSocket, InputStream, OutputStream], ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.address-family -//go:noescape -func wasmimport_TCPSocketAddressFamily(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-bind -//go:noescape -func wasmimport_TCPSocketFinishBind(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-connect -//go:noescape -func wasmimport_TCPSocketFinishConnect(self0 uint32, result *cm.Result[TupleInputStreamOutputStreamShape, cm.Tuple[InputStream, OutputStream], ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-listen -//go:noescape -func wasmimport_TCPSocketFinishListen(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.hop-limit -//go:noescape -func wasmimport_TCPSocketHopLimit(self0 uint32, result *cm.Result[uint8, uint8, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.is-listening -//go:noescape -func wasmimport_TCPSocketIsListening(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-count -//go:noescape -func wasmimport_TCPSocketKeepAliveCount(self0 uint32, result *cm.Result[uint32, uint32, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-enabled -//go:noescape -func wasmimport_TCPSocketKeepAliveEnabled(self0 uint32, result *cm.Result[bool, bool, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-idle-time -//go:noescape -func wasmimport_TCPSocketKeepAliveIdleTime(self0 uint32, result *cm.Result[uint64, Duration, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-interval -//go:noescape -func wasmimport_TCPSocketKeepAliveInterval(self0 uint32, result *cm.Result[uint64, Duration, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.local-address -//go:noescape -func wasmimport_TCPSocketLocalAddress(self0 uint32, result *cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.receive-buffer-size -//go:noescape -func wasmimport_TCPSocketReceiveBufferSize(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.remote-address -//go:noescape -func wasmimport_TCPSocketRemoteAddress(self0 uint32, result *cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.send-buffer-size -//go:noescape -func wasmimport_TCPSocketSendBufferSize(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-hop-limit -//go:noescape -func wasmimport_TCPSocketSetHopLimit(self0 uint32, value0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-count -//go:noescape -func wasmimport_TCPSocketSetKeepAliveCount(self0 uint32, value0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-enabled -//go:noescape -func wasmimport_TCPSocketSetKeepAliveEnabled(self0 uint32, value0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-idle-time -//go:noescape -func wasmimport_TCPSocketSetKeepAliveIdleTime(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-interval -//go:noescape -func wasmimport_TCPSocketSetKeepAliveInterval(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-listen-backlog-size -//go:noescape -func wasmimport_TCPSocketSetListenBacklogSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-receive-buffer-size -//go:noescape -func wasmimport_TCPSocketSetReceiveBufferSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-send-buffer-size -//go:noescape -func wasmimport_TCPSocketSetSendBufferSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.shutdown -//go:noescape -func wasmimport_TCPSocketShutdown(self0 uint32, shutdownType0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-bind -//go:noescape -func wasmimport_TCPSocketStartBind(self0 uint32, network0 uint32, localAddress0 uint32, localAddress1 uint32, localAddress2 uint32, localAddress3 uint32, localAddress4 uint32, localAddress5 uint32, localAddress6 uint32, localAddress7 uint32, localAddress8 uint32, localAddress9 uint32, localAddress10 uint32, localAddress11 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-connect -//go:noescape -func wasmimport_TCPSocketStartConnect(self0 uint32, network0 uint32, remoteAddress0 uint32, remoteAddress1 uint32, remoteAddress2 uint32, remoteAddress3 uint32, remoteAddress4 uint32, remoteAddress5 uint32, remoteAddress6 uint32, remoteAddress7 uint32, remoteAddress8 uint32, remoteAddress9 uint32, remoteAddress10 uint32, remoteAddress11 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-listen -//go:noescape -func wasmimport_TCPSocketStartListen(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.subscribe -//go:noescape -func wasmimport_TCPSocketSubscribe(self0 uint32) (result0 uint32) diff --git a/examples/component/invoke/gen/wasi/sockets/tcp/tcp.wit.go b/examples/component/invoke/gen/wasi/sockets/tcp/tcp.wit.go deleted file mode 100644 index 0f236b65..00000000 --- a/examples/component/invoke/gen/wasi/sockets/tcp/tcp.wit.go +++ /dev/null @@ -1,420 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package tcp represents the imported interface "wasi:sockets/tcp@0.2.0". -package tcp - -import ( - monotonicclock "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/clocks/monotonic-clock" - "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/io/poll" - "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/io/streams" - "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/sockets/network" - "go.bytecodealliance.org/cm" -) - -// InputStream represents the imported type alias "wasi:sockets/tcp@0.2.0#input-stream". -// -// See [streams.InputStream] for more information. -type InputStream = streams.InputStream - -// OutputStream represents the imported type alias "wasi:sockets/tcp@0.2.0#output-stream". -// -// See [streams.OutputStream] for more information. -type OutputStream = streams.OutputStream - -// Pollable represents the imported type alias "wasi:sockets/tcp@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// Duration represents the type alias "wasi:sockets/tcp@0.2.0#duration". -// -// See [monotonicclock.Duration] for more information. -type Duration = monotonicclock.Duration - -// Network represents the imported type alias "wasi:sockets/tcp@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// ErrorCode represents the type alias "wasi:sockets/tcp@0.2.0#error-code". -// -// See [network.ErrorCode] for more information. -type ErrorCode = network.ErrorCode - -// IPSocketAddress represents the type alias "wasi:sockets/tcp@0.2.0#ip-socket-address". -// -// See [network.IPSocketAddress] for more information. -type IPSocketAddress = network.IPSocketAddress - -// IPAddressFamily represents the type alias "wasi:sockets/tcp@0.2.0#ip-address-family". -// -// See [network.IPAddressFamily] for more information. -type IPAddressFamily = network.IPAddressFamily - -// ShutdownType represents the enum "wasi:sockets/tcp@0.2.0#shutdown-type". -// -// enum shutdown-type { -// receive, -// send, -// both -// } -type ShutdownType uint8 - -const ( - ShutdownTypeReceive ShutdownType = iota - ShutdownTypeSend - ShutdownTypeBoth -) - -var stringsShutdownType = [3]string{ - "receive", - "send", - "both", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e ShutdownType) String() string { - return stringsShutdownType[e] -} - -// TCPSocket represents the imported resource "wasi:sockets/tcp@0.2.0#tcp-socket". -// -// resource tcp-socket -type TCPSocket cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "tcp-socket". -// -// Drops a resource handle. -// -//go:nosplit -func (self TCPSocket) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketResourceDrop((uint32)(self0)) - return -} - -// Accept represents the imported method "accept". -// -// accept: func() -> result, error-code> -// -//go:nosplit -func (self TCPSocket) Accept() (result cm.Result[TupleTCPSocketInputStreamOutputStreamShape, cm.Tuple3[TCPSocket, InputStream, OutputStream], ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketAccept((uint32)(self0), &result) - return -} - -// AddressFamily represents the imported method "address-family". -// -// address-family: func() -> ip-address-family -// -//go:nosplit -func (self TCPSocket) AddressFamily() (result IPAddressFamily) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_TCPSocketAddressFamily((uint32)(self0)) - result = (network.IPAddressFamily)((uint32)(result0)) - return -} - -// FinishBind represents the imported method "finish-bind". -// -// finish-bind: func() -> result<_, error-code> -// -//go:nosplit -func (self TCPSocket) FinishBind() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketFinishBind((uint32)(self0), &result) - return -} - -// FinishConnect represents the imported method "finish-connect". -// -// finish-connect: func() -> result, error-code> -// -//go:nosplit -func (self TCPSocket) FinishConnect() (result cm.Result[TupleInputStreamOutputStreamShape, cm.Tuple[InputStream, OutputStream], ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketFinishConnect((uint32)(self0), &result) - return -} - -// FinishListen represents the imported method "finish-listen". -// -// finish-listen: func() -> result<_, error-code> -// -//go:nosplit -func (self TCPSocket) FinishListen() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketFinishListen((uint32)(self0), &result) - return -} - -// HopLimit represents the imported method "hop-limit". -// -// hop-limit: func() -> result -// -//go:nosplit -func (self TCPSocket) HopLimit() (result cm.Result[uint8, uint8, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketHopLimit((uint32)(self0), &result) - return -} - -// IsListening represents the imported method "is-listening". -// -// is-listening: func() -> bool -// -//go:nosplit -func (self TCPSocket) IsListening() (result bool) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_TCPSocketIsListening((uint32)(self0)) - result = (bool)(cm.U32ToBool((uint32)(result0))) - return -} - -// KeepAliveCount represents the imported method "keep-alive-count". -// -// keep-alive-count: func() -> result -// -//go:nosplit -func (self TCPSocket) KeepAliveCount() (result cm.Result[uint32, uint32, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveCount((uint32)(self0), &result) - return -} - -// KeepAliveEnabled represents the imported method "keep-alive-enabled". -// -// keep-alive-enabled: func() -> result -// -//go:nosplit -func (self TCPSocket) KeepAliveEnabled() (result cm.Result[bool, bool, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveEnabled((uint32)(self0), &result) - return -} - -// KeepAliveIdleTime represents the imported method "keep-alive-idle-time". -// -// keep-alive-idle-time: func() -> result -// -//go:nosplit -func (self TCPSocket) KeepAliveIdleTime() (result cm.Result[uint64, Duration, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveIdleTime((uint32)(self0), &result) - return -} - -// KeepAliveInterval represents the imported method "keep-alive-interval". -// -// keep-alive-interval: func() -> result -// -//go:nosplit -func (self TCPSocket) KeepAliveInterval() (result cm.Result[uint64, Duration, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveInterval((uint32)(self0), &result) - return -} - -// LocalAddress represents the imported method "local-address". -// -// local-address: func() -> result -// -//go:nosplit -func (self TCPSocket) LocalAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketLocalAddress((uint32)(self0), &result) - return -} - -// ReceiveBufferSize represents the imported method "receive-buffer-size". -// -// receive-buffer-size: func() -> result -// -//go:nosplit -func (self TCPSocket) ReceiveBufferSize() (result cm.Result[uint64, uint64, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketReceiveBufferSize((uint32)(self0), &result) - return -} - -// RemoteAddress represents the imported method "remote-address". -// -// remote-address: func() -> result -// -//go:nosplit -func (self TCPSocket) RemoteAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketRemoteAddress((uint32)(self0), &result) - return -} - -// SendBufferSize represents the imported method "send-buffer-size". -// -// send-buffer-size: func() -> result -// -//go:nosplit -func (self TCPSocket) SendBufferSize() (result cm.Result[uint64, uint64, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketSendBufferSize((uint32)(self0), &result) - return -} - -// SetHopLimit represents the imported method "set-hop-limit". -// -// set-hop-limit: func(value: u8) -> result<_, error-code> -// -//go:nosplit -func (self TCPSocket) SetHopLimit(value uint8) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint32)(value) - wasmimport_TCPSocketSetHopLimit((uint32)(self0), (uint32)(value0), &result) - return -} - -// SetKeepAliveCount represents the imported method "set-keep-alive-count". -// -// set-keep-alive-count: func(value: u32) -> result<_, error-code> -// -//go:nosplit -func (self TCPSocket) SetKeepAliveCount(value uint32) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint32)(value) - wasmimport_TCPSocketSetKeepAliveCount((uint32)(self0), (uint32)(value0), &result) - return -} - -// SetKeepAliveEnabled represents the imported method "set-keep-alive-enabled". -// -// set-keep-alive-enabled: func(value: bool) -> result<_, error-code> -// -//go:nosplit -func (self TCPSocket) SetKeepAliveEnabled(value bool) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint32)(cm.BoolToU32(value)) - wasmimport_TCPSocketSetKeepAliveEnabled((uint32)(self0), (uint32)(value0), &result) - return -} - -// SetKeepAliveIdleTime represents the imported method "set-keep-alive-idle-time". -// -// set-keep-alive-idle-time: func(value: duration) -> result<_, error-code> -// -//go:nosplit -func (self TCPSocket) SetKeepAliveIdleTime(value Duration) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_TCPSocketSetKeepAliveIdleTime((uint32)(self0), (uint64)(value0), &result) - return -} - -// SetKeepAliveInterval represents the imported method "set-keep-alive-interval". -// -// set-keep-alive-interval: func(value: duration) -> result<_, error-code> -// -//go:nosplit -func (self TCPSocket) SetKeepAliveInterval(value Duration) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_TCPSocketSetKeepAliveInterval((uint32)(self0), (uint64)(value0), &result) - return -} - -// SetListenBacklogSize represents the imported method "set-listen-backlog-size". -// -// set-listen-backlog-size: func(value: u64) -> result<_, error-code> -// -//go:nosplit -func (self TCPSocket) SetListenBacklogSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_TCPSocketSetListenBacklogSize((uint32)(self0), (uint64)(value0), &result) - return -} - -// SetReceiveBufferSize represents the imported method "set-receive-buffer-size". -// -// set-receive-buffer-size: func(value: u64) -> result<_, error-code> -// -//go:nosplit -func (self TCPSocket) SetReceiveBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_TCPSocketSetReceiveBufferSize((uint32)(self0), (uint64)(value0), &result) - return -} - -// SetSendBufferSize represents the imported method "set-send-buffer-size". -// -// set-send-buffer-size: func(value: u64) -> result<_, error-code> -// -//go:nosplit -func (self TCPSocket) SetSendBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_TCPSocketSetSendBufferSize((uint32)(self0), (uint64)(value0), &result) - return -} - -// Shutdown represents the imported method "shutdown". -// -// shutdown: func(shutdown-type: shutdown-type) -> result<_, error-code> -// -//go:nosplit -func (self TCPSocket) Shutdown(shutdownType ShutdownType) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - shutdownType0 := (uint32)(shutdownType) - wasmimport_TCPSocketShutdown((uint32)(self0), (uint32)(shutdownType0), &result) - return -} - -// StartBind represents the imported method "start-bind". -// -// start-bind: func(network: borrow, local-address: ip-socket-address) -> -// result<_, error-code> -// -//go:nosplit -func (self TCPSocket) StartBind(network_ Network, localAddress IPSocketAddress) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - network0 := cm.Reinterpret[uint32](network_) - localAddress0, localAddress1, localAddress2, localAddress3, localAddress4, localAddress5, localAddress6, localAddress7, localAddress8, localAddress9, localAddress10, localAddress11 := lower_IPSocketAddress(localAddress) - wasmimport_TCPSocketStartBind((uint32)(self0), (uint32)(network0), (uint32)(localAddress0), (uint32)(localAddress1), (uint32)(localAddress2), (uint32)(localAddress3), (uint32)(localAddress4), (uint32)(localAddress5), (uint32)(localAddress6), (uint32)(localAddress7), (uint32)(localAddress8), (uint32)(localAddress9), (uint32)(localAddress10), (uint32)(localAddress11), &result) - return -} - -// StartConnect represents the imported method "start-connect". -// -// start-connect: func(network: borrow, remote-address: ip-socket-address) -// -> result<_, error-code> -// -//go:nosplit -func (self TCPSocket) StartConnect(network_ Network, remoteAddress IPSocketAddress) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - network0 := cm.Reinterpret[uint32](network_) - remoteAddress0, remoteAddress1, remoteAddress2, remoteAddress3, remoteAddress4, remoteAddress5, remoteAddress6, remoteAddress7, remoteAddress8, remoteAddress9, remoteAddress10, remoteAddress11 := lower_IPSocketAddress(remoteAddress) - wasmimport_TCPSocketStartConnect((uint32)(self0), (uint32)(network0), (uint32)(remoteAddress0), (uint32)(remoteAddress1), (uint32)(remoteAddress2), (uint32)(remoteAddress3), (uint32)(remoteAddress4), (uint32)(remoteAddress5), (uint32)(remoteAddress6), (uint32)(remoteAddress7), (uint32)(remoteAddress8), (uint32)(remoteAddress9), (uint32)(remoteAddress10), (uint32)(remoteAddress11), &result) - return -} - -// StartListen represents the imported method "start-listen". -// -// start-listen: func() -> result<_, error-code> -// -//go:nosplit -func (self TCPSocket) StartListen() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketStartListen((uint32)(self0), &result) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -> pollable -// -//go:nosplit -func (self TCPSocket) Subscribe() (result Pollable) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_TCPSocketSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) - return -} diff --git a/examples/component/invoke/gen/wasi/sockets/udp-create-socket/empty.s b/examples/component/invoke/gen/wasi/sockets/udp-create-socket/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/sockets/udp-create-socket/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go b/examples/component/invoke/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go deleted file mode 100644 index 770343b3..00000000 --- a/examples/component/invoke/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package udpcreatesocket represents the imported interface "wasi:sockets/udp-create-socket@0.2.0". -package udpcreatesocket - -import ( - "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/sockets/network" - "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/sockets/udp" - "go.bytecodealliance.org/cm" -) - -// Network represents the imported type alias "wasi:sockets/udp-create-socket@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// ErrorCode represents the type alias "wasi:sockets/udp-create-socket@0.2.0#error-code". -// -// See [network.ErrorCode] for more information. -type ErrorCode = network.ErrorCode - -// IPAddressFamily represents the type alias "wasi:sockets/udp-create-socket@0.2.0#ip-address-family". -// -// See [network.IPAddressFamily] for more information. -type IPAddressFamily = network.IPAddressFamily - -// UDPSocket represents the imported type alias "wasi:sockets/udp-create-socket@0.2.0#udp-socket". -// -// See [udp.UDPSocket] for more information. -type UDPSocket = udp.UDPSocket - -// CreateUDPSocket represents the imported function "create-udp-socket". -// -// create-udp-socket: func(address-family: ip-address-family) -> result -// -//go:nosplit -func CreateUDPSocket(addressFamily IPAddressFamily) (result cm.Result[UDPSocket, UDPSocket, ErrorCode]) { - addressFamily0 := (uint32)(addressFamily) - wasmimport_CreateUDPSocket((uint32)(addressFamily0), &result) - return -} diff --git a/examples/component/invoke/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go b/examples/component/invoke/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go deleted file mode 100755 index 94b1ab67..00000000 --- a/examples/component/invoke/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package udpcreatesocket - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/udp-create-socket@0.2.0 create-udp-socket -//go:noescape -func wasmimport_CreateUDPSocket(addressFamily0 uint32, result *cm.Result[UDPSocket, UDPSocket, ErrorCode]) diff --git a/examples/component/invoke/gen/wasi/sockets/udp/abi.go b/examples/component/invoke/gen/wasi/sockets/udp/abi.go deleted file mode 100644 index 3cdc2717..00000000 --- a/examples/component/invoke/gen/wasi/sockets/udp/abi.go +++ /dev/null @@ -1,103 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package udp - -import ( - "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/sockets/network" - "go.bytecodealliance.org/cm" - "unsafe" -) - -// IPSocketAddressShape is used for storage in variant or result types. -type IPSocketAddressShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(network.IPSocketAddress{})]byte -} - -func lower_IPv4Address(v network.IPv4Address) (f0 uint32, f1 uint32, f2 uint32, f3 uint32) { - f0 = (uint32)(v[0]) - f1 = (uint32)(v[1]) - f2 = (uint32)(v[2]) - f3 = (uint32)(v[3]) - return -} - -func lower_IPv4SocketAddress(v network.IPv4SocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32) { - f0 = (uint32)(v.Port) - f1, f2, f3, f4 = lower_IPv4Address(v.Address) - return -} - -func lower_IPv6Address(v network.IPv6Address) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32) { - f0 = (uint32)(v[0]) - f1 = (uint32)(v[1]) - f2 = (uint32)(v[2]) - f3 = (uint32)(v[3]) - f4 = (uint32)(v[4]) - f5 = (uint32)(v[5]) - f6 = (uint32)(v[6]) - f7 = (uint32)(v[7]) - return -} - -func lower_IPv6SocketAddress(v network.IPv6SocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32) { - f0 = (uint32)(v.Port) - f1 = (uint32)(v.FlowInfo) - f2, f3, f4, f5, f6, f7, f8, f9 = lower_IPv6Address(v.Address) - f10 = (uint32)(v.ScopeID) - return -} - -func lower_IPSocketAddress(v network.IPSocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32, f11 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 0: // ipv4 - v1, v2, v3, v4, v5 := lower_IPv4SocketAddress(*cm.Case[network.IPv4SocketAddress](&v, 0)) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 1: // ipv6 - v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11 := lower_IPv6SocketAddress(*cm.Case[network.IPv6SocketAddress](&v, 1)) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - f6 = (uint32)(v6) - f7 = (uint32)(v7) - f8 = (uint32)(v8) - f9 = (uint32)(v9) - f10 = (uint32)(v10) - f11 = (uint32)(v11) - } - return -} - -// TupleIncomingDatagramStreamOutgoingDatagramStreamShape is used for storage in variant or result types. -type TupleIncomingDatagramStreamOutgoingDatagramStreamShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Tuple[IncomingDatagramStream, OutgoingDatagramStream]{})]byte -} - -func lower_OptionIPSocketAddress(v cm.Option[IPSocketAddress]) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32, f11 uint32, f12 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12 := lower_IPSocketAddress(*some) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - f6 = (uint32)(v6) - f7 = (uint32)(v7) - f8 = (uint32)(v8) - f9 = (uint32)(v9) - f10 = (uint32)(v10) - f11 = (uint32)(v11) - f12 = (uint32)(v12) - } - return -} diff --git a/examples/component/invoke/gen/wasi/sockets/udp/empty.s b/examples/component/invoke/gen/wasi/sockets/udp/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasi/sockets/udp/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasi/sockets/udp/udp.wasm.go b/examples/component/invoke/gen/wasi/sockets/udp/udp.wasm.go deleted file mode 100755 index 83ce8ca7..00000000 --- a/examples/component/invoke/gen/wasi/sockets/udp/udp.wasm.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package udp - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/udp@0.2.0 [resource-drop]udp-socket -//go:noescape -func wasmimport_UDPSocketResourceDrop(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.address-family -//go:noescape -func wasmimport_UDPSocketAddressFamily(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.finish-bind -//go:noescape -func wasmimport_UDPSocketFinishBind(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.local-address -//go:noescape -func wasmimport_UDPSocketLocalAddress(self0 uint32, result *cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.receive-buffer-size -//go:noescape -func wasmimport_UDPSocketReceiveBufferSize(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.remote-address -//go:noescape -func wasmimport_UDPSocketRemoteAddress(self0 uint32, result *cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.send-buffer-size -//go:noescape -func wasmimport_UDPSocketSendBufferSize(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.set-receive-buffer-size -//go:noescape -func wasmimport_UDPSocketSetReceiveBufferSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.set-send-buffer-size -//go:noescape -func wasmimport_UDPSocketSetSendBufferSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.set-unicast-hop-limit -//go:noescape -func wasmimport_UDPSocketSetUnicastHopLimit(self0 uint32, value0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.start-bind -//go:noescape -func wasmimport_UDPSocketStartBind(self0 uint32, network0 uint32, localAddress0 uint32, localAddress1 uint32, localAddress2 uint32, localAddress3 uint32, localAddress4 uint32, localAddress5 uint32, localAddress6 uint32, localAddress7 uint32, localAddress8 uint32, localAddress9 uint32, localAddress10 uint32, localAddress11 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.stream -//go:noescape -func wasmimport_UDPSocketStream(self0 uint32, remoteAddress0 uint32, remoteAddress1 uint32, remoteAddress2 uint32, remoteAddress3 uint32, remoteAddress4 uint32, remoteAddress5 uint32, remoteAddress6 uint32, remoteAddress7 uint32, remoteAddress8 uint32, remoteAddress9 uint32, remoteAddress10 uint32, remoteAddress11 uint32, remoteAddress12 uint32, result *cm.Result[TupleIncomingDatagramStreamOutgoingDatagramStreamShape, cm.Tuple[IncomingDatagramStream, OutgoingDatagramStream], ErrorCode]) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.subscribe -//go:noescape -func wasmimport_UDPSocketSubscribe(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.unicast-hop-limit -//go:noescape -func wasmimport_UDPSocketUnicastHopLimit(self0 uint32, result *cm.Result[uint8, uint8, ErrorCode]) - -//go:wasmimport wasi:sockets/udp@0.2.0 [resource-drop]incoming-datagram-stream -//go:noescape -func wasmimport_IncomingDatagramStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]incoming-datagram-stream.receive -//go:noescape -func wasmimport_IncomingDatagramStreamReceive(self0 uint32, maxResults0 uint64, result *cm.Result[cm.List[IncomingDatagram], cm.List[IncomingDatagram], ErrorCode]) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]incoming-datagram-stream.subscribe -//go:noescape -func wasmimport_IncomingDatagramStreamSubscribe(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [resource-drop]outgoing-datagram-stream -//go:noescape -func wasmimport_OutgoingDatagramStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]outgoing-datagram-stream.check-send -//go:noescape -func wasmimport_OutgoingDatagramStreamCheckSend(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]outgoing-datagram-stream.send -//go:noescape -func wasmimport_OutgoingDatagramStreamSend(self0 uint32, datagrams0 *OutgoingDatagram, datagrams1 uint32, result *cm.Result[uint64, uint64, ErrorCode]) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]outgoing-datagram-stream.subscribe -//go:noescape -func wasmimport_OutgoingDatagramStreamSubscribe(self0 uint32) (result0 uint32) diff --git a/examples/component/invoke/gen/wasi/sockets/udp/udp.wit.go b/examples/component/invoke/gen/wasi/sockets/udp/udp.wit.go deleted file mode 100644 index 7d5919e8..00000000 --- a/examples/component/invoke/gen/wasi/sockets/udp/udp.wit.go +++ /dev/null @@ -1,319 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package udp represents the imported interface "wasi:sockets/udp@0.2.0". -package udp - -import ( - "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/io/poll" - "github.com/wasmCloud/go/examples/component/invoke/gen/wasi/sockets/network" - "go.bytecodealliance.org/cm" -) - -// Pollable represents the imported type alias "wasi:sockets/udp@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// Network represents the imported type alias "wasi:sockets/udp@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// ErrorCode represents the type alias "wasi:sockets/udp@0.2.0#error-code". -// -// See [network.ErrorCode] for more information. -type ErrorCode = network.ErrorCode - -// IPSocketAddress represents the type alias "wasi:sockets/udp@0.2.0#ip-socket-address". -// -// See [network.IPSocketAddress] for more information. -type IPSocketAddress = network.IPSocketAddress - -// IPAddressFamily represents the type alias "wasi:sockets/udp@0.2.0#ip-address-family". -// -// See [network.IPAddressFamily] for more information. -type IPAddressFamily = network.IPAddressFamily - -// IncomingDatagram represents the record "wasi:sockets/udp@0.2.0#incoming-datagram". -// -// record incoming-datagram { -// data: list, -// remote-address: ip-socket-address, -// } -type IncomingDatagram struct { - _ cm.HostLayout - Data cm.List[uint8] - RemoteAddress IPSocketAddress -} - -// OutgoingDatagram represents the record "wasi:sockets/udp@0.2.0#outgoing-datagram". -// -// record outgoing-datagram { -// data: list, -// remote-address: option, -// } -type OutgoingDatagram struct { - _ cm.HostLayout - Data cm.List[uint8] - RemoteAddress cm.Option[IPSocketAddress] -} - -// UDPSocket represents the imported resource "wasi:sockets/udp@0.2.0#udp-socket". -// -// resource udp-socket -type UDPSocket cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "udp-socket". -// -// Drops a resource handle. -// -//go:nosplit -func (self UDPSocket) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketResourceDrop((uint32)(self0)) - return -} - -// AddressFamily represents the imported method "address-family". -// -// address-family: func() -> ip-address-family -// -//go:nosplit -func (self UDPSocket) AddressFamily() (result IPAddressFamily) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_UDPSocketAddressFamily((uint32)(self0)) - result = (network.IPAddressFamily)((uint32)(result0)) - return -} - -// FinishBind represents the imported method "finish-bind". -// -// finish-bind: func() -> result<_, error-code> -// -//go:nosplit -func (self UDPSocket) FinishBind() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketFinishBind((uint32)(self0), &result) - return -} - -// LocalAddress represents the imported method "local-address". -// -// local-address: func() -> result -// -//go:nosplit -func (self UDPSocket) LocalAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketLocalAddress((uint32)(self0), &result) - return -} - -// ReceiveBufferSize represents the imported method "receive-buffer-size". -// -// receive-buffer-size: func() -> result -// -//go:nosplit -func (self UDPSocket) ReceiveBufferSize() (result cm.Result[uint64, uint64, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketReceiveBufferSize((uint32)(self0), &result) - return -} - -// RemoteAddress represents the imported method "remote-address". -// -// remote-address: func() -> result -// -//go:nosplit -func (self UDPSocket) RemoteAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketRemoteAddress((uint32)(self0), &result) - return -} - -// SendBufferSize represents the imported method "send-buffer-size". -// -// send-buffer-size: func() -> result -// -//go:nosplit -func (self UDPSocket) SendBufferSize() (result cm.Result[uint64, uint64, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketSendBufferSize((uint32)(self0), &result) - return -} - -// SetReceiveBufferSize represents the imported method "set-receive-buffer-size". -// -// set-receive-buffer-size: func(value: u64) -> result<_, error-code> -// -//go:nosplit -func (self UDPSocket) SetReceiveBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_UDPSocketSetReceiveBufferSize((uint32)(self0), (uint64)(value0), &result) - return -} - -// SetSendBufferSize represents the imported method "set-send-buffer-size". -// -// set-send-buffer-size: func(value: u64) -> result<_, error-code> -// -//go:nosplit -func (self UDPSocket) SetSendBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_UDPSocketSetSendBufferSize((uint32)(self0), (uint64)(value0), &result) - return -} - -// SetUnicastHopLimit represents the imported method "set-unicast-hop-limit". -// -// set-unicast-hop-limit: func(value: u8) -> result<_, error-code> -// -//go:nosplit -func (self UDPSocket) SetUnicastHopLimit(value uint8) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint32)(value) - wasmimport_UDPSocketSetUnicastHopLimit((uint32)(self0), (uint32)(value0), &result) - return -} - -// StartBind represents the imported method "start-bind". -// -// start-bind: func(network: borrow, local-address: ip-socket-address) -> -// result<_, error-code> -// -//go:nosplit -func (self UDPSocket) StartBind(network_ Network, localAddress IPSocketAddress) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - network0 := cm.Reinterpret[uint32](network_) - localAddress0, localAddress1, localAddress2, localAddress3, localAddress4, localAddress5, localAddress6, localAddress7, localAddress8, localAddress9, localAddress10, localAddress11 := lower_IPSocketAddress(localAddress) - wasmimport_UDPSocketStartBind((uint32)(self0), (uint32)(network0), (uint32)(localAddress0), (uint32)(localAddress1), (uint32)(localAddress2), (uint32)(localAddress3), (uint32)(localAddress4), (uint32)(localAddress5), (uint32)(localAddress6), (uint32)(localAddress7), (uint32)(localAddress8), (uint32)(localAddress9), (uint32)(localAddress10), (uint32)(localAddress11), &result) - return -} - -// Stream represents the imported method "stream". -// -// %stream: func(remote-address: option) -> result, error-code> -// -//go:nosplit -func (self UDPSocket) Stream(remoteAddress cm.Option[IPSocketAddress]) (result cm.Result[TupleIncomingDatagramStreamOutgoingDatagramStreamShape, cm.Tuple[IncomingDatagramStream, OutgoingDatagramStream], ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - remoteAddress0, remoteAddress1, remoteAddress2, remoteAddress3, remoteAddress4, remoteAddress5, remoteAddress6, remoteAddress7, remoteAddress8, remoteAddress9, remoteAddress10, remoteAddress11, remoteAddress12 := lower_OptionIPSocketAddress(remoteAddress) - wasmimport_UDPSocketStream((uint32)(self0), (uint32)(remoteAddress0), (uint32)(remoteAddress1), (uint32)(remoteAddress2), (uint32)(remoteAddress3), (uint32)(remoteAddress4), (uint32)(remoteAddress5), (uint32)(remoteAddress6), (uint32)(remoteAddress7), (uint32)(remoteAddress8), (uint32)(remoteAddress9), (uint32)(remoteAddress10), (uint32)(remoteAddress11), (uint32)(remoteAddress12), &result) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -> pollable -// -//go:nosplit -func (self UDPSocket) Subscribe() (result Pollable) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_UDPSocketSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) - return -} - -// UnicastHopLimit represents the imported method "unicast-hop-limit". -// -// unicast-hop-limit: func() -> result -// -//go:nosplit -func (self UDPSocket) UnicastHopLimit() (result cm.Result[uint8, uint8, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketUnicastHopLimit((uint32)(self0), &result) - return -} - -// IncomingDatagramStream represents the imported resource "wasi:sockets/udp@0.2.0#incoming-datagram-stream". -// -// resource incoming-datagram-stream -type IncomingDatagramStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "incoming-datagram-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self IncomingDatagramStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingDatagramStreamResourceDrop((uint32)(self0)) - return -} - -// Receive represents the imported method "receive". -// -// receive: func(max-results: u64) -> result, error-code> -// -//go:nosplit -func (self IncomingDatagramStream) Receive(maxResults uint64) (result cm.Result[cm.List[IncomingDatagram], cm.List[IncomingDatagram], ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - maxResults0 := (uint64)(maxResults) - wasmimport_IncomingDatagramStreamReceive((uint32)(self0), (uint64)(maxResults0), &result) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -> pollable -// -//go:nosplit -func (self IncomingDatagramStream) Subscribe() (result Pollable) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_IncomingDatagramStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) - return -} - -// OutgoingDatagramStream represents the imported resource "wasi:sockets/udp@0.2.0#outgoing-datagram-stream". -// -// resource outgoing-datagram-stream -type OutgoingDatagramStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "outgoing-datagram-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self OutgoingDatagramStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingDatagramStreamResourceDrop((uint32)(self0)) - return -} - -// CheckSend represents the imported method "check-send". -// -// check-send: func() -> result -// -//go:nosplit -func (self OutgoingDatagramStream) CheckSend() (result cm.Result[uint64, uint64, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingDatagramStreamCheckSend((uint32)(self0), &result) - return -} - -// Send represents the imported method "send". -// -// send: func(datagrams: list) -> result -// -//go:nosplit -func (self OutgoingDatagramStream) Send(datagrams cm.List[OutgoingDatagram]) (result cm.Result[uint64, uint64, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - datagrams0, datagrams1 := cm.LowerList(datagrams) - wasmimport_OutgoingDatagramStreamSend((uint32)(self0), (*OutgoingDatagram)(datagrams0), (uint32)(datagrams1), &result) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -> pollable -// -//go:nosplit -func (self OutgoingDatagramStream) Subscribe() (result Pollable) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutgoingDatagramStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) - return -} diff --git a/examples/component/invoke/gen/wasmcloud/bus/lattice/empty.s b/examples/component/invoke/gen/wasmcloud/bus/lattice/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasmcloud/bus/lattice/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasmcloud/bus/lattice/lattice.wasm.go b/examples/component/invoke/gen/wasmcloud/bus/lattice/lattice.wasm.go deleted file mode 100755 index 7c7b9094..00000000 --- a/examples/component/invoke/gen/wasmcloud/bus/lattice/lattice.wasm.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package lattice - -// This file contains wasmimport and wasmexport declarations for "wasmcloud:bus@1.0.0". - -//go:wasmimport wasmcloud:bus/lattice@1.0.0 [resource-drop]call-target-interface -//go:noescape -func wasmimport_CallTargetInterfaceResourceDrop(self0 uint32) - -//go:wasmimport wasmcloud:bus/lattice@1.0.0 [constructor]call-target-interface -//go:noescape -func wasmimport_NewCallTargetInterface(namespace0 *uint8, namespace1 uint32, package0 *uint8, package1 uint32, interface0 *uint8, interface1 uint32) (result0 uint32) - -//go:wasmimport wasmcloud:bus/lattice@1.0.0 set-link-name -//go:noescape -func wasmimport_SetLinkName(name0 *uint8, name1 uint32, interfaces0 *CallTargetInterface, interfaces1 uint32) diff --git a/examples/component/invoke/gen/wasmcloud/bus/lattice/lattice.wit.go b/examples/component/invoke/gen/wasmcloud/bus/lattice/lattice.wit.go deleted file mode 100644 index ba34d30c..00000000 --- a/examples/component/invoke/gen/wasmcloud/bus/lattice/lattice.wit.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package lattice represents the imported interface "wasmcloud:bus/lattice@1.0.0". -package lattice - -import ( - "go.bytecodealliance.org/cm" -) - -// CallTargetInterface represents the imported resource "wasmcloud:bus/lattice@1.0.0#call-target-interface". -// -// resource call-target-interface -type CallTargetInterface cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "call-target-interface". -// -// Drops a resource handle. -// -//go:nosplit -func (self CallTargetInterface) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_CallTargetInterfaceResourceDrop((uint32)(self0)) - return -} - -// NewCallTargetInterface represents the imported constructor for resource "call-target-interface". -// -// constructor(namespace: string, %package: string, %interface: string) -// -//go:nosplit -func NewCallTargetInterface(namespace string, package_ string, interface_ string) (result CallTargetInterface) { - namespace0, namespace1 := cm.LowerString(namespace) - package0, package1 := cm.LowerString(package_) - interface0, interface1 := cm.LowerString(interface_) - result0 := wasmimport_NewCallTargetInterface((*uint8)(namespace0), (uint32)(namespace1), (*uint8)(package0), (uint32)(package1), (*uint8)(interface0), (uint32)(interface1)) - result = cm.Reinterpret[CallTargetInterface]((uint32)(result0)) - return -} - -// SetLinkName represents the imported function "set-link-name". -// -// set-link-name: func(name: string, interfaces: list) -// -//go:nosplit -func SetLinkName(name string, interfaces cm.List[CallTargetInterface]) { - name0, name1 := cm.LowerString(name) - interfaces0, interfaces1 := cm.LowerList(interfaces) - wasmimport_SetLinkName((*uint8)(name0), (uint32)(name1), (*CallTargetInterface)(interfaces0), (uint32)(interfaces1)) - return -} diff --git a/examples/component/invoke/gen/wasmcloud/secrets/reveal/empty.s b/examples/component/invoke/gen/wasmcloud/secrets/reveal/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasmcloud/secrets/reveal/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasmcloud/secrets/reveal/reveal.wasm.go b/examples/component/invoke/gen/wasmcloud/secrets/reveal/reveal.wasm.go deleted file mode 100755 index 65404eb3..00000000 --- a/examples/component/invoke/gen/wasmcloud/secrets/reveal/reveal.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package reveal - -// This file contains wasmimport and wasmexport declarations for "wasmcloud:secrets@0.1.0-draft". - -//go:wasmimport wasmcloud:secrets/reveal@0.1.0-draft reveal -//go:noescape -func wasmimport_Reveal(s0 uint32, result *SecretValue) diff --git a/examples/component/invoke/gen/wasmcloud/secrets/reveal/reveal.wit.go b/examples/component/invoke/gen/wasmcloud/secrets/reveal/reveal.wit.go deleted file mode 100644 index c56aeddd..00000000 --- a/examples/component/invoke/gen/wasmcloud/secrets/reveal/reveal.wit.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package reveal represents the imported interface "wasmcloud:secrets/reveal@0.1.0-draft". -package reveal - -import ( - "github.com/wasmCloud/go/examples/component/invoke/gen/wasmcloud/secrets/store" - "go.bytecodealliance.org/cm" -) - -// Secret represents the imported type alias "wasmcloud:secrets/reveal@0.1.0-draft#secret". -// -// See [store.Secret] for more information. -type Secret = store.Secret - -// SecretValue represents the type alias "wasmcloud:secrets/reveal@0.1.0-draft#secret-value". -// -// See [store.SecretValue] for more information. -type SecretValue = store.SecretValue - -// Reveal represents the imported function "reveal". -// -// reveal: func(s: borrow) -> secret-value -// -//go:nosplit -func Reveal(s Secret) (result SecretValue) { - s0 := cm.Reinterpret[uint32](s) - wasmimport_Reveal((uint32)(s0), &result) - return -} diff --git a/examples/component/invoke/gen/wasmcloud/secrets/store/abi.go b/examples/component/invoke/gen/wasmcloud/secrets/store/abi.go deleted file mode 100644 index 20affd6c..00000000 --- a/examples/component/invoke/gen/wasmcloud/secrets/store/abi.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package store - -import ( - "go.bytecodealliance.org/cm" - "unsafe" -) - -// SecretsErrorShape is used for storage in variant or result types. -type SecretsErrorShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(SecretsError{})]byte -} diff --git a/examples/component/invoke/gen/wasmcloud/secrets/store/empty.s b/examples/component/invoke/gen/wasmcloud/secrets/store/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/invoke/gen/wasmcloud/secrets/store/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/invoke/gen/wasmcloud/secrets/store/store.wasm.go b/examples/component/invoke/gen/wasmcloud/secrets/store/store.wasm.go deleted file mode 100755 index cc94c517..00000000 --- a/examples/component/invoke/gen/wasmcloud/secrets/store/store.wasm.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package store - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasmcloud:secrets@0.1.0-draft". - -//go:wasmimport wasmcloud:secrets/store@0.1.0-draft [resource-drop]secret -//go:noescape -func wasmimport_SecretResourceDrop(self0 uint32) - -//go:wasmimport wasmcloud:secrets/store@0.1.0-draft get -//go:noescape -func wasmimport_Get(key0 *uint8, key1 uint32, result *cm.Result[SecretsErrorShape, Secret, SecretsError]) diff --git a/examples/component/invoke/gen/wasmcloud/secrets/store/store.wit.go b/examples/component/invoke/gen/wasmcloud/secrets/store/store.wit.go deleted file mode 100644 index d3465e4f..00000000 --- a/examples/component/invoke/gen/wasmcloud/secrets/store/store.wit.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package store represents the imported interface "wasmcloud:secrets/store@0.1.0-draft". -package store - -import ( - "go.bytecodealliance.org/cm" -) - -// SecretsError represents the variant "wasmcloud:secrets/store@0.1.0-draft#secrets-error". -// -// variant secrets-error { -// upstream(string), -// io(string), -// not-found, -// } -type SecretsError cm.Variant[uint8, string, string] - -// SecretsErrorUpstream returns a [SecretsError] of case "upstream". -func SecretsErrorUpstream(data string) SecretsError { - return cm.New[SecretsError](0, data) -} - -// Upstream returns a non-nil *[string] if [SecretsError] represents the variant case "upstream". -func (self *SecretsError) Upstream() *string { - return cm.Case[string](self, 0) -} - -// SecretsErrorIO returns a [SecretsError] of case "io". -func SecretsErrorIO(data string) SecretsError { - return cm.New[SecretsError](1, data) -} - -// IO returns a non-nil *[string] if [SecretsError] represents the variant case "io". -func (self *SecretsError) IO() *string { - return cm.Case[string](self, 1) -} - -// SecretsErrorNotFound returns a [SecretsError] of case "not-found". -func SecretsErrorNotFound() SecretsError { - var data struct{} - return cm.New[SecretsError](2, data) -} - -// NotFound returns true if [SecretsError] represents the variant case "not-found". -func (self *SecretsError) NotFound() bool { - return self.Tag() == 2 -} - -var stringsSecretsError = [3]string{ - "upstream", - "io", - "not-found", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v SecretsError) String() string { - return stringsSecretsError[v.Tag()] -} - -// SecretValue represents the variant "wasmcloud:secrets/store@0.1.0-draft#secret-value". -// -// variant secret-value { -// %string(string), -// bytes(list), -// } -type SecretValue cm.Variant[uint8, string, cm.List[uint8]] - -// SecretValueString_ returns a [SecretValue] of case "string". -func SecretValueString_(data string) SecretValue { - return cm.New[SecretValue](0, data) -} - -// String_ returns a non-nil *[string] if [SecretValue] represents the variant case "string". -func (self *SecretValue) String_() *string { - return cm.Case[string](self, 0) -} - -// SecretValueBytes returns a [SecretValue] of case "bytes". -func SecretValueBytes(data cm.List[uint8]) SecretValue { - return cm.New[SecretValue](1, data) -} - -// Bytes returns a non-nil *[cm.List[uint8]] if [SecretValue] represents the variant case "bytes". -func (self *SecretValue) Bytes() *cm.List[uint8] { - return cm.Case[cm.List[uint8]](self, 1) -} - -var stringsSecretValue = [2]string{ - "string", - "bytes", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v SecretValue) String() string { - return stringsSecretValue[v.Tag()] -} - -// Secret represents the imported resource "wasmcloud:secrets/store@0.1.0-draft#secret". -// -// resource secret -type Secret cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "secret". -// -// Drops a resource handle. -// -//go:nosplit -func (self Secret) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_SecretResourceDrop((uint32)(self0)) - return -} - -// Get represents the imported function "get". -// -// get: func(key: string) -> result -// -//go:nosplit -func Get(key string) (result cm.Result[SecretsErrorShape, Secret, SecretsError]) { - key0, key1 := cm.LowerString(key) - wasmimport_Get((*uint8)(key0), (uint32)(key1), &result) - return -} diff --git a/examples/component/sqldb-postgres-query/.gitignore b/examples/component/sqldb-postgres-query/.gitignore index 33b6ca45..beb98502 100644 --- a/examples/component/sqldb-postgres-query/.gitignore +++ b/examples/component/sqldb-postgres-query/.gitignore @@ -2,4 +2,5 @@ Cargo.lock # Wash build artifacts -build +gen/* +build/* diff --git a/examples/component/sqldb-postgres-query/gen/.gitkeep b/examples/component/sqldb-postgres-query/gen/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/environment/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/cli/environment/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/environment/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/environment/environment.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/cli/environment/environment.wasm.go deleted file mode 100755 index 89bb596b..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/environment/environment.wasm.go +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package environment - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/environment@0.2.0 get-environment -//go:noescape -func wasmimport_GetEnvironment(result *cm.List[[2]string]) - -//go:wasmimport wasi:cli/environment@0.2.0 get-arguments -//go:noescape -func wasmimport_GetArguments(result *cm.List[string]) - -//go:wasmimport wasi:cli/environment@0.2.0 initial-cwd -//go:noescape -func wasmimport_InitialCWD(result *cm.Option[string]) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/environment/environment.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/cli/environment/environment.wit.go deleted file mode 100644 index 068bed33..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/environment/environment.wit.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package environment represents the imported interface "wasi:cli/environment@0.2.0". -package environment - -import ( - "go.bytecodealliance.org/cm" -) - -// GetEnvironment represents the imported function "get-environment". -// -// get-environment: func() -> list> -// -//go:nosplit -func GetEnvironment() (result cm.List[[2]string]) { - wasmimport_GetEnvironment(&result) - return -} - -// GetArguments represents the imported function "get-arguments". -// -// get-arguments: func() -> list -// -//go:nosplit -func GetArguments() (result cm.List[string]) { - wasmimport_GetArguments(&result) - return -} - -// InitialCWD represents the imported function "initial-cwd". -// -// initial-cwd: func() -> option -// -//go:nosplit -func InitialCWD() (result cm.Option[string]) { - wasmimport_InitialCWD(&result) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/exit/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/cli/exit/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/exit/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/exit/exit.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/cli/exit/exit.wasm.go deleted file mode 100755 index 849d5f50..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/exit/exit.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package exit - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/exit@0.2.0 exit -//go:noescape -func wasmimport_Exit(status0 uint32) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/exit/exit.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/cli/exit/exit.wit.go deleted file mode 100644 index 7a347b60..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/exit/exit.wit.go +++ /dev/null @@ -1,19 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package exit represents the imported interface "wasi:cli/exit@0.2.0". -package exit - -import ( - "go.bytecodealliance.org/cm" -) - -// Exit represents the imported function "exit". -// -// exit: func(status: result) -// -//go:nosplit -func Exit(status cm.BoolResult) { - status0 := (uint32)(cm.BoolToU32(status)) - wasmimport_Exit((uint32)(status0)) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/stderr/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/cli/stderr/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/stderr/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/stderr/stderr.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/cli/stderr/stderr.wasm.go deleted file mode 100755 index 462cf172..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/stderr/stderr.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package stderr - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/stderr@0.2.0 get-stderr -//go:noescape -func wasmimport_GetStderr() (result0 uint32) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/stderr/stderr.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/cli/stderr/stderr.wit.go deleted file mode 100644 index 47723860..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/stderr/stderr.wit.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package stderr represents the imported interface "wasi:cli/stderr@0.2.0". -package stderr - -import ( - "go.bytecodealliance.org/cm" - "sqldb-postgres-query/gen/wasi/io/streams" -) - -// OutputStream represents the imported type alias "wasi:cli/stderr@0.2.0#output-stream". -// -// See [streams.OutputStream] for more information. -type OutputStream = streams.OutputStream - -// GetStderr represents the imported function "get-stderr". -// -// get-stderr: func() -> output-stream -// -//go:nosplit -func GetStderr() (result OutputStream) { - result0 := wasmimport_GetStderr() - result = cm.Reinterpret[OutputStream]((uint32)(result0)) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/stdin/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/cli/stdin/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/stdin/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/stdin/stdin.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/cli/stdin/stdin.wasm.go deleted file mode 100755 index 374eb253..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/stdin/stdin.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package stdin - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/stdin@0.2.0 get-stdin -//go:noescape -func wasmimport_GetStdin() (result0 uint32) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/stdin/stdin.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/cli/stdin/stdin.wit.go deleted file mode 100644 index d3b23852..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/stdin/stdin.wit.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package stdin represents the imported interface "wasi:cli/stdin@0.2.0". -package stdin - -import ( - "go.bytecodealliance.org/cm" - "sqldb-postgres-query/gen/wasi/io/streams" -) - -// InputStream represents the imported type alias "wasi:cli/stdin@0.2.0#input-stream". -// -// See [streams.InputStream] for more information. -type InputStream = streams.InputStream - -// GetStdin represents the imported function "get-stdin". -// -// get-stdin: func() -> input-stream -// -//go:nosplit -func GetStdin() (result InputStream) { - result0 := wasmimport_GetStdin() - result = cm.Reinterpret[InputStream]((uint32)(result0)) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/stdout/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/cli/stdout/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/stdout/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/stdout/stdout.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/cli/stdout/stdout.wasm.go deleted file mode 100755 index 68e4a3da..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/stdout/stdout.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package stdout - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/stdout@0.2.0 get-stdout -//go:noescape -func wasmimport_GetStdout() (result0 uint32) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/stdout/stdout.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/cli/stdout/stdout.wit.go deleted file mode 100644 index 95b37b4f..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/stdout/stdout.wit.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package stdout represents the imported interface "wasi:cli/stdout@0.2.0". -package stdout - -import ( - "go.bytecodealliance.org/cm" - "sqldb-postgres-query/gen/wasi/io/streams" -) - -// OutputStream represents the imported type alias "wasi:cli/stdout@0.2.0#output-stream". -// -// See [streams.OutputStream] for more information. -type OutputStream = streams.OutputStream - -// GetStdout represents the imported function "get-stdout". -// -// get-stdout: func() -> output-stream -// -//go:nosplit -func GetStdout() (result OutputStream) { - result0 := wasmimport_GetStdout() - result = cm.Reinterpret[OutputStream]((uint32)(result0)) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-input/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-input/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-input/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-input/terminal-input.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-input/terminal-input.wit.go deleted file mode 100644 index 18b9a9d7..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-input/terminal-input.wit.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package terminalinput represents the imported interface "wasi:cli/terminal-input@0.2.0". -package terminalinput - -import ( - "go.bytecodealliance.org/cm" -) - -// TerminalInput represents the imported resource "wasi:cli/terminal-input@0.2.0#terminal-input". -// -// resource terminal-input -type TerminalInput cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "terminal-input". -// -// Drops a resource handle. -// -//go:nosplit -func (self TerminalInput) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TerminalInputResourceDrop((uint32)(self0)) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-input/terminalinput.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-input/terminalinput.wasm.go deleted file mode 100755 index 1df3794f..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-input/terminalinput.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package terminalinput - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/terminal-input@0.2.0 [resource-drop]terminal-input -//go:noescape -func wasmimport_TerminalInputResourceDrop(self0 uint32) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-output/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-output/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-output/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-output/terminal-output.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-output/terminal-output.wit.go deleted file mode 100644 index 823aaf52..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-output/terminal-output.wit.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package terminaloutput represents the imported interface "wasi:cli/terminal-output@0.2.0". -package terminaloutput - -import ( - "go.bytecodealliance.org/cm" -) - -// TerminalOutput represents the imported resource "wasi:cli/terminal-output@0.2.0#terminal-output". -// -// resource terminal-output -type TerminalOutput cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "terminal-output". -// -// Drops a resource handle. -// -//go:nosplit -func (self TerminalOutput) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TerminalOutputResourceDrop((uint32)(self0)) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-output/terminaloutput.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-output/terminaloutput.wasm.go deleted file mode 100755 index fb35fc41..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-output/terminaloutput.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package terminaloutput - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/terminal-output@0.2.0 [resource-drop]terminal-output -//go:noescape -func wasmimport_TerminalOutputResourceDrop(self0 uint32) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stderr/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stderr/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stderr/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go deleted file mode 100644 index 3a92d7db..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stderr/terminal-stderr.wit.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package terminalstderr represents the imported interface "wasi:cli/terminal-stderr@0.2.0". -package terminalstderr - -import ( - "go.bytecodealliance.org/cm" - terminaloutput "sqldb-postgres-query/gen/wasi/cli/terminal-output" -) - -// TerminalOutput represents the imported type alias "wasi:cli/terminal-stderr@0.2.0#terminal-output". -// -// See [terminaloutput.TerminalOutput] for more information. -type TerminalOutput = terminaloutput.TerminalOutput - -// GetTerminalStderr represents the imported function "get-terminal-stderr". -// -// get-terminal-stderr: func() -> option -// -//go:nosplit -func GetTerminalStderr() (result cm.Option[TerminalOutput]) { - wasmimport_GetTerminalStderr(&result) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go deleted file mode 100755 index be9af72f..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stderr/terminalstderr.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package terminalstderr - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/terminal-stderr@0.2.0 get-terminal-stderr -//go:noescape -func wasmimport_GetTerminalStderr(result *cm.Option[TerminalOutput]) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stdin/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stdin/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stdin/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go deleted file mode 100644 index 0cafe436..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stdin/terminal-stdin.wit.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package terminalstdin represents the imported interface "wasi:cli/terminal-stdin@0.2.0". -package terminalstdin - -import ( - "go.bytecodealliance.org/cm" - terminalinput "sqldb-postgres-query/gen/wasi/cli/terminal-input" -) - -// TerminalInput represents the imported type alias "wasi:cli/terminal-stdin@0.2.0#terminal-input". -// -// See [terminalinput.TerminalInput] for more information. -type TerminalInput = terminalinput.TerminalInput - -// GetTerminalStdin represents the imported function "get-terminal-stdin". -// -// get-terminal-stdin: func() -> option -// -//go:nosplit -func GetTerminalStdin() (result cm.Option[TerminalInput]) { - wasmimport_GetTerminalStdin(&result) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go deleted file mode 100755 index e3b3ac61..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stdin/terminalstdin.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package terminalstdin - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/terminal-stdin@0.2.0 get-terminal-stdin -//go:noescape -func wasmimport_GetTerminalStdin(result *cm.Option[TerminalInput]) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stdout/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stdout/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stdout/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go deleted file mode 100644 index 408815b7..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stdout/terminal-stdout.wit.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package terminalstdout represents the imported interface "wasi:cli/terminal-stdout@0.2.0". -package terminalstdout - -import ( - "go.bytecodealliance.org/cm" - terminaloutput "sqldb-postgres-query/gen/wasi/cli/terminal-output" -) - -// TerminalOutput represents the imported type alias "wasi:cli/terminal-stdout@0.2.0#terminal-output". -// -// See [terminaloutput.TerminalOutput] for more information. -type TerminalOutput = terminaloutput.TerminalOutput - -// GetTerminalStdout represents the imported function "get-terminal-stdout". -// -// get-terminal-stdout: func() -> option -// -//go:nosplit -func GetTerminalStdout() (result cm.Option[TerminalOutput]) { - wasmimport_GetTerminalStdout(&result) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go deleted file mode 100755 index fa750ad9..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/cli/terminal-stdout/terminalstdout.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package terminalstdout - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:cli@0.2.0". - -//go:wasmimport wasi:cli/terminal-stdout@0.2.0 get-terminal-stdout -//go:noescape -func wasmimport_GetTerminalStdout(result *cm.Option[TerminalOutput]) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/clocks/monotonic-clock/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/clocks/monotonic-clock/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/clocks/monotonic-clock/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go deleted file mode 100644 index c8a17bbd..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/clocks/monotonic-clock/monotonic-clock.wit.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package monotonicclock represents the imported interface "wasi:clocks/monotonic-clock@0.2.0". -package monotonicclock - -import ( - "go.bytecodealliance.org/cm" - "sqldb-postgres-query/gen/wasi/io/poll" -) - -// Pollable represents the imported type alias "wasi:clocks/monotonic-clock@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// Instant represents the u64 "wasi:clocks/monotonic-clock@0.2.0#instant". -// -// type instant = u64 -type Instant uint64 - -// Duration represents the u64 "wasi:clocks/monotonic-clock@0.2.0#duration". -// -// type duration = u64 -type Duration uint64 - -// Now represents the imported function "now". -// -// now: func() -> instant -// -//go:nosplit -func Now() (result Instant) { - result0 := wasmimport_Now() - result = (Instant)((uint64)(result0)) - return -} - -// Resolution represents the imported function "resolution". -// -// resolution: func() -> duration -// -//go:nosplit -func Resolution() (result Duration) { - result0 := wasmimport_Resolution() - result = (Duration)((uint64)(result0)) - return -} - -// SubscribeInstant represents the imported function "subscribe-instant". -// -// subscribe-instant: func(when: instant) -> pollable -// -//go:nosplit -func SubscribeInstant(when Instant) (result Pollable) { - when0 := (uint64)(when) - result0 := wasmimport_SubscribeInstant((uint64)(when0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) - return -} - -// SubscribeDuration represents the imported function "subscribe-duration". -// -// subscribe-duration: func(when: duration) -> pollable -// -//go:nosplit -func SubscribeDuration(when Duration) (result Pollable) { - when0 := (uint64)(when) - result0 := wasmimport_SubscribeDuration((uint64)(when0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go deleted file mode 100755 index 36a1720a..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/clocks/monotonic-clock/monotonicclock.wasm.go +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package monotonicclock - -// This file contains wasmimport and wasmexport declarations for "wasi:clocks@0.2.0". - -//go:wasmimport wasi:clocks/monotonic-clock@0.2.0 now -//go:noescape -func wasmimport_Now() (result0 uint64) - -//go:wasmimport wasi:clocks/monotonic-clock@0.2.0 resolution -//go:noescape -func wasmimport_Resolution() (result0 uint64) - -//go:wasmimport wasi:clocks/monotonic-clock@0.2.0 subscribe-instant -//go:noescape -func wasmimport_SubscribeInstant(when0 uint64) (result0 uint32) - -//go:wasmimport wasi:clocks/monotonic-clock@0.2.0 subscribe-duration -//go:noescape -func wasmimport_SubscribeDuration(when0 uint64) (result0 uint32) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/clocks/wall-clock/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/clocks/wall-clock/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/clocks/wall-clock/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/clocks/wall-clock/wall-clock.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/clocks/wall-clock/wall-clock.wit.go deleted file mode 100644 index e3f35395..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/clocks/wall-clock/wall-clock.wit.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package wallclock represents the imported interface "wasi:clocks/wall-clock@0.2.0". -package wallclock - -import ( - "go.bytecodealliance.org/cm" -) - -// DateTime represents the record "wasi:clocks/wall-clock@0.2.0#datetime". -// -// record datetime { -// seconds: u64, -// nanoseconds: u32, -// } -type DateTime struct { - _ cm.HostLayout - Seconds uint64 - Nanoseconds uint32 -} - -// Now represents the imported function "now". -// -// now: func() -> datetime -// -//go:nosplit -func Now() (result DateTime) { - wasmimport_Now(&result) - return -} - -// Resolution represents the imported function "resolution". -// -// resolution: func() -> datetime -// -//go:nosplit -func Resolution() (result DateTime) { - wasmimport_Resolution(&result) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/clocks/wall-clock/wallclock.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/clocks/wall-clock/wallclock.wasm.go deleted file mode 100755 index 321ff3f1..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/clocks/wall-clock/wallclock.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package wallclock - -// This file contains wasmimport and wasmexport declarations for "wasi:clocks@0.2.0". - -//go:wasmimport wasi:clocks/wall-clock@0.2.0 now -//go:noescape -func wasmimport_Now(result *DateTime) - -//go:wasmimport wasi:clocks/wall-clock@0.2.0 resolution -//go:noescape -func wasmimport_Resolution(result *DateTime) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/config/runtime/abi.go b/examples/component/sqldb-postgres-query/gen/wasi/config/runtime/abi.go deleted file mode 100644 index 61412cbe..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/config/runtime/abi.go +++ /dev/null @@ -1,20 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package runtime - -import ( - "go.bytecodealliance.org/cm" - "unsafe" -) - -// OptionStringShape is used for storage in variant or result types. -type OptionStringShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Option[string]{})]byte -} - -// ConfigErrorShape is used for storage in variant or result types. -type ConfigErrorShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(ConfigError{})]byte -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/config/runtime/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/config/runtime/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/config/runtime/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/config/runtime/runtime.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/config/runtime/runtime.wasm.go deleted file mode 100755 index 8ce17d5e..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/config/runtime/runtime.wasm.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package runtime - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:config@0.2.0-draft". - -//go:wasmimport wasi:config/runtime@0.2.0-draft get -//go:noescape -func wasmimport_Get(key0 *uint8, key1 uint32, result *cm.Result[OptionStringShape, cm.Option[string], ConfigError]) - -//go:wasmimport wasi:config/runtime@0.2.0-draft get-all -//go:noescape -func wasmimport_GetAll(result *cm.Result[ConfigErrorShape, cm.List[[2]string], ConfigError]) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/config/runtime/runtime.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/config/runtime/runtime.wit.go deleted file mode 100644 index 99a739d1..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/config/runtime/runtime.wit.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package runtime represents the imported interface "wasi:config/runtime@0.2.0-draft". -package runtime - -import ( - "go.bytecodealliance.org/cm" -) - -// ConfigError represents the variant "wasi:config/runtime@0.2.0-draft#config-error". -// -// variant config-error { -// upstream(string), -// io(string), -// } -type ConfigError cm.Variant[uint8, string, string] - -// ConfigErrorUpstream returns a [ConfigError] of case "upstream". -func ConfigErrorUpstream(data string) ConfigError { - return cm.New[ConfigError](0, data) -} - -// Upstream returns a non-nil *[string] if [ConfigError] represents the variant case "upstream". -func (self *ConfigError) Upstream() *string { - return cm.Case[string](self, 0) -} - -// ConfigErrorIO returns a [ConfigError] of case "io". -func ConfigErrorIO(data string) ConfigError { - return cm.New[ConfigError](1, data) -} - -// IO returns a non-nil *[string] if [ConfigError] represents the variant case "io". -func (self *ConfigError) IO() *string { - return cm.Case[string](self, 1) -} - -var stringsConfigError = [2]string{ - "upstream", - "io", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v ConfigError) String() string { - return stringsConfigError[v.Tag()] -} - -// Get represents the imported function "get". -// -// get: func(key: string) -> result, config-error> -// -//go:nosplit -func Get(key string) (result cm.Result[OptionStringShape, cm.Option[string], ConfigError]) { - key0, key1 := cm.LowerString(key) - wasmimport_Get((*uint8)(key0), (uint32)(key1), &result) - return -} - -// GetAll represents the imported function "get-all". -// -// get-all: func() -> result>, config-error> -// -//go:nosplit -func GetAll() (result cm.Result[ConfigErrorShape, cm.List[[2]string], ConfigError]) { - wasmimport_GetAll(&result) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/filesystem/preopens/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/filesystem/preopens/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/filesystem/preopens/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/filesystem/preopens/preopens.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/filesystem/preopens/preopens.wasm.go deleted file mode 100755 index 1bcd416a..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/filesystem/preopens/preopens.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package preopens - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:filesystem@0.2.0". - -//go:wasmimport wasi:filesystem/preopens@0.2.0 get-directories -//go:noescape -func wasmimport_GetDirectories(result *cm.List[cm.Tuple[Descriptor, string]]) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/filesystem/preopens/preopens.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/filesystem/preopens/preopens.wit.go deleted file mode 100644 index 96b61e1e..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/filesystem/preopens/preopens.wit.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package preopens represents the imported interface "wasi:filesystem/preopens@0.2.0". -package preopens - -import ( - "go.bytecodealliance.org/cm" - "sqldb-postgres-query/gen/wasi/filesystem/types" -) - -// Descriptor represents the imported type alias "wasi:filesystem/preopens@0.2.0#descriptor". -// -// See [types.Descriptor] for more information. -type Descriptor = types.Descriptor - -// GetDirectories represents the imported function "get-directories". -// -// get-directories: func() -> list> -// -//go:nosplit -func GetDirectories() (result cm.List[cm.Tuple[Descriptor, string]]) { - wasmimport_GetDirectories(&result) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/filesystem/types/abi.go b/examples/component/sqldb-postgres-query/gen/wasi/filesystem/types/abi.go deleted file mode 100644 index 6287359b..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/filesystem/types/abi.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package types - -import ( - "go.bytecodealliance.org/cm" - wallclock "sqldb-postgres-query/gen/wasi/clocks/wall-clock" - "unsafe" -) - -// MetadataHashValueShape is used for storage in variant or result types. -type MetadataHashValueShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(MetadataHashValue{})]byte -} - -// TupleListU8BoolShape is used for storage in variant or result types. -type TupleListU8BoolShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Tuple[cm.List[uint8], bool]{})]byte -} - -func lower_DateTime(v wallclock.DateTime) (f0 uint64, f1 uint32) { - f0 = (uint64)(v.Seconds) - f1 = (uint32)(v.Nanoseconds) - return -} - -func lower_NewTimestamp(v NewTimestamp) (f0 uint32, f1 uint64, f2 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 2: // timestamp - v1, v2 := lower_DateTime(*cm.Case[DateTime](&v, 2)) - f1 = (uint64)(v1) - f2 = (uint32)(v2) - } - return -} - -// DescriptorStatShape is used for storage in variant or result types. -type DescriptorStatShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(DescriptorStat{})]byte -} - -// OptionDirectoryEntryShape is used for storage in variant or result types. -type OptionDirectoryEntryShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Option[DirectoryEntry]{})]byte -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/filesystem/types/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/filesystem/types/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/filesystem/types/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/filesystem/types/types.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/filesystem/types/types.wasm.go deleted file mode 100755 index b97dad84..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/filesystem/types/types.wasm.go +++ /dev/null @@ -1,133 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package types - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:filesystem@0.2.0". - -//go:wasmimport wasi:filesystem/types@0.2.0 [resource-drop]descriptor -//go:noescape -func wasmimport_DescriptorResourceDrop(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.advise -//go:noescape -func wasmimport_DescriptorAdvise(self0 uint32, offset0 uint64, length0 uint64, advice0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.append-via-stream -//go:noescape -func wasmimport_DescriptorAppendViaStream(self0 uint32, result *cm.Result[OutputStream, OutputStream, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.create-directory-at -//go:noescape -func wasmimport_DescriptorCreateDirectoryAt(self0 uint32, path0 *uint8, path1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.get-flags -//go:noescape -func wasmimport_DescriptorGetFlags(self0 uint32, result *cm.Result[DescriptorFlags, DescriptorFlags, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.get-type -//go:noescape -func wasmimport_DescriptorGetType(self0 uint32, result *cm.Result[DescriptorType, DescriptorType, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.is-same-object -//go:noescape -func wasmimport_DescriptorIsSameObject(self0 uint32, other0 uint32) (result0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.link-at -//go:noescape -func wasmimport_DescriptorLinkAt(self0 uint32, oldPathFlags0 uint32, oldPath0 *uint8, oldPath1 uint32, newDescriptor0 uint32, newPath0 *uint8, newPath1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.metadata-hash -//go:noescape -func wasmimport_DescriptorMetadataHash(self0 uint32, result *cm.Result[MetadataHashValueShape, MetadataHashValue, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.metadata-hash-at -//go:noescape -func wasmimport_DescriptorMetadataHashAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, result *cm.Result[MetadataHashValueShape, MetadataHashValue, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.open-at -//go:noescape -func wasmimport_DescriptorOpenAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, openFlags0 uint32, flags0 uint32, result *cm.Result[Descriptor, Descriptor, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.read -//go:noescape -func wasmimport_DescriptorRead(self0 uint32, length0 uint64, offset0 uint64, result *cm.Result[TupleListU8BoolShape, cm.Tuple[cm.List[uint8], bool], ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.read-directory -//go:noescape -func wasmimport_DescriptorReadDirectory(self0 uint32, result *cm.Result[DirectoryEntryStream, DirectoryEntryStream, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.read-via-stream -//go:noescape -func wasmimport_DescriptorReadViaStream(self0 uint32, offset0 uint64, result *cm.Result[InputStream, InputStream, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.readlink-at -//go:noescape -func wasmimport_DescriptorReadLinkAt(self0 uint32, path0 *uint8, path1 uint32, result *cm.Result[string, string, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.remove-directory-at -//go:noescape -func wasmimport_DescriptorRemoveDirectoryAt(self0 uint32, path0 *uint8, path1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.rename-at -//go:noescape -func wasmimport_DescriptorRenameAt(self0 uint32, oldPath0 *uint8, oldPath1 uint32, newDescriptor0 uint32, newPath0 *uint8, newPath1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.set-size -//go:noescape -func wasmimport_DescriptorSetSize(self0 uint32, size0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.set-times -//go:noescape -func wasmimport_DescriptorSetTimes(self0 uint32, dataAccessTimestamp0 uint32, dataAccessTimestamp1 uint64, dataAccessTimestamp2 uint32, dataModificationTimestamp0 uint32, dataModificationTimestamp1 uint64, dataModificationTimestamp2 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.set-times-at -//go:noescape -func wasmimport_DescriptorSetTimesAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, dataAccessTimestamp0 uint32, dataAccessTimestamp1 uint64, dataAccessTimestamp2 uint32, dataModificationTimestamp0 uint32, dataModificationTimestamp1 uint64, dataModificationTimestamp2 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.stat -//go:noescape -func wasmimport_DescriptorStat(self0 uint32, result *cm.Result[DescriptorStatShape, DescriptorStat, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.stat-at -//go:noescape -func wasmimport_DescriptorStatAt(self0 uint32, pathFlags0 uint32, path0 *uint8, path1 uint32, result *cm.Result[DescriptorStatShape, DescriptorStat, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.symlink-at -//go:noescape -func wasmimport_DescriptorSymlinkAt(self0 uint32, oldPath0 *uint8, oldPath1 uint32, newPath0 *uint8, newPath1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.sync -//go:noescape -func wasmimport_DescriptorSync(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.sync-data -//go:noescape -func wasmimport_DescriptorSyncData(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.unlink-file-at -//go:noescape -func wasmimport_DescriptorUnlinkFileAt(self0 uint32, path0 *uint8, path1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.write -//go:noescape -func wasmimport_DescriptorWrite(self0 uint32, buffer0 *uint8, buffer1 uint32, offset0 uint64, result *cm.Result[uint64, FileSize, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]descriptor.write-via-stream -//go:noescape -func wasmimport_DescriptorWriteViaStream(self0 uint32, offset0 uint64, result *cm.Result[OutputStream, OutputStream, ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 [resource-drop]directory-entry-stream -//go:noescape -func wasmimport_DirectoryEntryStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:filesystem/types@0.2.0 [method]directory-entry-stream.read-directory-entry -//go:noescape -func wasmimport_DirectoryEntryStreamReadDirectoryEntry(self0 uint32, result *cm.Result[OptionDirectoryEntryShape, cm.Option[DirectoryEntry], ErrorCode]) - -//go:wasmimport wasi:filesystem/types@0.2.0 filesystem-error-code -//go:noescape -func wasmimport_FilesystemErrorCode(err0 uint32, result *cm.Option[ErrorCode]) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/filesystem/types/types.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/filesystem/types/types.wit.go deleted file mode 100644 index 5af96e5e..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/filesystem/types/types.wit.go +++ /dev/null @@ -1,787 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package types represents the imported interface "wasi:filesystem/types@0.2.0". -package types - -import ( - "go.bytecodealliance.org/cm" - wallclock "sqldb-postgres-query/gen/wasi/clocks/wall-clock" - "sqldb-postgres-query/gen/wasi/io/streams" -) - -// InputStream represents the imported type alias "wasi:filesystem/types@0.2.0#input-stream". -// -// See [streams.InputStream] for more information. -type InputStream = streams.InputStream - -// OutputStream represents the imported type alias "wasi:filesystem/types@0.2.0#output-stream". -// -// See [streams.OutputStream] for more information. -type OutputStream = streams.OutputStream - -// Error represents the imported type alias "wasi:filesystem/types@0.2.0#error". -// -// See [streams.Error] for more information. -type Error = streams.Error - -// DateTime represents the type alias "wasi:filesystem/types@0.2.0#datetime". -// -// See [wallclock.DateTime] for more information. -type DateTime = wallclock.DateTime - -// FileSize represents the u64 "wasi:filesystem/types@0.2.0#filesize". -// -// type filesize = u64 -type FileSize uint64 - -// DescriptorType represents the enum "wasi:filesystem/types@0.2.0#descriptor-type". -// -// enum descriptor-type { -// unknown, -// block-device, -// character-device, -// directory, -// fifo, -// symbolic-link, -// regular-file, -// socket -// } -type DescriptorType uint8 - -const ( - DescriptorTypeUnknown DescriptorType = iota - DescriptorTypeBlockDevice - DescriptorTypeCharacterDevice - DescriptorTypeDirectory - DescriptorTypeFIFO - DescriptorTypeSymbolicLink - DescriptorTypeRegularFile - DescriptorTypeSocket -) - -var stringsDescriptorType = [8]string{ - "unknown", - "block-device", - "character-device", - "directory", - "fifo", - "symbolic-link", - "regular-file", - "socket", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e DescriptorType) String() string { - return stringsDescriptorType[e] -} - -// DescriptorFlags represents the flags "wasi:filesystem/types@0.2.0#descriptor-flags". -// -// flags descriptor-flags { -// read, -// write, -// file-integrity-sync, -// data-integrity-sync, -// requested-write-sync, -// mutate-directory, -// } -type DescriptorFlags uint8 - -const ( - DescriptorFlagsRead DescriptorFlags = 1 << iota - DescriptorFlagsWrite - DescriptorFlagsFileIntegritySync - DescriptorFlagsDataIntegritySync - DescriptorFlagsRequestedWriteSync - DescriptorFlagsMutateDirectory -) - -// PathFlags represents the flags "wasi:filesystem/types@0.2.0#path-flags". -// -// flags path-flags { -// symlink-follow, -// } -type PathFlags uint8 - -const ( - PathFlagsSymlinkFollow PathFlags = 1 << iota -) - -// OpenFlags represents the flags "wasi:filesystem/types@0.2.0#open-flags". -// -// flags open-flags { -// create, -// directory, -// exclusive, -// truncate, -// } -type OpenFlags uint8 - -const ( - OpenFlagsCreate OpenFlags = 1 << iota - OpenFlagsDirectory - OpenFlagsExclusive - OpenFlagsTruncate -) - -// LinkCount represents the u64 "wasi:filesystem/types@0.2.0#link-count". -// -// type link-count = u64 -type LinkCount uint64 - -// DescriptorStat represents the record "wasi:filesystem/types@0.2.0#descriptor-stat". -// -// record descriptor-stat { -// %type: descriptor-type, -// link-count: link-count, -// size: filesize, -// data-access-timestamp: option, -// data-modification-timestamp: option, -// status-change-timestamp: option, -// } -type DescriptorStat struct { - _ cm.HostLayout - Type DescriptorType - LinkCount LinkCount - Size FileSize - DataAccessTimestamp cm.Option[DateTime] - DataModificationTimestamp cm.Option[DateTime] - StatusChangeTimestamp cm.Option[DateTime] -} - -// NewTimestamp represents the variant "wasi:filesystem/types@0.2.0#new-timestamp". -// -// variant new-timestamp { -// no-change, -// now, -// timestamp(datetime), -// } -type NewTimestamp cm.Variant[uint8, DateTime, DateTime] - -// NewTimestampNoChange returns a [NewTimestamp] of case "no-change". -func NewTimestampNoChange() NewTimestamp { - var data struct{} - return cm.New[NewTimestamp](0, data) -} - -// NoChange returns true if [NewTimestamp] represents the variant case "no-change". -func (self *NewTimestamp) NoChange() bool { - return self.Tag() == 0 -} - -// NewTimestampNow returns a [NewTimestamp] of case "now". -func NewTimestampNow() NewTimestamp { - var data struct{} - return cm.New[NewTimestamp](1, data) -} - -// Now returns true if [NewTimestamp] represents the variant case "now". -func (self *NewTimestamp) Now() bool { - return self.Tag() == 1 -} - -// NewTimestampTimestamp returns a [NewTimestamp] of case "timestamp". -func NewTimestampTimestamp(data DateTime) NewTimestamp { - return cm.New[NewTimestamp](2, data) -} - -// Timestamp returns a non-nil *[DateTime] if [NewTimestamp] represents the variant case "timestamp". -func (self *NewTimestamp) Timestamp() *DateTime { - return cm.Case[DateTime](self, 2) -} - -var stringsNewTimestamp = [3]string{ - "no-change", - "now", - "timestamp", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v NewTimestamp) String() string { - return stringsNewTimestamp[v.Tag()] -} - -// DirectoryEntry represents the record "wasi:filesystem/types@0.2.0#directory-entry". -// -// record directory-entry { -// %type: descriptor-type, -// name: string, -// } -type DirectoryEntry struct { - _ cm.HostLayout - Type DescriptorType - Name string -} - -// ErrorCode represents the enum "wasi:filesystem/types@0.2.0#error-code". -// -// enum error-code { -// access, -// would-block, -// already, -// bad-descriptor, -// busy, -// deadlock, -// quota, -// exist, -// file-too-large, -// illegal-byte-sequence, -// in-progress, -// interrupted, -// invalid, -// io, -// is-directory, -// loop, -// too-many-links, -// message-size, -// name-too-long, -// no-device, -// no-entry, -// no-lock, -// insufficient-memory, -// insufficient-space, -// not-directory, -// not-empty, -// not-recoverable, -// unsupported, -// no-tty, -// no-such-device, -// overflow, -// not-permitted, -// pipe, -// read-only, -// invalid-seek, -// text-file-busy, -// cross-device -// } -type ErrorCode uint8 - -const ( - ErrorCodeAccess ErrorCode = iota - ErrorCodeWouldBlock - ErrorCodeAlready - ErrorCodeBadDescriptor - ErrorCodeBusy - ErrorCodeDeadlock - ErrorCodeQuota - ErrorCodeExist - ErrorCodeFileTooLarge - ErrorCodeIllegalByteSequence - ErrorCodeInProgress - ErrorCodeInterrupted - ErrorCodeInvalid - ErrorCodeIO - ErrorCodeIsDirectory - ErrorCodeLoop - ErrorCodeTooManyLinks - ErrorCodeMessageSize - ErrorCodeNameTooLong - ErrorCodeNoDevice - ErrorCodeNoEntry - ErrorCodeNoLock - ErrorCodeInsufficientMemory - ErrorCodeInsufficientSpace - ErrorCodeNotDirectory - ErrorCodeNotEmpty - ErrorCodeNotRecoverable - ErrorCodeUnsupported - ErrorCodeNoTTY - ErrorCodeNoSuchDevice - ErrorCodeOverflow - ErrorCodeNotPermitted - ErrorCodePipe - ErrorCodeReadOnly - ErrorCodeInvalidSeek - ErrorCodeTextFileBusy - ErrorCodeCrossDevice -) - -var stringsErrorCode = [37]string{ - "access", - "would-block", - "already", - "bad-descriptor", - "busy", - "deadlock", - "quota", - "exist", - "file-too-large", - "illegal-byte-sequence", - "in-progress", - "interrupted", - "invalid", - "io", - "is-directory", - "loop", - "too-many-links", - "message-size", - "name-too-long", - "no-device", - "no-entry", - "no-lock", - "insufficient-memory", - "insufficient-space", - "not-directory", - "not-empty", - "not-recoverable", - "unsupported", - "no-tty", - "no-such-device", - "overflow", - "not-permitted", - "pipe", - "read-only", - "invalid-seek", - "text-file-busy", - "cross-device", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e ErrorCode) String() string { - return stringsErrorCode[e] -} - -// Advice represents the enum "wasi:filesystem/types@0.2.0#advice". -// -// enum advice { -// normal, -// sequential, -// random, -// will-need, -// dont-need, -// no-reuse -// } -type Advice uint8 - -const ( - AdviceNormal Advice = iota - AdviceSequential - AdviceRandom - AdviceWillNeed - AdviceDontNeed - AdviceNoReuse -) - -var stringsAdvice = [6]string{ - "normal", - "sequential", - "random", - "will-need", - "dont-need", - "no-reuse", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e Advice) String() string { - return stringsAdvice[e] -} - -// MetadataHashValue represents the record "wasi:filesystem/types@0.2.0#metadata-hash-value". -// -// record metadata-hash-value { -// lower: u64, -// upper: u64, -// } -type MetadataHashValue struct { - _ cm.HostLayout - Lower uint64 - Upper uint64 -} - -// Descriptor represents the imported resource "wasi:filesystem/types@0.2.0#descriptor". -// -// resource descriptor -type Descriptor cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "descriptor". -// -// Drops a resource handle. -// -//go:nosplit -func (self Descriptor) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorResourceDrop((uint32)(self0)) - return -} - -// Advise represents the imported method "advise". -// -// advise: func(offset: filesize, length: filesize, advice: advice) -> result<_, error-code> -// -//go:nosplit -func (self Descriptor) Advise(offset FileSize, length FileSize, advice Advice) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - offset0 := (uint64)(offset) - length0 := (uint64)(length) - advice0 := (uint32)(advice) - wasmimport_DescriptorAdvise((uint32)(self0), (uint64)(offset0), (uint64)(length0), (uint32)(advice0), &result) - return -} - -// AppendViaStream represents the imported method "append-via-stream". -// -// append-via-stream: func() -> result -// -//go:nosplit -func (self Descriptor) AppendViaStream() (result cm.Result[OutputStream, OutputStream, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorAppendViaStream((uint32)(self0), &result) - return -} - -// CreateDirectoryAt represents the imported method "create-directory-at". -// -// create-directory-at: func(path: string) -> result<_, error-code> -// -//go:nosplit -func (self Descriptor) CreateDirectoryAt(path string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorCreateDirectoryAt((uint32)(self0), (*uint8)(path0), (uint32)(path1), &result) - return -} - -// GetFlags represents the imported method "get-flags". -// -// get-flags: func() -> result -// -//go:nosplit -func (self Descriptor) GetFlags() (result cm.Result[DescriptorFlags, DescriptorFlags, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorGetFlags((uint32)(self0), &result) - return -} - -// GetType represents the imported method "get-type". -// -// get-type: func() -> result -// -//go:nosplit -func (self Descriptor) GetType() (result cm.Result[DescriptorType, DescriptorType, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorGetType((uint32)(self0), &result) - return -} - -// IsSameObject represents the imported method "is-same-object". -// -// is-same-object: func(other: borrow) -> bool -// -//go:nosplit -func (self Descriptor) IsSameObject(other Descriptor) (result bool) { - self0 := cm.Reinterpret[uint32](self) - other0 := cm.Reinterpret[uint32](other) - result0 := wasmimport_DescriptorIsSameObject((uint32)(self0), (uint32)(other0)) - result = (bool)(cm.U32ToBool((uint32)(result0))) - return -} - -// LinkAt represents the imported method "link-at". -// -// link-at: func(old-path-flags: path-flags, old-path: string, new-descriptor: borrow, -// new-path: string) -> result<_, error-code> -// -//go:nosplit -func (self Descriptor) LinkAt(oldPathFlags PathFlags, oldPath string, newDescriptor Descriptor, newPath string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - oldPathFlags0 := (uint32)(oldPathFlags) - oldPath0, oldPath1 := cm.LowerString(oldPath) - newDescriptor0 := cm.Reinterpret[uint32](newDescriptor) - newPath0, newPath1 := cm.LowerString(newPath) - wasmimport_DescriptorLinkAt((uint32)(self0), (uint32)(oldPathFlags0), (*uint8)(oldPath0), (uint32)(oldPath1), (uint32)(newDescriptor0), (*uint8)(newPath0), (uint32)(newPath1), &result) - return -} - -// MetadataHash represents the imported method "metadata-hash". -// -// metadata-hash: func() -> result -// -//go:nosplit -func (self Descriptor) MetadataHash() (result cm.Result[MetadataHashValueShape, MetadataHashValue, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorMetadataHash((uint32)(self0), &result) - return -} - -// MetadataHashAt represents the imported method "metadata-hash-at". -// -// metadata-hash-at: func(path-flags: path-flags, path: string) -> result -// -//go:nosplit -func (self Descriptor) MetadataHashAt(pathFlags PathFlags, path string) (result cm.Result[MetadataHashValueShape, MetadataHashValue, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - pathFlags0 := (uint32)(pathFlags) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorMetadataHashAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), &result) - return -} - -// OpenAt represents the imported method "open-at". -// -// open-at: func(path-flags: path-flags, path: string, open-flags: open-flags, %flags: -// descriptor-flags) -> result -// -//go:nosplit -func (self Descriptor) OpenAt(pathFlags PathFlags, path string, openFlags OpenFlags, flags DescriptorFlags) (result cm.Result[Descriptor, Descriptor, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - pathFlags0 := (uint32)(pathFlags) - path0, path1 := cm.LowerString(path) - openFlags0 := (uint32)(openFlags) - flags0 := (uint32)(flags) - wasmimport_DescriptorOpenAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), (uint32)(openFlags0), (uint32)(flags0), &result) - return -} - -// Read represents the imported method "read". -// -// read: func(length: filesize, offset: filesize) -> result, bool>, -// error-code> -// -//go:nosplit -func (self Descriptor) Read(length FileSize, offset FileSize) (result cm.Result[TupleListU8BoolShape, cm.Tuple[cm.List[uint8], bool], ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - length0 := (uint64)(length) - offset0 := (uint64)(offset) - wasmimport_DescriptorRead((uint32)(self0), (uint64)(length0), (uint64)(offset0), &result) - return -} - -// ReadDirectory represents the imported method "read-directory". -// -// read-directory: func() -> result -// -//go:nosplit -func (self Descriptor) ReadDirectory() (result cm.Result[DirectoryEntryStream, DirectoryEntryStream, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorReadDirectory((uint32)(self0), &result) - return -} - -// ReadViaStream represents the imported method "read-via-stream". -// -// read-via-stream: func(offset: filesize) -> result -// -//go:nosplit -func (self Descriptor) ReadViaStream(offset FileSize) (result cm.Result[InputStream, InputStream, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - offset0 := (uint64)(offset) - wasmimport_DescriptorReadViaStream((uint32)(self0), (uint64)(offset0), &result) - return -} - -// ReadLinkAt represents the imported method "readlink-at". -// -// readlink-at: func(path: string) -> result -// -//go:nosplit -func (self Descriptor) ReadLinkAt(path string) (result cm.Result[string, string, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorReadLinkAt((uint32)(self0), (*uint8)(path0), (uint32)(path1), &result) - return -} - -// RemoveDirectoryAt represents the imported method "remove-directory-at". -// -// remove-directory-at: func(path: string) -> result<_, error-code> -// -//go:nosplit -func (self Descriptor) RemoveDirectoryAt(path string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorRemoveDirectoryAt((uint32)(self0), (*uint8)(path0), (uint32)(path1), &result) - return -} - -// RenameAt represents the imported method "rename-at". -// -// rename-at: func(old-path: string, new-descriptor: borrow, new-path: -// string) -> result<_, error-code> -// -//go:nosplit -func (self Descriptor) RenameAt(oldPath string, newDescriptor Descriptor, newPath string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - oldPath0, oldPath1 := cm.LowerString(oldPath) - newDescriptor0 := cm.Reinterpret[uint32](newDescriptor) - newPath0, newPath1 := cm.LowerString(newPath) - wasmimport_DescriptorRenameAt((uint32)(self0), (*uint8)(oldPath0), (uint32)(oldPath1), (uint32)(newDescriptor0), (*uint8)(newPath0), (uint32)(newPath1), &result) - return -} - -// SetSize represents the imported method "set-size". -// -// set-size: func(size: filesize) -> result<_, error-code> -// -//go:nosplit -func (self Descriptor) SetSize(size FileSize) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - size0 := (uint64)(size) - wasmimport_DescriptorSetSize((uint32)(self0), (uint64)(size0), &result) - return -} - -// SetTimes represents the imported method "set-times". -// -// set-times: func(data-access-timestamp: new-timestamp, data-modification-timestamp: -// new-timestamp) -> result<_, error-code> -// -//go:nosplit -func (self Descriptor) SetTimes(dataAccessTimestamp NewTimestamp, dataModificationTimestamp NewTimestamp) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - dataAccessTimestamp0, dataAccessTimestamp1, dataAccessTimestamp2 := lower_NewTimestamp(dataAccessTimestamp) - dataModificationTimestamp0, dataModificationTimestamp1, dataModificationTimestamp2 := lower_NewTimestamp(dataModificationTimestamp) - wasmimport_DescriptorSetTimes((uint32)(self0), (uint32)(dataAccessTimestamp0), (uint64)(dataAccessTimestamp1), (uint32)(dataAccessTimestamp2), (uint32)(dataModificationTimestamp0), (uint64)(dataModificationTimestamp1), (uint32)(dataModificationTimestamp2), &result) - return -} - -// SetTimesAt represents the imported method "set-times-at". -// -// set-times-at: func(path-flags: path-flags, path: string, data-access-timestamp: -// new-timestamp, data-modification-timestamp: new-timestamp) -> result<_, error-code> -// -//go:nosplit -func (self Descriptor) SetTimesAt(pathFlags PathFlags, path string, dataAccessTimestamp NewTimestamp, dataModificationTimestamp NewTimestamp) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - pathFlags0 := (uint32)(pathFlags) - path0, path1 := cm.LowerString(path) - dataAccessTimestamp0, dataAccessTimestamp1, dataAccessTimestamp2 := lower_NewTimestamp(dataAccessTimestamp) - dataModificationTimestamp0, dataModificationTimestamp1, dataModificationTimestamp2 := lower_NewTimestamp(dataModificationTimestamp) - wasmimport_DescriptorSetTimesAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), (uint32)(dataAccessTimestamp0), (uint64)(dataAccessTimestamp1), (uint32)(dataAccessTimestamp2), (uint32)(dataModificationTimestamp0), (uint64)(dataModificationTimestamp1), (uint32)(dataModificationTimestamp2), &result) - return -} - -// Stat represents the imported method "stat". -// -// stat: func() -> result -// -//go:nosplit -func (self Descriptor) Stat() (result cm.Result[DescriptorStatShape, DescriptorStat, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorStat((uint32)(self0), &result) - return -} - -// StatAt represents the imported method "stat-at". -// -// stat-at: func(path-flags: path-flags, path: string) -> result -// -//go:nosplit -func (self Descriptor) StatAt(pathFlags PathFlags, path string) (result cm.Result[DescriptorStatShape, DescriptorStat, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - pathFlags0 := (uint32)(pathFlags) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorStatAt((uint32)(self0), (uint32)(pathFlags0), (*uint8)(path0), (uint32)(path1), &result) - return -} - -// SymlinkAt represents the imported method "symlink-at". -// -// symlink-at: func(old-path: string, new-path: string) -> result<_, error-code> -// -//go:nosplit -func (self Descriptor) SymlinkAt(oldPath string, newPath string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - oldPath0, oldPath1 := cm.LowerString(oldPath) - newPath0, newPath1 := cm.LowerString(newPath) - wasmimport_DescriptorSymlinkAt((uint32)(self0), (*uint8)(oldPath0), (uint32)(oldPath1), (*uint8)(newPath0), (uint32)(newPath1), &result) - return -} - -// Sync represents the imported method "sync". -// -// sync: func() -> result<_, error-code> -// -//go:nosplit -func (self Descriptor) Sync() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorSync((uint32)(self0), &result) - return -} - -// SyncData represents the imported method "sync-data". -// -// sync-data: func() -> result<_, error-code> -// -//go:nosplit -func (self Descriptor) SyncData() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DescriptorSyncData((uint32)(self0), &result) - return -} - -// UnlinkFileAt represents the imported method "unlink-file-at". -// -// unlink-file-at: func(path: string) -> result<_, error-code> -// -//go:nosplit -func (self Descriptor) UnlinkFileAt(path string) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - path0, path1 := cm.LowerString(path) - wasmimport_DescriptorUnlinkFileAt((uint32)(self0), (*uint8)(path0), (uint32)(path1), &result) - return -} - -// Write represents the imported method "write". -// -// write: func(buffer: list, offset: filesize) -> result -// -//go:nosplit -func (self Descriptor) Write(buffer cm.List[uint8], offset FileSize) (result cm.Result[uint64, FileSize, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - buffer0, buffer1 := cm.LowerList(buffer) - offset0 := (uint64)(offset) - wasmimport_DescriptorWrite((uint32)(self0), (*uint8)(buffer0), (uint32)(buffer1), (uint64)(offset0), &result) - return -} - -// WriteViaStream represents the imported method "write-via-stream". -// -// write-via-stream: func(offset: filesize) -> result -// -//go:nosplit -func (self Descriptor) WriteViaStream(offset FileSize) (result cm.Result[OutputStream, OutputStream, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - offset0 := (uint64)(offset) - wasmimport_DescriptorWriteViaStream((uint32)(self0), (uint64)(offset0), &result) - return -} - -// DirectoryEntryStream represents the imported resource "wasi:filesystem/types@0.2.0#directory-entry-stream". -// -// resource directory-entry-stream -type DirectoryEntryStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "directory-entry-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self DirectoryEntryStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DirectoryEntryStreamResourceDrop((uint32)(self0)) - return -} - -// ReadDirectoryEntry represents the imported method "read-directory-entry". -// -// read-directory-entry: func() -> result, error-code> -// -//go:nosplit -func (self DirectoryEntryStream) ReadDirectoryEntry() (result cm.Result[OptionDirectoryEntryShape, cm.Option[DirectoryEntry], ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_DirectoryEntryStreamReadDirectoryEntry((uint32)(self0), &result) - return -} - -// FilesystemErrorCode represents the imported function "filesystem-error-code". -// -// filesystem-error-code: func(err: borrow) -> option -// -//go:nosplit -func FilesystemErrorCode(err Error) (result cm.Option[ErrorCode]) { - err0 := cm.Reinterpret[uint32](err) - wasmimport_FilesystemErrorCode((uint32)(err0), &result) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/http/outgoing-handler/abi.go b/examples/component/sqldb-postgres-query/gen/wasi/http/outgoing-handler/abi.go deleted file mode 100644 index 262f0069..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/http/outgoing-handler/abi.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package outgoinghandler - -import ( - "go.bytecodealliance.org/cm" - "sqldb-postgres-query/gen/wasi/http/types" - "unsafe" -) - -// ErrorCodeShape is used for storage in variant or result types. -type ErrorCodeShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(types.ErrorCode{})]byte -} - -func lower_OptionRequestOptions(v cm.Option[RequestOptions]) (f0 uint32, f1 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := cm.Reinterpret[uint32](*some) - f1 = (uint32)(v1) - } - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/http/outgoing-handler/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/http/outgoing-handler/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/http/outgoing-handler/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go deleted file mode 100644 index 76815664..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/http/outgoing-handler/outgoing-handler.wit.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package outgoinghandler represents the imported interface "wasi:http/outgoing-handler@0.2.0". -package outgoinghandler - -import ( - "go.bytecodealliance.org/cm" - "sqldb-postgres-query/gen/wasi/http/types" -) - -// OutgoingRequest represents the imported type alias "wasi:http/outgoing-handler@0.2.0#outgoing-request". -// -// See [types.OutgoingRequest] for more information. -type OutgoingRequest = types.OutgoingRequest - -// RequestOptions represents the imported type alias "wasi:http/outgoing-handler@0.2.0#request-options". -// -// See [types.RequestOptions] for more information. -type RequestOptions = types.RequestOptions - -// FutureIncomingResponse represents the imported type alias "wasi:http/outgoing-handler@0.2.0#future-incoming-response". -// -// See [types.FutureIncomingResponse] for more information. -type FutureIncomingResponse = types.FutureIncomingResponse - -// ErrorCode represents the type alias "wasi:http/outgoing-handler@0.2.0#error-code". -// -// See [types.ErrorCode] for more information. -type ErrorCode = types.ErrorCode - -// Handle represents the imported function "handle". -// -// handle: func(request: outgoing-request, options: option) -> result -// -//go:nosplit -func Handle(request OutgoingRequest, options cm.Option[RequestOptions]) (result cm.Result[ErrorCodeShape, FutureIncomingResponse, ErrorCode]) { - request0 := cm.Reinterpret[uint32](request) - options0, options1 := lower_OptionRequestOptions(options) - wasmimport_Handle((uint32)(request0), (uint32)(options0), (uint32)(options1), &result) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go deleted file mode 100755 index 6b3f3828..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/http/outgoing-handler/outgoinghandler.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package outgoinghandler - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:http@0.2.0". - -//go:wasmimport wasi:http/outgoing-handler@0.2.0 handle -//go:noescape -func wasmimport_Handle(request0 uint32, options0 uint32, options1 uint32, result *cm.Result[ErrorCodeShape, FutureIncomingResponse, ErrorCode]) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/http/types/abi.go b/examples/component/sqldb-postgres-query/gen/wasi/http/types/abi.go deleted file mode 100644 index 6ffb1fdd..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/http/types/abi.go +++ /dev/null @@ -1,264 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package types - -import ( - "go.bytecodealliance.org/cm" - "unsafe" -) - -// OptionFieldSizePayloadShape is used for storage in variant or result types. -type OptionFieldSizePayloadShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Option[FieldSizePayload]{})]byte -} - -func lower_OptionString(v cm.Option[string]) (f0 uint32, f1 *uint8, f2 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1, v2 := cm.LowerString(*some) - f1 = (*uint8)(v1) - f2 = (uint32)(v2) - } - return -} - -func lower_Method(v Method) (f0 uint32, f1 *uint8, f2 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 9: // other - v1, v2 := cm.LowerString(*cm.Case[string](&v, 9)) - f1 = (*uint8)(v1) - f2 = (uint32)(v2) - } - return -} - -func lower_Scheme(v Scheme) (f0 uint32, f1 *uint8, f2 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 2: // other - v1, v2 := cm.LowerString(*cm.Case[string](&v, 2)) - f1 = (*uint8)(v1) - f2 = (uint32)(v2) - } - return -} - -func lower_OptionScheme(v cm.Option[Scheme]) (f0 uint32, f1 uint32, f2 *uint8, f3 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1, v2, v3 := lower_Scheme(*some) - f1 = (uint32)(v1) - f2 = (*uint8)(v2) - f3 = (uint32)(v3) - } - return -} - -func lower_OptionDuration(v cm.Option[Duration]) (f0 uint32, f1 uint64) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := (uint64)(*some) - f1 = (uint64)(v1) - } - return -} - -// ErrorCodeShape is used for storage in variant or result types. -type ErrorCodeShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(ErrorCode{})]byte -} - -func lower_OptionU16(v cm.Option[uint16]) (f0 uint32, f1 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := (uint32)(*some) - f1 = (uint32)(v1) - } - return -} - -func lower_DNSErrorPayload(v DNSErrorPayload) (f0 uint32, f1 *uint8, f2 uint32, f3 uint32, f4 uint32) { - f0, f1, f2 = lower_OptionString(v.Rcode) - f3, f4 = lower_OptionU16(v.InfoCode) - return -} - -func lower_OptionU8(v cm.Option[uint8]) (f0 uint32, f1 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := (uint32)(*some) - f1 = (uint32)(v1) - } - return -} - -func lower_TLSAlertReceivedPayload(v TLSAlertReceivedPayload) (f0 uint32, f1 uint32, f2 uint32, f3 *uint8, f4 uint32) { - f0, f1 = lower_OptionU8(v.AlertID) - f2, f3, f4 = lower_OptionString(v.AlertMessage) - return -} - -func lower_OptionU64(v cm.Option[uint64]) (f0 uint32, f1 uint64) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := (uint64)(*some) - f1 = (uint64)(v1) - } - return -} - -func lower_OptionU32(v cm.Option[uint32]) (f0 uint32, f1 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := (uint32)(*some) - f1 = (uint32)(v1) - } - return -} - -func lower_FieldSizePayload(v FieldSizePayload) (f0 uint32, f1 *uint8, f2 uint32, f3 uint32, f4 uint32) { - f0, f1, f2 = lower_OptionString(v.FieldName) - f3, f4 = lower_OptionU32(v.FieldSize) - return -} - -func lower_OptionFieldSizePayload(v cm.Option[FieldSizePayload]) (f0 uint32, f1 uint32, f2 *uint8, f3 uint32, f4 uint32, f5 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1, v2, v3, v4, v5 := lower_FieldSizePayload(*some) - f1 = (uint32)(v1) - f2 = (*uint8)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - } - return -} - -func lower_ErrorCode(v ErrorCode) (f0 uint32, f1 uint32, f2 uint64, f3 uint32, f4 uint32, f5 uint32, f6 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 1: // DNS-error - v1, v2, v3, v4, v5 := lower_DNSErrorPayload(*cm.Case[DNSErrorPayload](&v, 1)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 14: // TLS-alert-received - v1, v2, v3, v4, v5 := lower_TLSAlertReceivedPayload(*cm.Case[TLSAlertReceivedPayload](&v, 14)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(cm.PointerToU32(v4)) - f5 = (uint32)(v5) - case 17: // HTTP-request-body-size - v1, v2 := lower_OptionU64(*cm.Case[cm.Option[uint64]](&v, 17)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 21: // HTTP-request-header-section-size - v1, v2 := lower_OptionU32(*cm.Case[cm.Option[uint32]](&v, 21)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 22: // HTTP-request-header-size - v1, v2, v3, v4, v5, v6 := lower_OptionFieldSizePayload(*cm.Case[cm.Option[FieldSizePayload]](&v, 22)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - f3 = (uint32)(cm.PointerToU32(v3)) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - f6 = (uint32)(v6) - case 23: // HTTP-request-trailer-section-size - v1, v2 := lower_OptionU32(*cm.Case[cm.Option[uint32]](&v, 23)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 24: // HTTP-request-trailer-size - v1, v2, v3, v4, v5 := lower_FieldSizePayload(*cm.Case[FieldSizePayload](&v, 24)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 26: // HTTP-response-header-section-size - v1, v2 := lower_OptionU32(*cm.Case[cm.Option[uint32]](&v, 26)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 27: // HTTP-response-header-size - v1, v2, v3, v4, v5 := lower_FieldSizePayload(*cm.Case[FieldSizePayload](&v, 27)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 28: // HTTP-response-body-size - v1, v2 := lower_OptionU64(*cm.Case[cm.Option[uint64]](&v, 28)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 29: // HTTP-response-trailer-section-size - v1, v2 := lower_OptionU32(*cm.Case[cm.Option[uint32]](&v, 29)) - f1 = (uint32)(v1) - f2 = (uint64)(v2) - case 30: // HTTP-response-trailer-size - v1, v2, v3, v4, v5 := lower_FieldSizePayload(*cm.Case[FieldSizePayload](&v, 30)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 31: // HTTP-response-transfer-coding - v1, v2, v3 := lower_OptionString(*cm.Case[cm.Option[string]](&v, 31)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - case 32: // HTTP-response-content-coding - v1, v2, v3 := lower_OptionString(*cm.Case[cm.Option[string]](&v, 32)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - case 38: // internal-error - v1, v2, v3 := lower_OptionString(*cm.Case[cm.Option[string]](&v, 38)) - f1 = (uint32)(v1) - f2 = (uint64)(cm.PointerToU64(v2)) - f3 = (uint32)(v3) - } - return -} - -func lower_ResultOutgoingResponseErrorCode(v cm.Result[ErrorCodeShape, OutgoingResponse, ErrorCode]) (f0 uint32, f1 uint32, f2 uint32, f3 uint64, f4 uint32, f5 uint32, f6 uint32, f7 uint32) { - if v.IsOK() { - v1 := cm.Reinterpret[uint32](*v.OK()) - f1 = (uint32)(v1) - } else { - f0 = 1 - v1, v2, v3, v4, v5, v6, v7 := lower_ErrorCode(*v.Err()) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint64)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - f6 = (uint32)(v6) - f7 = (uint32)(v7) - } - return -} - -func lower_OptionTrailers(v cm.Option[Trailers]) (f0 uint32, f1 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1 := cm.Reinterpret[uint32](*some) - f1 = (uint32)(v1) - } - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/http/types/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/http/types/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/http/types/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/http/types/types.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/http/types/types.wasm.go deleted file mode 100755 index b025b2af..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/http/types/types.wasm.go +++ /dev/null @@ -1,257 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package types - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:http@0.2.0". - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]fields -//go:noescape -func wasmimport_FieldsResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [constructor]fields -//go:noescape -func wasmimport_NewFields() (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [static]fields.from-list -//go:noescape -func wasmimport_FieldsFromList(entries0 *cm.Tuple[FieldKey, FieldValue], entries1 uint32, result *cm.Result[Fields, Fields, HeaderError]) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.append -//go:noescape -func wasmimport_FieldsAppend(self0 uint32, name0 *uint8, name1 uint32, value0 *uint8, value1 uint32, result *cm.Result[HeaderError, struct{}, HeaderError]) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.clone -//go:noescape -func wasmimport_FieldsClone(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.delete -//go:noescape -func wasmimport_FieldsDelete(self0 uint32, name0 *uint8, name1 uint32, result *cm.Result[HeaderError, struct{}, HeaderError]) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.entries -//go:noescape -func wasmimport_FieldsEntries(self0 uint32, result *cm.List[cm.Tuple[FieldKey, FieldValue]]) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.get -//go:noescape -func wasmimport_FieldsGet(self0 uint32, name0 *uint8, name1 uint32, result *cm.List[FieldValue]) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.has -//go:noescape -func wasmimport_FieldsHas(self0 uint32, name0 *uint8, name1 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]fields.set -//go:noescape -func wasmimport_FieldsSet(self0 uint32, name0 *uint8, name1 uint32, value0 *FieldValue, value1 uint32, result *cm.Result[HeaderError, struct{}, HeaderError]) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]incoming-request -//go:noescape -func wasmimport_IncomingRequestResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.authority -//go:noescape -func wasmimport_IncomingRequestAuthority(self0 uint32, result *cm.Option[string]) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.consume -//go:noescape -func wasmimport_IncomingRequestConsume(self0 uint32, result *cm.Result[IncomingBody, IncomingBody, struct{}]) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.headers -//go:noescape -func wasmimport_IncomingRequestHeaders(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.method -//go:noescape -func wasmimport_IncomingRequestMethod(self0 uint32, result *Method) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.path-with-query -//go:noescape -func wasmimport_IncomingRequestPathWithQuery(self0 uint32, result *cm.Option[string]) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-request.scheme -//go:noescape -func wasmimport_IncomingRequestScheme(self0 uint32, result *cm.Option[Scheme]) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]outgoing-request -//go:noescape -func wasmimport_OutgoingRequestResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [constructor]outgoing-request -//go:noescape -func wasmimport_NewOutgoingRequest(headers0 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.authority -//go:noescape -func wasmimport_OutgoingRequestAuthority(self0 uint32, result *cm.Option[string]) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.body -//go:noescape -func wasmimport_OutgoingRequestBody(self0 uint32, result *cm.Result[OutgoingBody, OutgoingBody, struct{}]) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.headers -//go:noescape -func wasmimport_OutgoingRequestHeaders(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.method -//go:noescape -func wasmimport_OutgoingRequestMethod(self0 uint32, result *Method) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.path-with-query -//go:noescape -func wasmimport_OutgoingRequestPathWithQuery(self0 uint32, result *cm.Option[string]) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.scheme -//go:noescape -func wasmimport_OutgoingRequestScheme(self0 uint32, result *cm.Option[Scheme]) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-authority -//go:noescape -func wasmimport_OutgoingRequestSetAuthority(self0 uint32, authority0 uint32, authority1 *uint8, authority2 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-method -//go:noescape -func wasmimport_OutgoingRequestSetMethod(self0 uint32, method0 uint32, method1 *uint8, method2 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-path-with-query -//go:noescape -func wasmimport_OutgoingRequestSetPathWithQuery(self0 uint32, pathWithQuery0 uint32, pathWithQuery1 *uint8, pathWithQuery2 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-request.set-scheme -//go:noescape -func wasmimport_OutgoingRequestSetScheme(self0 uint32, scheme0 uint32, scheme1 uint32, scheme2 *uint8, scheme3 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]request-options -//go:noescape -func wasmimport_RequestOptionsResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [constructor]request-options -//go:noescape -func wasmimport_NewRequestOptions() (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.between-bytes-timeout -//go:noescape -func wasmimport_RequestOptionsBetweenBytesTimeout(self0 uint32, result *cm.Option[Duration]) - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.connect-timeout -//go:noescape -func wasmimport_RequestOptionsConnectTimeout(self0 uint32, result *cm.Option[Duration]) - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.first-byte-timeout -//go:noescape -func wasmimport_RequestOptionsFirstByteTimeout(self0 uint32, result *cm.Option[Duration]) - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.set-between-bytes-timeout -//go:noescape -func wasmimport_RequestOptionsSetBetweenBytesTimeout(self0 uint32, duration0 uint32, duration1 uint64) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.set-connect-timeout -//go:noescape -func wasmimport_RequestOptionsSetConnectTimeout(self0 uint32, duration0 uint32, duration1 uint64) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]request-options.set-first-byte-timeout -//go:noescape -func wasmimport_RequestOptionsSetFirstByteTimeout(self0 uint32, duration0 uint32, duration1 uint64) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]response-outparam -//go:noescape -func wasmimport_ResponseOutparamResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [static]response-outparam.set -//go:noescape -func wasmimport_ResponseOutparamSet(param0 uint32, response0 uint32, response1 uint32, response2 uint32, response3 uint64, response4 uint32, response5 uint32, response6 uint32, response7 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]incoming-response -//go:noescape -func wasmimport_IncomingResponseResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-response.consume -//go:noescape -func wasmimport_IncomingResponseConsume(self0 uint32, result *cm.Result[IncomingBody, IncomingBody, struct{}]) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-response.headers -//go:noescape -func wasmimport_IncomingResponseHeaders(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-response.status -//go:noescape -func wasmimport_IncomingResponseStatus(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]incoming-body -//go:noescape -func wasmimport_IncomingBodyResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [static]incoming-body.finish -//go:noescape -func wasmimport_IncomingBodyFinish(this0 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]incoming-body.stream -//go:noescape -func wasmimport_IncomingBodyStream(self0 uint32, result *cm.Result[InputStream, InputStream, struct{}]) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]future-trailers -//go:noescape -func wasmimport_FutureTrailersResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]future-trailers.get -//go:noescape -func wasmimport_FutureTrailersGet(self0 uint32, result *cm.Option[cm.Result[cm.Result[ErrorCodeShape, cm.Option[Trailers], ErrorCode], cm.Result[ErrorCodeShape, cm.Option[Trailers], ErrorCode], struct{}]]) - -//go:wasmimport wasi:http/types@0.2.0 [method]future-trailers.subscribe -//go:noescape -func wasmimport_FutureTrailersSubscribe(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]outgoing-response -//go:noescape -func wasmimport_OutgoingResponseResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [constructor]outgoing-response -//go:noescape -func wasmimport_NewOutgoingResponse(headers0 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.body -//go:noescape -func wasmimport_OutgoingResponseBody(self0 uint32, result *cm.Result[OutgoingBody, OutgoingBody, struct{}]) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.headers -//go:noescape -func wasmimport_OutgoingResponseHeaders(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.set-status-code -//go:noescape -func wasmimport_OutgoingResponseSetStatusCode(self0 uint32, statusCode0 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-response.status-code -//go:noescape -func wasmimport_OutgoingResponseStatusCode(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]outgoing-body -//go:noescape -func wasmimport_OutgoingBodyResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [static]outgoing-body.finish -//go:noescape -func wasmimport_OutgoingBodyFinish(this0 uint32, trailers0 uint32, trailers1 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:http/types@0.2.0 [method]outgoing-body.write -//go:noescape -func wasmimport_OutgoingBodyWrite(self0 uint32, result *cm.Result[OutputStream, OutputStream, struct{}]) - -//go:wasmimport wasi:http/types@0.2.0 [resource-drop]future-incoming-response -//go:noescape -func wasmimport_FutureIncomingResponseResourceDrop(self0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 [method]future-incoming-response.get -//go:noescape -func wasmimport_FutureIncomingResponseGet(self0 uint32, result *cm.Option[cm.Result[cm.Result[ErrorCodeShape, IncomingResponse, ErrorCode], cm.Result[ErrorCodeShape, IncomingResponse, ErrorCode], struct{}]]) - -//go:wasmimport wasi:http/types@0.2.0 [method]future-incoming-response.subscribe -//go:noescape -func wasmimport_FutureIncomingResponseSubscribe(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:http/types@0.2.0 http-error-code -//go:noescape -func wasmimport_HTTPErrorCode(err0 uint32, result *cm.Option[ErrorCode]) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/http/types/types.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/http/types/types.wit.go deleted file mode 100644 index 85730b65..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/http/types/types.wit.go +++ /dev/null @@ -1,1603 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package types represents the imported interface "wasi:http/types@0.2.0". -package types - -import ( - "go.bytecodealliance.org/cm" - monotonicclock "sqldb-postgres-query/gen/wasi/clocks/monotonic-clock" - ioerror "sqldb-postgres-query/gen/wasi/io/error" - "sqldb-postgres-query/gen/wasi/io/poll" - "sqldb-postgres-query/gen/wasi/io/streams" -) - -// Duration represents the type alias "wasi:http/types@0.2.0#duration". -// -// See [monotonicclock.Duration] for more information. -type Duration = monotonicclock.Duration - -// InputStream represents the imported type alias "wasi:http/types@0.2.0#input-stream". -// -// See [streams.InputStream] for more information. -type InputStream = streams.InputStream - -// OutputStream represents the imported type alias "wasi:http/types@0.2.0#output-stream". -// -// See [streams.OutputStream] for more information. -type OutputStream = streams.OutputStream - -// IOError represents the imported type alias "wasi:http/types@0.2.0#io-error". -// -// See [ioerror.Error] for more information. -type IOError = ioerror.Error - -// Pollable represents the imported type alias "wasi:http/types@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// Method represents the variant "wasi:http/types@0.2.0#method". -// -// variant method { -// get, -// head, -// post, -// put, -// delete, -// connect, -// options, -// trace, -// patch, -// other(string), -// } -type Method cm.Variant[uint8, string, string] - -// MethodGet returns a [Method] of case "get". -func MethodGet() Method { - var data struct{} - return cm.New[Method](0, data) -} - -// Get returns true if [Method] represents the variant case "get". -func (self *Method) Get() bool { - return self.Tag() == 0 -} - -// MethodHead returns a [Method] of case "head". -func MethodHead() Method { - var data struct{} - return cm.New[Method](1, data) -} - -// Head returns true if [Method] represents the variant case "head". -func (self *Method) Head() bool { - return self.Tag() == 1 -} - -// MethodPost returns a [Method] of case "post". -func MethodPost() Method { - var data struct{} - return cm.New[Method](2, data) -} - -// Post returns true if [Method] represents the variant case "post". -func (self *Method) Post() bool { - return self.Tag() == 2 -} - -// MethodPut returns a [Method] of case "put". -func MethodPut() Method { - var data struct{} - return cm.New[Method](3, data) -} - -// Put returns true if [Method] represents the variant case "put". -func (self *Method) Put() bool { - return self.Tag() == 3 -} - -// MethodDelete returns a [Method] of case "delete". -func MethodDelete() Method { - var data struct{} - return cm.New[Method](4, data) -} - -// Delete returns true if [Method] represents the variant case "delete". -func (self *Method) Delete() bool { - return self.Tag() == 4 -} - -// MethodConnect returns a [Method] of case "connect". -func MethodConnect() Method { - var data struct{} - return cm.New[Method](5, data) -} - -// Connect returns true if [Method] represents the variant case "connect". -func (self *Method) Connect() bool { - return self.Tag() == 5 -} - -// MethodOptions returns a [Method] of case "options". -func MethodOptions() Method { - var data struct{} - return cm.New[Method](6, data) -} - -// Options returns true if [Method] represents the variant case "options". -func (self *Method) Options() bool { - return self.Tag() == 6 -} - -// MethodTrace returns a [Method] of case "trace". -func MethodTrace() Method { - var data struct{} - return cm.New[Method](7, data) -} - -// Trace returns true if [Method] represents the variant case "trace". -func (self *Method) Trace() bool { - return self.Tag() == 7 -} - -// MethodPatch returns a [Method] of case "patch". -func MethodPatch() Method { - var data struct{} - return cm.New[Method](8, data) -} - -// Patch returns true if [Method] represents the variant case "patch". -func (self *Method) Patch() bool { - return self.Tag() == 8 -} - -// MethodOther returns a [Method] of case "other". -func MethodOther(data string) Method { - return cm.New[Method](9, data) -} - -// Other returns a non-nil *[string] if [Method] represents the variant case "other". -func (self *Method) Other() *string { - return cm.Case[string](self, 9) -} - -var stringsMethod = [10]string{ - "get", - "head", - "post", - "put", - "delete", - "connect", - "options", - "trace", - "patch", - "other", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v Method) String() string { - return stringsMethod[v.Tag()] -} - -// Scheme represents the variant "wasi:http/types@0.2.0#scheme". -// -// variant scheme { -// HTTP, -// HTTPS, -// other(string), -// } -type Scheme cm.Variant[uint8, string, string] - -// SchemeHTTP returns a [Scheme] of case "HTTP". -func SchemeHTTP() Scheme { - var data struct{} - return cm.New[Scheme](0, data) -} - -// HTTP returns true if [Scheme] represents the variant case "HTTP". -func (self *Scheme) HTTP() bool { - return self.Tag() == 0 -} - -// SchemeHTTPS returns a [Scheme] of case "HTTPS". -func SchemeHTTPS() Scheme { - var data struct{} - return cm.New[Scheme](1, data) -} - -// HTTPS returns true if [Scheme] represents the variant case "HTTPS". -func (self *Scheme) HTTPS() bool { - return self.Tag() == 1 -} - -// SchemeOther returns a [Scheme] of case "other". -func SchemeOther(data string) Scheme { - return cm.New[Scheme](2, data) -} - -// Other returns a non-nil *[string] if [Scheme] represents the variant case "other". -func (self *Scheme) Other() *string { - return cm.Case[string](self, 2) -} - -var stringsScheme = [3]string{ - "HTTP", - "HTTPS", - "other", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v Scheme) String() string { - return stringsScheme[v.Tag()] -} - -// DNSErrorPayload represents the record "wasi:http/types@0.2.0#DNS-error-payload". -// -// record DNS-error-payload { -// rcode: option, -// info-code: option, -// } -type DNSErrorPayload struct { - _ cm.HostLayout - Rcode cm.Option[string] - InfoCode cm.Option[uint16] -} - -// TLSAlertReceivedPayload represents the record "wasi:http/types@0.2.0#TLS-alert-received-payload". -// -// record TLS-alert-received-payload { -// alert-id: option, -// alert-message: option, -// } -type TLSAlertReceivedPayload struct { - _ cm.HostLayout - AlertID cm.Option[uint8] - AlertMessage cm.Option[string] -} - -// FieldSizePayload represents the record "wasi:http/types@0.2.0#field-size-payload". -// -// record field-size-payload { -// field-name: option, -// field-size: option, -// } -type FieldSizePayload struct { - _ cm.HostLayout - FieldName cm.Option[string] - FieldSize cm.Option[uint32] -} - -// ErrorCode represents the variant "wasi:http/types@0.2.0#error-code". -// -// variant error-code { -// DNS-timeout, -// DNS-error(DNS-error-payload), -// destination-not-found, -// destination-unavailable, -// destination-IP-prohibited, -// destination-IP-unroutable, -// connection-refused, -// connection-terminated, -// connection-timeout, -// connection-read-timeout, -// connection-write-timeout, -// connection-limit-reached, -// TLS-protocol-error, -// TLS-certificate-error, -// TLS-alert-received(TLS-alert-received-payload), -// HTTP-request-denied, -// HTTP-request-length-required, -// HTTP-request-body-size(option), -// HTTP-request-method-invalid, -// HTTP-request-URI-invalid, -// HTTP-request-URI-too-long, -// HTTP-request-header-section-size(option), -// HTTP-request-header-size(option), -// HTTP-request-trailer-section-size(option), -// HTTP-request-trailer-size(field-size-payload), -// HTTP-response-incomplete, -// HTTP-response-header-section-size(option), -// HTTP-response-header-size(field-size-payload), -// HTTP-response-body-size(option), -// HTTP-response-trailer-section-size(option), -// HTTP-response-trailer-size(field-size-payload), -// HTTP-response-transfer-coding(option), -// HTTP-response-content-coding(option), -// HTTP-response-timeout, -// HTTP-upgrade-failed, -// HTTP-protocol-error, -// loop-detected, -// configuration-error, -// internal-error(option), -// } -type ErrorCode cm.Variant[uint8, OptionFieldSizePayloadShape, cm.Option[uint64]] - -// ErrorCodeDNSTimeout returns a [ErrorCode] of case "DNS-timeout". -func ErrorCodeDNSTimeout() ErrorCode { - var data struct{} - return cm.New[ErrorCode](0, data) -} - -// DNSTimeout returns true if [ErrorCode] represents the variant case "DNS-timeout". -func (self *ErrorCode) DNSTimeout() bool { - return self.Tag() == 0 -} - -// ErrorCodeDNSError returns a [ErrorCode] of case "DNS-error". -func ErrorCodeDNSError(data DNSErrorPayload) ErrorCode { - return cm.New[ErrorCode](1, data) -} - -// DNSError returns a non-nil *[DNSErrorPayload] if [ErrorCode] represents the variant case "DNS-error". -func (self *ErrorCode) DNSError() *DNSErrorPayload { - return cm.Case[DNSErrorPayload](self, 1) -} - -// ErrorCodeDestinationNotFound returns a [ErrorCode] of case "destination-not-found". -func ErrorCodeDestinationNotFound() ErrorCode { - var data struct{} - return cm.New[ErrorCode](2, data) -} - -// DestinationNotFound returns true if [ErrorCode] represents the variant case "destination-not-found". -func (self *ErrorCode) DestinationNotFound() bool { - return self.Tag() == 2 -} - -// ErrorCodeDestinationUnavailable returns a [ErrorCode] of case "destination-unavailable". -func ErrorCodeDestinationUnavailable() ErrorCode { - var data struct{} - return cm.New[ErrorCode](3, data) -} - -// DestinationUnavailable returns true if [ErrorCode] represents the variant case "destination-unavailable". -func (self *ErrorCode) DestinationUnavailable() bool { - return self.Tag() == 3 -} - -// ErrorCodeDestinationIPProhibited returns a [ErrorCode] of case "destination-IP-prohibited". -func ErrorCodeDestinationIPProhibited() ErrorCode { - var data struct{} - return cm.New[ErrorCode](4, data) -} - -// DestinationIPProhibited returns true if [ErrorCode] represents the variant case "destination-IP-prohibited". -func (self *ErrorCode) DestinationIPProhibited() bool { - return self.Tag() == 4 -} - -// ErrorCodeDestinationIPUnroutable returns a [ErrorCode] of case "destination-IP-unroutable". -func ErrorCodeDestinationIPUnroutable() ErrorCode { - var data struct{} - return cm.New[ErrorCode](5, data) -} - -// DestinationIPUnroutable returns true if [ErrorCode] represents the variant case "destination-IP-unroutable". -func (self *ErrorCode) DestinationIPUnroutable() bool { - return self.Tag() == 5 -} - -// ErrorCodeConnectionRefused returns a [ErrorCode] of case "connection-refused". -func ErrorCodeConnectionRefused() ErrorCode { - var data struct{} - return cm.New[ErrorCode](6, data) -} - -// ConnectionRefused returns true if [ErrorCode] represents the variant case "connection-refused". -func (self *ErrorCode) ConnectionRefused() bool { - return self.Tag() == 6 -} - -// ErrorCodeConnectionTerminated returns a [ErrorCode] of case "connection-terminated". -func ErrorCodeConnectionTerminated() ErrorCode { - var data struct{} - return cm.New[ErrorCode](7, data) -} - -// ConnectionTerminated returns true if [ErrorCode] represents the variant case "connection-terminated". -func (self *ErrorCode) ConnectionTerminated() bool { - return self.Tag() == 7 -} - -// ErrorCodeConnectionTimeout returns a [ErrorCode] of case "connection-timeout". -func ErrorCodeConnectionTimeout() ErrorCode { - var data struct{} - return cm.New[ErrorCode](8, data) -} - -// ConnectionTimeout returns true if [ErrorCode] represents the variant case "connection-timeout". -func (self *ErrorCode) ConnectionTimeout() bool { - return self.Tag() == 8 -} - -// ErrorCodeConnectionReadTimeout returns a [ErrorCode] of case "connection-read-timeout". -func ErrorCodeConnectionReadTimeout() ErrorCode { - var data struct{} - return cm.New[ErrorCode](9, data) -} - -// ConnectionReadTimeout returns true if [ErrorCode] represents the variant case "connection-read-timeout". -func (self *ErrorCode) ConnectionReadTimeout() bool { - return self.Tag() == 9 -} - -// ErrorCodeConnectionWriteTimeout returns a [ErrorCode] of case "connection-write-timeout". -func ErrorCodeConnectionWriteTimeout() ErrorCode { - var data struct{} - return cm.New[ErrorCode](10, data) -} - -// ConnectionWriteTimeout returns true if [ErrorCode] represents the variant case "connection-write-timeout". -func (self *ErrorCode) ConnectionWriteTimeout() bool { - return self.Tag() == 10 -} - -// ErrorCodeConnectionLimitReached returns a [ErrorCode] of case "connection-limit-reached". -func ErrorCodeConnectionLimitReached() ErrorCode { - var data struct{} - return cm.New[ErrorCode](11, data) -} - -// ConnectionLimitReached returns true if [ErrorCode] represents the variant case "connection-limit-reached". -func (self *ErrorCode) ConnectionLimitReached() bool { - return self.Tag() == 11 -} - -// ErrorCodeTLSProtocolError returns a [ErrorCode] of case "TLS-protocol-error". -func ErrorCodeTLSProtocolError() ErrorCode { - var data struct{} - return cm.New[ErrorCode](12, data) -} - -// TLSProtocolError returns true if [ErrorCode] represents the variant case "TLS-protocol-error". -func (self *ErrorCode) TLSProtocolError() bool { - return self.Tag() == 12 -} - -// ErrorCodeTLSCertificateError returns a [ErrorCode] of case "TLS-certificate-error". -func ErrorCodeTLSCertificateError() ErrorCode { - var data struct{} - return cm.New[ErrorCode](13, data) -} - -// TLSCertificateError returns true if [ErrorCode] represents the variant case "TLS-certificate-error". -func (self *ErrorCode) TLSCertificateError() bool { - return self.Tag() == 13 -} - -// ErrorCodeTLSAlertReceived returns a [ErrorCode] of case "TLS-alert-received". -func ErrorCodeTLSAlertReceived(data TLSAlertReceivedPayload) ErrorCode { - return cm.New[ErrorCode](14, data) -} - -// TLSAlertReceived returns a non-nil *[TLSAlertReceivedPayload] if [ErrorCode] represents the variant case "TLS-alert-received". -func (self *ErrorCode) TLSAlertReceived() *TLSAlertReceivedPayload { - return cm.Case[TLSAlertReceivedPayload](self, 14) -} - -// ErrorCodeHTTPRequestDenied returns a [ErrorCode] of case "HTTP-request-denied". -func ErrorCodeHTTPRequestDenied() ErrorCode { - var data struct{} - return cm.New[ErrorCode](15, data) -} - -// HTTPRequestDenied returns true if [ErrorCode] represents the variant case "HTTP-request-denied". -func (self *ErrorCode) HTTPRequestDenied() bool { - return self.Tag() == 15 -} - -// ErrorCodeHTTPRequestLengthRequired returns a [ErrorCode] of case "HTTP-request-length-required". -func ErrorCodeHTTPRequestLengthRequired() ErrorCode { - var data struct{} - return cm.New[ErrorCode](16, data) -} - -// HTTPRequestLengthRequired returns true if [ErrorCode] represents the variant case "HTTP-request-length-required". -func (self *ErrorCode) HTTPRequestLengthRequired() bool { - return self.Tag() == 16 -} - -// ErrorCodeHTTPRequestBodySize returns a [ErrorCode] of case "HTTP-request-body-size". -func ErrorCodeHTTPRequestBodySize(data cm.Option[uint64]) ErrorCode { - return cm.New[ErrorCode](17, data) -} - -// HTTPRequestBodySize returns a non-nil *[cm.Option[uint64]] if [ErrorCode] represents the variant case "HTTP-request-body-size". -func (self *ErrorCode) HTTPRequestBodySize() *cm.Option[uint64] { - return cm.Case[cm.Option[uint64]](self, 17) -} - -// ErrorCodeHTTPRequestMethodInvalid returns a [ErrorCode] of case "HTTP-request-method-invalid". -func ErrorCodeHTTPRequestMethodInvalid() ErrorCode { - var data struct{} - return cm.New[ErrorCode](18, data) -} - -// HTTPRequestMethodInvalid returns true if [ErrorCode] represents the variant case "HTTP-request-method-invalid". -func (self *ErrorCode) HTTPRequestMethodInvalid() bool { - return self.Tag() == 18 -} - -// ErrorCodeHTTPRequestURIInvalid returns a [ErrorCode] of case "HTTP-request-URI-invalid". -func ErrorCodeHTTPRequestURIInvalid() ErrorCode { - var data struct{} - return cm.New[ErrorCode](19, data) -} - -// HTTPRequestURIInvalid returns true if [ErrorCode] represents the variant case "HTTP-request-URI-invalid". -func (self *ErrorCode) HTTPRequestURIInvalid() bool { - return self.Tag() == 19 -} - -// ErrorCodeHTTPRequestURITooLong returns a [ErrorCode] of case "HTTP-request-URI-too-long". -func ErrorCodeHTTPRequestURITooLong() ErrorCode { - var data struct{} - return cm.New[ErrorCode](20, data) -} - -// HTTPRequestURITooLong returns true if [ErrorCode] represents the variant case "HTTP-request-URI-too-long". -func (self *ErrorCode) HTTPRequestURITooLong() bool { - return self.Tag() == 20 -} - -// ErrorCodeHTTPRequestHeaderSectionSize returns a [ErrorCode] of case "HTTP-request-header-section-size". -func ErrorCodeHTTPRequestHeaderSectionSize(data cm.Option[uint32]) ErrorCode { - return cm.New[ErrorCode](21, data) -} - -// HTTPRequestHeaderSectionSize returns a non-nil *[cm.Option[uint32]] if [ErrorCode] represents the variant case "HTTP-request-header-section-size". -func (self *ErrorCode) HTTPRequestHeaderSectionSize() *cm.Option[uint32] { - return cm.Case[cm.Option[uint32]](self, 21) -} - -// ErrorCodeHTTPRequestHeaderSize returns a [ErrorCode] of case "HTTP-request-header-size". -func ErrorCodeHTTPRequestHeaderSize(data cm.Option[FieldSizePayload]) ErrorCode { - return cm.New[ErrorCode](22, data) -} - -// HTTPRequestHeaderSize returns a non-nil *[cm.Option[FieldSizePayload]] if [ErrorCode] represents the variant case "HTTP-request-header-size". -func (self *ErrorCode) HTTPRequestHeaderSize() *cm.Option[FieldSizePayload] { - return cm.Case[cm.Option[FieldSizePayload]](self, 22) -} - -// ErrorCodeHTTPRequestTrailerSectionSize returns a [ErrorCode] of case "HTTP-request-trailer-section-size". -func ErrorCodeHTTPRequestTrailerSectionSize(data cm.Option[uint32]) ErrorCode { - return cm.New[ErrorCode](23, data) -} - -// HTTPRequestTrailerSectionSize returns a non-nil *[cm.Option[uint32]] if [ErrorCode] represents the variant case "HTTP-request-trailer-section-size". -func (self *ErrorCode) HTTPRequestTrailerSectionSize() *cm.Option[uint32] { - return cm.Case[cm.Option[uint32]](self, 23) -} - -// ErrorCodeHTTPRequestTrailerSize returns a [ErrorCode] of case "HTTP-request-trailer-size". -func ErrorCodeHTTPRequestTrailerSize(data FieldSizePayload) ErrorCode { - return cm.New[ErrorCode](24, data) -} - -// HTTPRequestTrailerSize returns a non-nil *[FieldSizePayload] if [ErrorCode] represents the variant case "HTTP-request-trailer-size". -func (self *ErrorCode) HTTPRequestTrailerSize() *FieldSizePayload { - return cm.Case[FieldSizePayload](self, 24) -} - -// ErrorCodeHTTPResponseIncomplete returns a [ErrorCode] of case "HTTP-response-incomplete". -func ErrorCodeHTTPResponseIncomplete() ErrorCode { - var data struct{} - return cm.New[ErrorCode](25, data) -} - -// HTTPResponseIncomplete returns true if [ErrorCode] represents the variant case "HTTP-response-incomplete". -func (self *ErrorCode) HTTPResponseIncomplete() bool { - return self.Tag() == 25 -} - -// ErrorCodeHTTPResponseHeaderSectionSize returns a [ErrorCode] of case "HTTP-response-header-section-size". -func ErrorCodeHTTPResponseHeaderSectionSize(data cm.Option[uint32]) ErrorCode { - return cm.New[ErrorCode](26, data) -} - -// HTTPResponseHeaderSectionSize returns a non-nil *[cm.Option[uint32]] if [ErrorCode] represents the variant case "HTTP-response-header-section-size". -func (self *ErrorCode) HTTPResponseHeaderSectionSize() *cm.Option[uint32] { - return cm.Case[cm.Option[uint32]](self, 26) -} - -// ErrorCodeHTTPResponseHeaderSize returns a [ErrorCode] of case "HTTP-response-header-size". -func ErrorCodeHTTPResponseHeaderSize(data FieldSizePayload) ErrorCode { - return cm.New[ErrorCode](27, data) -} - -// HTTPResponseHeaderSize returns a non-nil *[FieldSizePayload] if [ErrorCode] represents the variant case "HTTP-response-header-size". -func (self *ErrorCode) HTTPResponseHeaderSize() *FieldSizePayload { - return cm.Case[FieldSizePayload](self, 27) -} - -// ErrorCodeHTTPResponseBodySize returns a [ErrorCode] of case "HTTP-response-body-size". -func ErrorCodeHTTPResponseBodySize(data cm.Option[uint64]) ErrorCode { - return cm.New[ErrorCode](28, data) -} - -// HTTPResponseBodySize returns a non-nil *[cm.Option[uint64]] if [ErrorCode] represents the variant case "HTTP-response-body-size". -func (self *ErrorCode) HTTPResponseBodySize() *cm.Option[uint64] { - return cm.Case[cm.Option[uint64]](self, 28) -} - -// ErrorCodeHTTPResponseTrailerSectionSize returns a [ErrorCode] of case "HTTP-response-trailer-section-size". -func ErrorCodeHTTPResponseTrailerSectionSize(data cm.Option[uint32]) ErrorCode { - return cm.New[ErrorCode](29, data) -} - -// HTTPResponseTrailerSectionSize returns a non-nil *[cm.Option[uint32]] if [ErrorCode] represents the variant case "HTTP-response-trailer-section-size". -func (self *ErrorCode) HTTPResponseTrailerSectionSize() *cm.Option[uint32] { - return cm.Case[cm.Option[uint32]](self, 29) -} - -// ErrorCodeHTTPResponseTrailerSize returns a [ErrorCode] of case "HTTP-response-trailer-size". -func ErrorCodeHTTPResponseTrailerSize(data FieldSizePayload) ErrorCode { - return cm.New[ErrorCode](30, data) -} - -// HTTPResponseTrailerSize returns a non-nil *[FieldSizePayload] if [ErrorCode] represents the variant case "HTTP-response-trailer-size". -func (self *ErrorCode) HTTPResponseTrailerSize() *FieldSizePayload { - return cm.Case[FieldSizePayload](self, 30) -} - -// ErrorCodeHTTPResponseTransferCoding returns a [ErrorCode] of case "HTTP-response-transfer-coding". -func ErrorCodeHTTPResponseTransferCoding(data cm.Option[string]) ErrorCode { - return cm.New[ErrorCode](31, data) -} - -// HTTPResponseTransferCoding returns a non-nil *[cm.Option[string]] if [ErrorCode] represents the variant case "HTTP-response-transfer-coding". -func (self *ErrorCode) HTTPResponseTransferCoding() *cm.Option[string] { - return cm.Case[cm.Option[string]](self, 31) -} - -// ErrorCodeHTTPResponseContentCoding returns a [ErrorCode] of case "HTTP-response-content-coding". -func ErrorCodeHTTPResponseContentCoding(data cm.Option[string]) ErrorCode { - return cm.New[ErrorCode](32, data) -} - -// HTTPResponseContentCoding returns a non-nil *[cm.Option[string]] if [ErrorCode] represents the variant case "HTTP-response-content-coding". -func (self *ErrorCode) HTTPResponseContentCoding() *cm.Option[string] { - return cm.Case[cm.Option[string]](self, 32) -} - -// ErrorCodeHTTPResponseTimeout returns a [ErrorCode] of case "HTTP-response-timeout". -func ErrorCodeHTTPResponseTimeout() ErrorCode { - var data struct{} - return cm.New[ErrorCode](33, data) -} - -// HTTPResponseTimeout returns true if [ErrorCode] represents the variant case "HTTP-response-timeout". -func (self *ErrorCode) HTTPResponseTimeout() bool { - return self.Tag() == 33 -} - -// ErrorCodeHTTPUpgradeFailed returns a [ErrorCode] of case "HTTP-upgrade-failed". -func ErrorCodeHTTPUpgradeFailed() ErrorCode { - var data struct{} - return cm.New[ErrorCode](34, data) -} - -// HTTPUpgradeFailed returns true if [ErrorCode] represents the variant case "HTTP-upgrade-failed". -func (self *ErrorCode) HTTPUpgradeFailed() bool { - return self.Tag() == 34 -} - -// ErrorCodeHTTPProtocolError returns a [ErrorCode] of case "HTTP-protocol-error". -func ErrorCodeHTTPProtocolError() ErrorCode { - var data struct{} - return cm.New[ErrorCode](35, data) -} - -// HTTPProtocolError returns true if [ErrorCode] represents the variant case "HTTP-protocol-error". -func (self *ErrorCode) HTTPProtocolError() bool { - return self.Tag() == 35 -} - -// ErrorCodeLoopDetected returns a [ErrorCode] of case "loop-detected". -func ErrorCodeLoopDetected() ErrorCode { - var data struct{} - return cm.New[ErrorCode](36, data) -} - -// LoopDetected returns true if [ErrorCode] represents the variant case "loop-detected". -func (self *ErrorCode) LoopDetected() bool { - return self.Tag() == 36 -} - -// ErrorCodeConfigurationError returns a [ErrorCode] of case "configuration-error". -func ErrorCodeConfigurationError() ErrorCode { - var data struct{} - return cm.New[ErrorCode](37, data) -} - -// ConfigurationError returns true if [ErrorCode] represents the variant case "configuration-error". -func (self *ErrorCode) ConfigurationError() bool { - return self.Tag() == 37 -} - -// ErrorCodeInternalError returns a [ErrorCode] of case "internal-error". -func ErrorCodeInternalError(data cm.Option[string]) ErrorCode { - return cm.New[ErrorCode](38, data) -} - -// InternalError returns a non-nil *[cm.Option[string]] if [ErrorCode] represents the variant case "internal-error". -func (self *ErrorCode) InternalError() *cm.Option[string] { - return cm.Case[cm.Option[string]](self, 38) -} - -var stringsErrorCode = [39]string{ - "DNS-timeout", - "DNS-error", - "destination-not-found", - "destination-unavailable", - "destination-IP-prohibited", - "destination-IP-unroutable", - "connection-refused", - "connection-terminated", - "connection-timeout", - "connection-read-timeout", - "connection-write-timeout", - "connection-limit-reached", - "TLS-protocol-error", - "TLS-certificate-error", - "TLS-alert-received", - "HTTP-request-denied", - "HTTP-request-length-required", - "HTTP-request-body-size", - "HTTP-request-method-invalid", - "HTTP-request-URI-invalid", - "HTTP-request-URI-too-long", - "HTTP-request-header-section-size", - "HTTP-request-header-size", - "HTTP-request-trailer-section-size", - "HTTP-request-trailer-size", - "HTTP-response-incomplete", - "HTTP-response-header-section-size", - "HTTP-response-header-size", - "HTTP-response-body-size", - "HTTP-response-trailer-section-size", - "HTTP-response-trailer-size", - "HTTP-response-transfer-coding", - "HTTP-response-content-coding", - "HTTP-response-timeout", - "HTTP-upgrade-failed", - "HTTP-protocol-error", - "loop-detected", - "configuration-error", - "internal-error", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v ErrorCode) String() string { - return stringsErrorCode[v.Tag()] -} - -// HeaderError represents the variant "wasi:http/types@0.2.0#header-error". -// -// variant header-error { -// invalid-syntax, -// forbidden, -// immutable, -// } -type HeaderError uint8 - -const ( - HeaderErrorInvalidSyntax HeaderError = iota - HeaderErrorForbidden - HeaderErrorImmutable -) - -var stringsHeaderError = [3]string{ - "invalid-syntax", - "forbidden", - "immutable", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e HeaderError) String() string { - return stringsHeaderError[e] -} - -// FieldKey represents the string "wasi:http/types@0.2.0#field-key". -// -// type field-key = string -type FieldKey string - -// FieldValue represents the list "wasi:http/types@0.2.0#field-value". -// -// type field-value = list -type FieldValue cm.List[uint8] - -// Fields represents the imported resource "wasi:http/types@0.2.0#fields". -// -// resource fields -type Fields cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "fields". -// -// Drops a resource handle. -// -//go:nosplit -func (self Fields) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FieldsResourceDrop((uint32)(self0)) - return -} - -// NewFields represents the imported constructor for resource "fields". -// -// constructor() -// -//go:nosplit -func NewFields() (result Fields) { - result0 := wasmimport_NewFields() - result = cm.Reinterpret[Fields]((uint32)(result0)) - return -} - -// FieldsFromList represents the imported static function "from-list". -// -// from-list: static func(entries: list>) -> result -// -//go:nosplit -func FieldsFromList(entries cm.List[cm.Tuple[FieldKey, FieldValue]]) (result cm.Result[Fields, Fields, HeaderError]) { - entries0, entries1 := cm.LowerList(entries) - wasmimport_FieldsFromList((*cm.Tuple[FieldKey, FieldValue])(entries0), (uint32)(entries1), &result) - return -} - -// Append represents the imported method "append". -// -// append: func(name: field-key, value: field-value) -> result<_, header-error> -// -//go:nosplit -func (self Fields) Append(name FieldKey, value FieldValue) (result cm.Result[HeaderError, struct{}, HeaderError]) { - self0 := cm.Reinterpret[uint32](self) - name0, name1 := cm.LowerString(name) - value0, value1 := cm.LowerList(value) - wasmimport_FieldsAppend((uint32)(self0), (*uint8)(name0), (uint32)(name1), (*uint8)(value0), (uint32)(value1), &result) - return -} - -// Clone represents the imported method "clone". -// -// clone: func() -> fields -// -//go:nosplit -func (self Fields) Clone() (result Fields) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_FieldsClone((uint32)(self0)) - result = cm.Reinterpret[Fields]((uint32)(result0)) - return -} - -// Delete represents the imported method "delete". -// -// delete: func(name: field-key) -> result<_, header-error> -// -//go:nosplit -func (self Fields) Delete(name FieldKey) (result cm.Result[HeaderError, struct{}, HeaderError]) { - self0 := cm.Reinterpret[uint32](self) - name0, name1 := cm.LowerString(name) - wasmimport_FieldsDelete((uint32)(self0), (*uint8)(name0), (uint32)(name1), &result) - return -} - -// Entries represents the imported method "entries". -// -// entries: func() -> list> -// -//go:nosplit -func (self Fields) Entries() (result cm.List[cm.Tuple[FieldKey, FieldValue]]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FieldsEntries((uint32)(self0), &result) - return -} - -// Get represents the imported method "get". -// -// get: func(name: field-key) -> list -// -//go:nosplit -func (self Fields) Get(name FieldKey) (result cm.List[FieldValue]) { - self0 := cm.Reinterpret[uint32](self) - name0, name1 := cm.LowerString(name) - wasmimport_FieldsGet((uint32)(self0), (*uint8)(name0), (uint32)(name1), &result) - return -} - -// Has represents the imported method "has". -// -// has: func(name: field-key) -> bool -// -//go:nosplit -func (self Fields) Has(name FieldKey) (result bool) { - self0 := cm.Reinterpret[uint32](self) - name0, name1 := cm.LowerString(name) - result0 := wasmimport_FieldsHas((uint32)(self0), (*uint8)(name0), (uint32)(name1)) - result = (bool)(cm.U32ToBool((uint32)(result0))) - return -} - -// Set represents the imported method "set". -// -// set: func(name: field-key, value: list) -> result<_, header-error> -// -//go:nosplit -func (self Fields) Set(name FieldKey, value cm.List[FieldValue]) (result cm.Result[HeaderError, struct{}, HeaderError]) { - self0 := cm.Reinterpret[uint32](self) - name0, name1 := cm.LowerString(name) - value0, value1 := cm.LowerList(value) - wasmimport_FieldsSet((uint32)(self0), (*uint8)(name0), (uint32)(name1), (*FieldValue)(value0), (uint32)(value1), &result) - return -} - -// Headers represents the imported type alias "wasi:http/types@0.2.0#headers". -// -// See [Fields] for more information. -type Headers = Fields - -// Trailers represents the imported type alias "wasi:http/types@0.2.0#trailers". -// -// See [Fields] for more information. -type Trailers = Fields - -// IncomingRequest represents the imported resource "wasi:http/types@0.2.0#incoming-request". -// -// resource incoming-request -type IncomingRequest cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "incoming-request". -// -// Drops a resource handle. -// -//go:nosplit -func (self IncomingRequest) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestResourceDrop((uint32)(self0)) - return -} - -// Authority represents the imported method "authority". -// -// authority: func() -> option -// -//go:nosplit -func (self IncomingRequest) Authority() (result cm.Option[string]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestAuthority((uint32)(self0), &result) - return -} - -// Consume represents the imported method "consume". -// -// consume: func() -> result -// -//go:nosplit -func (self IncomingRequest) Consume() (result cm.Result[IncomingBody, IncomingBody, struct{}]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestConsume((uint32)(self0), &result) - return -} - -// Headers represents the imported method "headers". -// -// headers: func() -> headers -// -//go:nosplit -func (self IncomingRequest) Headers() (result Headers) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_IncomingRequestHeaders((uint32)(self0)) - result = cm.Reinterpret[Headers]((uint32)(result0)) - return -} - -// Method represents the imported method "method". -// -// method: func() -> method -// -//go:nosplit -func (self IncomingRequest) Method() (result Method) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestMethod((uint32)(self0), &result) - return -} - -// PathWithQuery represents the imported method "path-with-query". -// -// path-with-query: func() -> option -// -//go:nosplit -func (self IncomingRequest) PathWithQuery() (result cm.Option[string]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestPathWithQuery((uint32)(self0), &result) - return -} - -// Scheme represents the imported method "scheme". -// -// scheme: func() -> option -// -//go:nosplit -func (self IncomingRequest) Scheme() (result cm.Option[Scheme]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingRequestScheme((uint32)(self0), &result) - return -} - -// OutgoingRequest represents the imported resource "wasi:http/types@0.2.0#outgoing-request". -// -// resource outgoing-request -type OutgoingRequest cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "outgoing-request". -// -// Drops a resource handle. -// -//go:nosplit -func (self OutgoingRequest) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestResourceDrop((uint32)(self0)) - return -} - -// NewOutgoingRequest represents the imported constructor for resource "outgoing-request". -// -// constructor(headers: headers) -// -//go:nosplit -func NewOutgoingRequest(headers Headers) (result OutgoingRequest) { - headers0 := cm.Reinterpret[uint32](headers) - result0 := wasmimport_NewOutgoingRequest((uint32)(headers0)) - result = cm.Reinterpret[OutgoingRequest]((uint32)(result0)) - return -} - -// Authority represents the imported method "authority". -// -// authority: func() -> option -// -//go:nosplit -func (self OutgoingRequest) Authority() (result cm.Option[string]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestAuthority((uint32)(self0), &result) - return -} - -// Body represents the imported method "body". -// -// body: func() -> result -// -//go:nosplit -func (self OutgoingRequest) Body() (result cm.Result[OutgoingBody, OutgoingBody, struct{}]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestBody((uint32)(self0), &result) - return -} - -// Headers represents the imported method "headers". -// -// headers: func() -> headers -// -//go:nosplit -func (self OutgoingRequest) Headers() (result Headers) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutgoingRequestHeaders((uint32)(self0)) - result = cm.Reinterpret[Headers]((uint32)(result0)) - return -} - -// Method represents the imported method "method". -// -// method: func() -> method -// -//go:nosplit -func (self OutgoingRequest) Method() (result Method) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestMethod((uint32)(self0), &result) - return -} - -// PathWithQuery represents the imported method "path-with-query". -// -// path-with-query: func() -> option -// -//go:nosplit -func (self OutgoingRequest) PathWithQuery() (result cm.Option[string]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestPathWithQuery((uint32)(self0), &result) - return -} - -// Scheme represents the imported method "scheme". -// -// scheme: func() -> option -// -//go:nosplit -func (self OutgoingRequest) Scheme() (result cm.Option[Scheme]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingRequestScheme((uint32)(self0), &result) - return -} - -// SetAuthority represents the imported method "set-authority". -// -// set-authority: func(authority: option) -> result -// -//go:nosplit -func (self OutgoingRequest) SetAuthority(authority cm.Option[string]) (result cm.BoolResult) { - self0 := cm.Reinterpret[uint32](self) - authority0, authority1, authority2 := lower_OptionString(authority) - result0 := wasmimport_OutgoingRequestSetAuthority((uint32)(self0), (uint32)(authority0), (*uint8)(authority1), (uint32)(authority2)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) - return -} - -// SetMethod represents the imported method "set-method". -// -// set-method: func(method: method) -> result -// -//go:nosplit -func (self OutgoingRequest) SetMethod(method Method) (result cm.BoolResult) { - self0 := cm.Reinterpret[uint32](self) - method0, method1, method2 := lower_Method(method) - result0 := wasmimport_OutgoingRequestSetMethod((uint32)(self0), (uint32)(method0), (*uint8)(method1), (uint32)(method2)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) - return -} - -// SetPathWithQuery represents the imported method "set-path-with-query". -// -// set-path-with-query: func(path-with-query: option) -> result -// -//go:nosplit -func (self OutgoingRequest) SetPathWithQuery(pathWithQuery cm.Option[string]) (result cm.BoolResult) { - self0 := cm.Reinterpret[uint32](self) - pathWithQuery0, pathWithQuery1, pathWithQuery2 := lower_OptionString(pathWithQuery) - result0 := wasmimport_OutgoingRequestSetPathWithQuery((uint32)(self0), (uint32)(pathWithQuery0), (*uint8)(pathWithQuery1), (uint32)(pathWithQuery2)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) - return -} - -// SetScheme represents the imported method "set-scheme". -// -// set-scheme: func(scheme: option) -> result -// -//go:nosplit -func (self OutgoingRequest) SetScheme(scheme cm.Option[Scheme]) (result cm.BoolResult) { - self0 := cm.Reinterpret[uint32](self) - scheme0, scheme1, scheme2, scheme3 := lower_OptionScheme(scheme) - result0 := wasmimport_OutgoingRequestSetScheme((uint32)(self0), (uint32)(scheme0), (uint32)(scheme1), (*uint8)(scheme2), (uint32)(scheme3)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) - return -} - -// RequestOptions represents the imported resource "wasi:http/types@0.2.0#request-options". -// -// resource request-options -type RequestOptions cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "request-options". -// -// Drops a resource handle. -// -//go:nosplit -func (self RequestOptions) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsResourceDrop((uint32)(self0)) - return -} - -// NewRequestOptions represents the imported constructor for resource "request-options". -// -// constructor() -// -//go:nosplit -func NewRequestOptions() (result RequestOptions) { - result0 := wasmimport_NewRequestOptions() - result = cm.Reinterpret[RequestOptions]((uint32)(result0)) - return -} - -// BetweenBytesTimeout represents the imported method "between-bytes-timeout". -// -// between-bytes-timeout: func() -> option -// -//go:nosplit -func (self RequestOptions) BetweenBytesTimeout() (result cm.Option[Duration]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsBetweenBytesTimeout((uint32)(self0), &result) - return -} - -// ConnectTimeout represents the imported method "connect-timeout". -// -// connect-timeout: func() -> option -// -//go:nosplit -func (self RequestOptions) ConnectTimeout() (result cm.Option[Duration]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsConnectTimeout((uint32)(self0), &result) - return -} - -// FirstByteTimeout represents the imported method "first-byte-timeout". -// -// first-byte-timeout: func() -> option -// -//go:nosplit -func (self RequestOptions) FirstByteTimeout() (result cm.Option[Duration]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_RequestOptionsFirstByteTimeout((uint32)(self0), &result) - return -} - -// SetBetweenBytesTimeout represents the imported method "set-between-bytes-timeout". -// -// set-between-bytes-timeout: func(duration: option) -> result -// -//go:nosplit -func (self RequestOptions) SetBetweenBytesTimeout(duration cm.Option[Duration]) (result cm.BoolResult) { - self0 := cm.Reinterpret[uint32](self) - duration0, duration1 := lower_OptionDuration(duration) - result0 := wasmimport_RequestOptionsSetBetweenBytesTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) - return -} - -// SetConnectTimeout represents the imported method "set-connect-timeout". -// -// set-connect-timeout: func(duration: option) -> result -// -//go:nosplit -func (self RequestOptions) SetConnectTimeout(duration cm.Option[Duration]) (result cm.BoolResult) { - self0 := cm.Reinterpret[uint32](self) - duration0, duration1 := lower_OptionDuration(duration) - result0 := wasmimport_RequestOptionsSetConnectTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) - return -} - -// SetFirstByteTimeout represents the imported method "set-first-byte-timeout". -// -// set-first-byte-timeout: func(duration: option) -> result -// -//go:nosplit -func (self RequestOptions) SetFirstByteTimeout(duration cm.Option[Duration]) (result cm.BoolResult) { - self0 := cm.Reinterpret[uint32](self) - duration0, duration1 := lower_OptionDuration(duration) - result0 := wasmimport_RequestOptionsSetFirstByteTimeout((uint32)(self0), (uint32)(duration0), (uint64)(duration1)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) - return -} - -// ResponseOutparam represents the imported resource "wasi:http/types@0.2.0#response-outparam". -// -// resource response-outparam -type ResponseOutparam cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "response-outparam". -// -// Drops a resource handle. -// -//go:nosplit -func (self ResponseOutparam) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_ResponseOutparamResourceDrop((uint32)(self0)) - return -} - -// ResponseOutparamSet represents the imported static function "set". -// -// set: static func(param: response-outparam, response: result) -// -//go:nosplit -func ResponseOutparamSet(param ResponseOutparam, response cm.Result[ErrorCodeShape, OutgoingResponse, ErrorCode]) { - param0 := cm.Reinterpret[uint32](param) - response0, response1, response2, response3, response4, response5, response6, response7 := lower_ResultOutgoingResponseErrorCode(response) - wasmimport_ResponseOutparamSet((uint32)(param0), (uint32)(response0), (uint32)(response1), (uint32)(response2), (uint64)(response3), (uint32)(response4), (uint32)(response5), (uint32)(response6), (uint32)(response7)) - return -} - -// StatusCode represents the u16 "wasi:http/types@0.2.0#status-code". -// -// type status-code = u16 -type StatusCode uint16 - -// IncomingResponse represents the imported resource "wasi:http/types@0.2.0#incoming-response". -// -// resource incoming-response -type IncomingResponse cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "incoming-response". -// -// Drops a resource handle. -// -//go:nosplit -func (self IncomingResponse) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingResponseResourceDrop((uint32)(self0)) - return -} - -// Consume represents the imported method "consume". -// -// consume: func() -> result -// -//go:nosplit -func (self IncomingResponse) Consume() (result cm.Result[IncomingBody, IncomingBody, struct{}]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingResponseConsume((uint32)(self0), &result) - return -} - -// Headers represents the imported method "headers". -// -// headers: func() -> headers -// -//go:nosplit -func (self IncomingResponse) Headers() (result Headers) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_IncomingResponseHeaders((uint32)(self0)) - result = cm.Reinterpret[Headers]((uint32)(result0)) - return -} - -// Status represents the imported method "status". -// -// status: func() -> status-code -// -//go:nosplit -func (self IncomingResponse) Status() (result StatusCode) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_IncomingResponseStatus((uint32)(self0)) - result = (StatusCode)((uint32)(result0)) - return -} - -// IncomingBody represents the imported resource "wasi:http/types@0.2.0#incoming-body". -// -// resource incoming-body -type IncomingBody cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "incoming-body". -// -// Drops a resource handle. -// -//go:nosplit -func (self IncomingBody) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingBodyResourceDrop((uint32)(self0)) - return -} - -// IncomingBodyFinish represents the imported static function "finish". -// -// finish: static func(this: incoming-body) -> future-trailers -// -//go:nosplit -func IncomingBodyFinish(this IncomingBody) (result FutureTrailers) { - this0 := cm.Reinterpret[uint32](this) - result0 := wasmimport_IncomingBodyFinish((uint32)(this0)) - result = cm.Reinterpret[FutureTrailers]((uint32)(result0)) - return -} - -// Stream represents the imported method "stream". -// -// %stream: func() -> result -// -//go:nosplit -func (self IncomingBody) Stream() (result cm.Result[InputStream, InputStream, struct{}]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingBodyStream((uint32)(self0), &result) - return -} - -// FutureTrailers represents the imported resource "wasi:http/types@0.2.0#future-trailers". -// -// resource future-trailers -type FutureTrailers cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "future-trailers". -// -// Drops a resource handle. -// -//go:nosplit -func (self FutureTrailers) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureTrailersResourceDrop((uint32)(self0)) - return -} - -// Get represents the imported method "get". -// -// get: func() -> option, error-code>>> -// -//go:nosplit -func (self FutureTrailers) Get() (result cm.Option[cm.Result[cm.Result[ErrorCodeShape, cm.Option[Trailers], ErrorCode], cm.Result[ErrorCodeShape, cm.Option[Trailers], ErrorCode], struct{}]]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureTrailersGet((uint32)(self0), &result) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -> pollable -// -//go:nosplit -func (self FutureTrailers) Subscribe() (result Pollable) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_FutureTrailersSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) - return -} - -// OutgoingResponse represents the imported resource "wasi:http/types@0.2.0#outgoing-response". -// -// resource outgoing-response -type OutgoingResponse cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "outgoing-response". -// -// Drops a resource handle. -// -//go:nosplit -func (self OutgoingResponse) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingResponseResourceDrop((uint32)(self0)) - return -} - -// NewOutgoingResponse represents the imported constructor for resource "outgoing-response". -// -// constructor(headers: headers) -// -//go:nosplit -func NewOutgoingResponse(headers Headers) (result OutgoingResponse) { - headers0 := cm.Reinterpret[uint32](headers) - result0 := wasmimport_NewOutgoingResponse((uint32)(headers0)) - result = cm.Reinterpret[OutgoingResponse]((uint32)(result0)) - return -} - -// Body represents the imported method "body". -// -// body: func() -> result -// -//go:nosplit -func (self OutgoingResponse) Body() (result cm.Result[OutgoingBody, OutgoingBody, struct{}]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingResponseBody((uint32)(self0), &result) - return -} - -// Headers represents the imported method "headers". -// -// headers: func() -> headers -// -//go:nosplit -func (self OutgoingResponse) Headers() (result Headers) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutgoingResponseHeaders((uint32)(self0)) - result = cm.Reinterpret[Headers]((uint32)(result0)) - return -} - -// SetStatusCode represents the imported method "set-status-code". -// -// set-status-code: func(status-code: status-code) -> result -// -//go:nosplit -func (self OutgoingResponse) SetStatusCode(statusCode StatusCode) (result cm.BoolResult) { - self0 := cm.Reinterpret[uint32](self) - statusCode0 := (uint32)(statusCode) - result0 := wasmimport_OutgoingResponseSetStatusCode((uint32)(self0), (uint32)(statusCode0)) - result = (cm.BoolResult)((bool)(cm.U32ToBool((uint32)(result0)))) - return -} - -// StatusCode represents the imported method "status-code". -// -// status-code: func() -> status-code -// -//go:nosplit -func (self OutgoingResponse) StatusCode() (result StatusCode) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutgoingResponseStatusCode((uint32)(self0)) - result = (StatusCode)((uint32)(result0)) - return -} - -// OutgoingBody represents the imported resource "wasi:http/types@0.2.0#outgoing-body". -// -// resource outgoing-body -type OutgoingBody cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "outgoing-body". -// -// Drops a resource handle. -// -//go:nosplit -func (self OutgoingBody) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingBodyResourceDrop((uint32)(self0)) - return -} - -// OutgoingBodyFinish represents the imported static function "finish". -// -// finish: static func(this: outgoing-body, trailers: option) -> result<_, -// error-code> -// -//go:nosplit -func OutgoingBodyFinish(this OutgoingBody, trailers cm.Option[Trailers]) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - this0 := cm.Reinterpret[uint32](this) - trailers0, trailers1 := lower_OptionTrailers(trailers) - wasmimport_OutgoingBodyFinish((uint32)(this0), (uint32)(trailers0), (uint32)(trailers1), &result) - return -} - -// Write represents the imported method "write". -// -// write: func() -> result -// -//go:nosplit -func (self OutgoingBody) Write() (result cm.Result[OutputStream, OutputStream, struct{}]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingBodyWrite((uint32)(self0), &result) - return -} - -// FutureIncomingResponse represents the imported resource "wasi:http/types@0.2.0#future-incoming-response". -// -// resource future-incoming-response -type FutureIncomingResponse cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "future-incoming-response". -// -// Drops a resource handle. -// -//go:nosplit -func (self FutureIncomingResponse) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureIncomingResponseResourceDrop((uint32)(self0)) - return -} - -// Get represents the imported method "get". -// -// get: func() -> option>> -// -//go:nosplit -func (self FutureIncomingResponse) Get() (result cm.Option[cm.Result[cm.Result[ErrorCodeShape, IncomingResponse, ErrorCode], cm.Result[ErrorCodeShape, IncomingResponse, ErrorCode], struct{}]]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_FutureIncomingResponseGet((uint32)(self0), &result) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -> pollable -// -//go:nosplit -func (self FutureIncomingResponse) Subscribe() (result Pollable) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_FutureIncomingResponseSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) - return -} - -// HTTPErrorCode represents the imported function "http-error-code". -// -// http-error-code: func(err: borrow) -> option -// -//go:nosplit -func HTTPErrorCode(err IOError) (result cm.Option[ErrorCode]) { - err0 := cm.Reinterpret[uint32](err) - wasmimport_HTTPErrorCode((uint32)(err0), &result) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/io/error/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/io/error/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/io/error/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/io/error/error.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/io/error/error.wit.go deleted file mode 100644 index 828e977e..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/io/error/error.wit.go +++ /dev/null @@ -1,35 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package ioerror represents the imported interface "wasi:io/error@0.2.0". -package ioerror - -import ( - "go.bytecodealliance.org/cm" -) - -// Error represents the imported resource "wasi:io/error@0.2.0#error". -// -// resource error -type Error cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "error". -// -// Drops a resource handle. -// -//go:nosplit -func (self Error) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_ErrorResourceDrop((uint32)(self0)) - return -} - -// ToDebugString represents the imported method "to-debug-string". -// -// to-debug-string: func() -> string -// -//go:nosplit -func (self Error) ToDebugString() (result string) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_ErrorToDebugString((uint32)(self0), &result) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/io/error/ioerror.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/io/error/ioerror.wasm.go deleted file mode 100755 index e254b5d8..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/io/error/ioerror.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package ioerror - -// This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". - -//go:wasmimport wasi:io/error@0.2.0 [resource-drop]error -//go:noescape -func wasmimport_ErrorResourceDrop(self0 uint32) - -//go:wasmimport wasi:io/error@0.2.0 [method]error.to-debug-string -//go:noescape -func wasmimport_ErrorToDebugString(self0 uint32, result *string) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/io/poll/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/io/poll/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/io/poll/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/io/poll/poll.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/io/poll/poll.wasm.go deleted file mode 100755 index f7c55c3d..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/io/poll/poll.wasm.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package poll - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". - -//go:wasmimport wasi:io/poll@0.2.0 [resource-drop]pollable -//go:noescape -func wasmimport_PollableResourceDrop(self0 uint32) - -//go:wasmimport wasi:io/poll@0.2.0 [method]pollable.block -//go:noescape -func wasmimport_PollableBlock(self0 uint32) - -//go:wasmimport wasi:io/poll@0.2.0 [method]pollable.ready -//go:noescape -func wasmimport_PollableReady(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:io/poll@0.2.0 poll -//go:noescape -func wasmimport_Poll(in0 *Pollable, in1 uint32, result *cm.List[uint32]) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/io/poll/poll.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/io/poll/poll.wit.go deleted file mode 100644 index ad9e9564..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/io/poll/poll.wit.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package poll represents the imported interface "wasi:io/poll@0.2.0". -package poll - -import ( - "go.bytecodealliance.org/cm" -) - -// Pollable represents the imported resource "wasi:io/poll@0.2.0#pollable". -// -// resource pollable -type Pollable cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "pollable". -// -// Drops a resource handle. -// -//go:nosplit -func (self Pollable) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_PollableResourceDrop((uint32)(self0)) - return -} - -// Block represents the imported method "block". -// -// block: func() -// -//go:nosplit -func (self Pollable) Block() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_PollableBlock((uint32)(self0)) - return -} - -// Ready represents the imported method "ready". -// -// ready: func() -> bool -// -//go:nosplit -func (self Pollable) Ready() (result bool) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_PollableReady((uint32)(self0)) - result = (bool)(cm.U32ToBool((uint32)(result0))) - return -} - -// Poll represents the imported function "poll". -// -// poll: func(in: list>) -> list -// -//go:nosplit -func Poll(in cm.List[Pollable]) (result cm.List[uint32]) { - in0, in1 := cm.LowerList(in) - wasmimport_Poll((*Pollable)(in0), (uint32)(in1), &result) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/io/streams/abi.go b/examples/component/sqldb-postgres-query/gen/wasi/io/streams/abi.go deleted file mode 100644 index 5f150028..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/io/streams/abi.go +++ /dev/null @@ -1,12 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package streams - -import ( - "unsafe" -) - -// StreamErrorShape is used for storage in variant or result types. -type StreamErrorShape struct { - shape [unsafe.Sizeof(StreamError{})]byte -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/io/streams/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/io/streams/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/io/streams/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/io/streams/streams.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/io/streams/streams.wasm.go deleted file mode 100755 index eec56645..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/io/streams/streams.wasm.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package streams - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:io@0.2.0". - -//go:wasmimport wasi:io/streams@0.2.0 [resource-drop]input-stream -//go:noescape -func wasmimport_InputStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.blocking-read -//go:noescape -func wasmimport_InputStreamBlockingRead(self0 uint32, len0 uint64, result *cm.Result[cm.List[uint8], cm.List[uint8], StreamError]) - -//go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.blocking-skip -//go:noescape -func wasmimport_InputStreamBlockingSkip(self0 uint32, len0 uint64, result *cm.Result[uint64, uint64, StreamError]) - -//go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.read -//go:noescape -func wasmimport_InputStreamRead(self0 uint32, len0 uint64, result *cm.Result[cm.List[uint8], cm.List[uint8], StreamError]) - -//go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.skip -//go:noescape -func wasmimport_InputStreamSkip(self0 uint32, len0 uint64, result *cm.Result[uint64, uint64, StreamError]) - -//go:wasmimport wasi:io/streams@0.2.0 [method]input-stream.subscribe -//go:noescape -func wasmimport_InputStreamSubscribe(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [resource-drop]output-stream -//go:noescape -func wasmimport_OutputStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-flush -//go:noescape -func wasmimport_OutputStreamBlockingFlush(self0 uint32, result *cm.Result[StreamError, struct{}, StreamError]) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-splice -//go:noescape -func wasmimport_OutputStreamBlockingSplice(self0 uint32, src0 uint32, len0 uint64, result *cm.Result[uint64, uint64, StreamError]) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-write-and-flush -//go:noescape -func wasmimport_OutputStreamBlockingWriteAndFlush(self0 uint32, contents0 *uint8, contents1 uint32, result *cm.Result[StreamError, struct{}, StreamError]) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.blocking-write-zeroes-and-flush -//go:noescape -func wasmimport_OutputStreamBlockingWriteZeroesAndFlush(self0 uint32, len0 uint64, result *cm.Result[StreamError, struct{}, StreamError]) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.check-write -//go:noescape -func wasmimport_OutputStreamCheckWrite(self0 uint32, result *cm.Result[uint64, uint64, StreamError]) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.flush -//go:noescape -func wasmimport_OutputStreamFlush(self0 uint32, result *cm.Result[StreamError, struct{}, StreamError]) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.splice -//go:noescape -func wasmimport_OutputStreamSplice(self0 uint32, src0 uint32, len0 uint64, result *cm.Result[uint64, uint64, StreamError]) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.subscribe -//go:noescape -func wasmimport_OutputStreamSubscribe(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.write -//go:noescape -func wasmimport_OutputStreamWrite(self0 uint32, contents0 *uint8, contents1 uint32, result *cm.Result[StreamError, struct{}, StreamError]) - -//go:wasmimport wasi:io/streams@0.2.0 [method]output-stream.write-zeroes -//go:noescape -func wasmimport_OutputStreamWriteZeroes(self0 uint32, len0 uint64, result *cm.Result[StreamError, struct{}, StreamError]) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/io/streams/streams.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/io/streams/streams.wit.go deleted file mode 100644 index 510f3a68..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/io/streams/streams.wit.go +++ /dev/null @@ -1,270 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package streams represents the imported interface "wasi:io/streams@0.2.0". -package streams - -import ( - "go.bytecodealliance.org/cm" - ioerror "sqldb-postgres-query/gen/wasi/io/error" - "sqldb-postgres-query/gen/wasi/io/poll" -) - -// Error represents the imported type alias "wasi:io/streams@0.2.0#error". -// -// See [ioerror.Error] for more information. -type Error = ioerror.Error - -// Pollable represents the imported type alias "wasi:io/streams@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// StreamError represents the imported variant "wasi:io/streams@0.2.0#stream-error". -// -// variant stream-error { -// last-operation-failed(error), -// closed, -// } -type StreamError cm.Variant[uint8, Error, Error] - -// StreamErrorLastOperationFailed returns a [StreamError] of case "last-operation-failed". -func StreamErrorLastOperationFailed(data Error) StreamError { - return cm.New[StreamError](0, data) -} - -// LastOperationFailed returns a non-nil *[Error] if [StreamError] represents the variant case "last-operation-failed". -func (self *StreamError) LastOperationFailed() *Error { - return cm.Case[Error](self, 0) -} - -// StreamErrorClosed returns a [StreamError] of case "closed". -func StreamErrorClosed() StreamError { - var data struct{} - return cm.New[StreamError](1, data) -} - -// Closed returns true if [StreamError] represents the variant case "closed". -func (self *StreamError) Closed() bool { - return self.Tag() == 1 -} - -var stringsStreamError = [2]string{ - "last-operation-failed", - "closed", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v StreamError) String() string { - return stringsStreamError[v.Tag()] -} - -// InputStream represents the imported resource "wasi:io/streams@0.2.0#input-stream". -// -// resource input-stream -type InputStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "input-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self InputStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_InputStreamResourceDrop((uint32)(self0)) - return -} - -// BlockingRead represents the imported method "blocking-read". -// -// blocking-read: func(len: u64) -> result, stream-error> -// -//go:nosplit -func (self InputStream) BlockingRead(len_ uint64) (result cm.Result[cm.List[uint8], cm.List[uint8], StreamError]) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_InputStreamBlockingRead((uint32)(self0), (uint64)(len0), &result) - return -} - -// BlockingSkip represents the imported method "blocking-skip". -// -// blocking-skip: func(len: u64) -> result -// -//go:nosplit -func (self InputStream) BlockingSkip(len_ uint64) (result cm.Result[uint64, uint64, StreamError]) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_InputStreamBlockingSkip((uint32)(self0), (uint64)(len0), &result) - return -} - -// Read represents the imported method "read". -// -// read: func(len: u64) -> result, stream-error> -// -//go:nosplit -func (self InputStream) Read(len_ uint64) (result cm.Result[cm.List[uint8], cm.List[uint8], StreamError]) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_InputStreamRead((uint32)(self0), (uint64)(len0), &result) - return -} - -// Skip represents the imported method "skip". -// -// skip: func(len: u64) -> result -// -//go:nosplit -func (self InputStream) Skip(len_ uint64) (result cm.Result[uint64, uint64, StreamError]) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_InputStreamSkip((uint32)(self0), (uint64)(len0), &result) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -> pollable -// -//go:nosplit -func (self InputStream) Subscribe() (result Pollable) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_InputStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) - return -} - -// OutputStream represents the imported resource "wasi:io/streams@0.2.0#output-stream". -// -// resource output-stream -type OutputStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "output-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self OutputStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamResourceDrop((uint32)(self0)) - return -} - -// BlockingFlush represents the imported method "blocking-flush". -// -// blocking-flush: func() -> result<_, stream-error> -// -//go:nosplit -func (self OutputStream) BlockingFlush() (result cm.Result[StreamError, struct{}, StreamError]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamBlockingFlush((uint32)(self0), &result) - return -} - -// BlockingSplice represents the imported method "blocking-splice". -// -// blocking-splice: func(src: borrow, len: u64) -> result -// -//go:nosplit -func (self OutputStream) BlockingSplice(src InputStream, len_ uint64) (result cm.Result[uint64, uint64, StreamError]) { - self0 := cm.Reinterpret[uint32](self) - src0 := cm.Reinterpret[uint32](src) - len0 := (uint64)(len_) - wasmimport_OutputStreamBlockingSplice((uint32)(self0), (uint32)(src0), (uint64)(len0), &result) - return -} - -// BlockingWriteAndFlush represents the imported method "blocking-write-and-flush". -// -// blocking-write-and-flush: func(contents: list) -> result<_, stream-error> -// -//go:nosplit -func (self OutputStream) BlockingWriteAndFlush(contents cm.List[uint8]) (result cm.Result[StreamError, struct{}, StreamError]) { - self0 := cm.Reinterpret[uint32](self) - contents0, contents1 := cm.LowerList(contents) - wasmimport_OutputStreamBlockingWriteAndFlush((uint32)(self0), (*uint8)(contents0), (uint32)(contents1), &result) - return -} - -// BlockingWriteZeroesAndFlush represents the imported method "blocking-write-zeroes-and-flush". -// -// blocking-write-zeroes-and-flush: func(len: u64) -> result<_, stream-error> -// -//go:nosplit -func (self OutputStream) BlockingWriteZeroesAndFlush(len_ uint64) (result cm.Result[StreamError, struct{}, StreamError]) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_OutputStreamBlockingWriteZeroesAndFlush((uint32)(self0), (uint64)(len0), &result) - return -} - -// CheckWrite represents the imported method "check-write". -// -// check-write: func() -> result -// -//go:nosplit -func (self OutputStream) CheckWrite() (result cm.Result[uint64, uint64, StreamError]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamCheckWrite((uint32)(self0), &result) - return -} - -// Flush represents the imported method "flush". -// -// flush: func() -> result<_, stream-error> -// -//go:nosplit -func (self OutputStream) Flush() (result cm.Result[StreamError, struct{}, StreamError]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutputStreamFlush((uint32)(self0), &result) - return -} - -// Splice represents the imported method "splice". -// -// splice: func(src: borrow, len: u64) -> result -// -//go:nosplit -func (self OutputStream) Splice(src InputStream, len_ uint64) (result cm.Result[uint64, uint64, StreamError]) { - self0 := cm.Reinterpret[uint32](self) - src0 := cm.Reinterpret[uint32](src) - len0 := (uint64)(len_) - wasmimport_OutputStreamSplice((uint32)(self0), (uint32)(src0), (uint64)(len0), &result) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -> pollable -// -//go:nosplit -func (self OutputStream) Subscribe() (result Pollable) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutputStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) - return -} - -// Write represents the imported method "write". -// -// write: func(contents: list) -> result<_, stream-error> -// -//go:nosplit -func (self OutputStream) Write(contents cm.List[uint8]) (result cm.Result[StreamError, struct{}, StreamError]) { - self0 := cm.Reinterpret[uint32](self) - contents0, contents1 := cm.LowerList(contents) - wasmimport_OutputStreamWrite((uint32)(self0), (*uint8)(contents0), (uint32)(contents1), &result) - return -} - -// WriteZeroes represents the imported method "write-zeroes". -// -// write-zeroes: func(len: u64) -> result<_, stream-error> -// -//go:nosplit -func (self OutputStream) WriteZeroes(len_ uint64) (result cm.Result[StreamError, struct{}, StreamError]) { - self0 := cm.Reinterpret[uint32](self) - len0 := (uint64)(len_) - wasmimport_OutputStreamWriteZeroes((uint32)(self0), (uint64)(len0), &result) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/logging/logging/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/logging/logging/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/logging/logging/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/logging/logging/logging.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/logging/logging/logging.wasm.go deleted file mode 100755 index d2d27098..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/logging/logging/logging.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package logging - -// This file contains wasmimport and wasmexport declarations for "wasi:logging@0.1.0-draft". - -//go:wasmimport wasi:logging/logging@0.1.0-draft log -//go:noescape -func wasmimport_Log(level0 uint32, context0 *uint8, context1 uint32, message0 *uint8, message1 uint32) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/logging/logging/logging.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/logging/logging/logging.wit.go deleted file mode 100644 index 96e406ed..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/logging/logging/logging.wit.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package logging represents the imported interface "wasi:logging/logging@0.1.0-draft". -package logging - -import ( - "go.bytecodealliance.org/cm" -) - -// Level represents the enum "wasi:logging/logging@0.1.0-draft#level". -// -// enum level { -// trace, -// debug, -// info, -// warn, -// error, -// critical -// } -type Level uint8 - -const ( - LevelTrace Level = iota - LevelDebug - LevelInfo - LevelWarn - LevelError - LevelCritical -) - -var stringsLevel = [6]string{ - "trace", - "debug", - "info", - "warn", - "error", - "critical", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e Level) String() string { - return stringsLevel[e] -} - -// Log represents the imported function "log". -// -// log: func(level: level, context: string, message: string) -// -//go:nosplit -func Log(level Level, context string, message string) { - level0 := (uint32)(level) - context0, context1 := cm.LowerString(context) - message0, message1 := cm.LowerString(message) - wasmimport_Log((uint32)(level0), (*uint8)(context0), (uint32)(context1), (*uint8)(message0), (uint32)(message1)) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/random/insecure-seed/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/random/insecure-seed/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/random/insecure-seed/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/random/insecure-seed/insecure-seed.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/random/insecure-seed/insecure-seed.wit.go deleted file mode 100644 index e701d1b4..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/random/insecure-seed/insecure-seed.wit.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package insecureseed represents the imported interface "wasi:random/insecure-seed@0.2.0". -package insecureseed - -// InsecureSeed represents the imported function "insecure-seed". -// -// insecure-seed: func() -> tuple -// -//go:nosplit -func InsecureSeed() (result [2]uint64) { - wasmimport_InsecureSeed(&result) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/random/insecure-seed/insecureseed.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/random/insecure-seed/insecureseed.wasm.go deleted file mode 100755 index e94356df..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/random/insecure-seed/insecureseed.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package insecureseed - -// This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". - -//go:wasmimport wasi:random/insecure-seed@0.2.0 insecure-seed -//go:noescape -func wasmimport_InsecureSeed(result *[2]uint64) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/random/insecure/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/random/insecure/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/random/insecure/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/random/insecure/insecure.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/random/insecure/insecure.wasm.go deleted file mode 100755 index 498bfe4a..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/random/insecure/insecure.wasm.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package insecure - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". - -//go:wasmimport wasi:random/insecure@0.2.0 get-insecure-random-bytes -//go:noescape -func wasmimport_GetInsecureRandomBytes(len0 uint64, result *cm.List[uint8]) - -//go:wasmimport wasi:random/insecure@0.2.0 get-insecure-random-u64 -//go:noescape -func wasmimport_GetInsecureRandomU64() (result0 uint64) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/random/insecure/insecure.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/random/insecure/insecure.wit.go deleted file mode 100644 index f32282c6..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/random/insecure/insecure.wit.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package insecure represents the imported interface "wasi:random/insecure@0.2.0". -package insecure - -import ( - "go.bytecodealliance.org/cm" -) - -// GetInsecureRandomBytes represents the imported function "get-insecure-random-bytes". -// -// get-insecure-random-bytes: func(len: u64) -> list -// -//go:nosplit -func GetInsecureRandomBytes(len_ uint64) (result cm.List[uint8]) { - len0 := (uint64)(len_) - wasmimport_GetInsecureRandomBytes((uint64)(len0), &result) - return -} - -// GetInsecureRandomU64 represents the imported function "get-insecure-random-u64". -// -// get-insecure-random-u64: func() -> u64 -// -//go:nosplit -func GetInsecureRandomU64() (result uint64) { - result0 := wasmimport_GetInsecureRandomU64() - result = (uint64)((uint64)(result0)) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/random/random/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/random/random/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/random/random/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/random/random/random.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/random/random/random.wasm.go deleted file mode 100755 index 9096457b..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/random/random/random.wasm.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package random - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:random@0.2.0". - -//go:wasmimport wasi:random/random@0.2.0 get-random-bytes -//go:noescape -func wasmimport_GetRandomBytes(len0 uint64, result *cm.List[uint8]) - -//go:wasmimport wasi:random/random@0.2.0 get-random-u64 -//go:noescape -func wasmimport_GetRandomU64() (result0 uint64) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/random/random/random.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/random/random/random.wit.go deleted file mode 100644 index 98bb7779..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/random/random/random.wit.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package random represents the imported interface "wasi:random/random@0.2.0". -package random - -import ( - "go.bytecodealliance.org/cm" -) - -// GetRandomBytes represents the imported function "get-random-bytes". -// -// get-random-bytes: func(len: u64) -> list -// -//go:nosplit -func GetRandomBytes(len_ uint64) (result cm.List[uint8]) { - len0 := (uint64)(len_) - wasmimport_GetRandomBytes((uint64)(len0), &result) - return -} - -// GetRandomU64 represents the imported function "get-random-u64". -// -// get-random-u64: func() -> u64 -// -//go:nosplit -func GetRandomU64() (result uint64) { - result0 := wasmimport_GetRandomU64() - result = (uint64)((uint64)(result0)) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/sockets/instance-network/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/sockets/instance-network/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/sockets/instance-network/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/sockets/instance-network/instance-network.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/sockets/instance-network/instance-network.wit.go deleted file mode 100644 index 642b4a68..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/sockets/instance-network/instance-network.wit.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package instancenetwork represents the imported interface "wasi:sockets/instance-network@0.2.0". -package instancenetwork - -import ( - "go.bytecodealliance.org/cm" - "sqldb-postgres-query/gen/wasi/sockets/network" -) - -// Network represents the imported type alias "wasi:sockets/instance-network@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// InstanceNetwork represents the imported function "instance-network". -// -// instance-network: func() -> network -// -//go:nosplit -func InstanceNetwork() (result Network) { - result0 := wasmimport_InstanceNetwork() - result = cm.Reinterpret[Network]((uint32)(result0)) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/sockets/instance-network/instancenetwork.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/sockets/instance-network/instancenetwork.wasm.go deleted file mode 100755 index eb113e21..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/sockets/instance-network/instancenetwork.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package instancenetwork - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/instance-network@0.2.0 instance-network -//go:noescape -func wasmimport_InstanceNetwork() (result0 uint32) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/sockets/ip-name-lookup/abi.go b/examples/component/sqldb-postgres-query/gen/wasi/sockets/ip-name-lookup/abi.go deleted file mode 100644 index a63f0d01..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/sockets/ip-name-lookup/abi.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package ipnamelookup - -import ( - "go.bytecodealliance.org/cm" - "unsafe" -) - -// OptionIPAddressShape is used for storage in variant or result types. -type OptionIPAddressShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Option[IPAddress]{})]byte -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/sockets/ip-name-lookup/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/sockets/ip-name-lookup/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/sockets/ip-name-lookup/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go deleted file mode 100644 index dd8a712e..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/sockets/ip-name-lookup/ip-name-lookup.wit.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package ipnamelookup represents the imported interface "wasi:sockets/ip-name-lookup@0.2.0". -package ipnamelookup - -import ( - "go.bytecodealliance.org/cm" - "sqldb-postgres-query/gen/wasi/io/poll" - "sqldb-postgres-query/gen/wasi/sockets/network" -) - -// Pollable represents the imported type alias "wasi:sockets/ip-name-lookup@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// Network represents the imported type alias "wasi:sockets/ip-name-lookup@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// ErrorCode represents the type alias "wasi:sockets/ip-name-lookup@0.2.0#error-code". -// -// See [network.ErrorCode] for more information. -type ErrorCode = network.ErrorCode - -// IPAddress represents the type alias "wasi:sockets/ip-name-lookup@0.2.0#ip-address". -// -// See [network.IPAddress] for more information. -type IPAddress = network.IPAddress - -// ResolveAddressStream represents the imported resource "wasi:sockets/ip-name-lookup@0.2.0#resolve-address-stream". -// -// resource resolve-address-stream -type ResolveAddressStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "resolve-address-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self ResolveAddressStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_ResolveAddressStreamResourceDrop((uint32)(self0)) - return -} - -// ResolveNextAddress represents the imported method "resolve-next-address". -// -// resolve-next-address: func() -> result, error-code> -// -//go:nosplit -func (self ResolveAddressStream) ResolveNextAddress() (result cm.Result[OptionIPAddressShape, cm.Option[IPAddress], ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_ResolveAddressStreamResolveNextAddress((uint32)(self0), &result) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -> pollable -// -//go:nosplit -func (self ResolveAddressStream) Subscribe() (result Pollable) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_ResolveAddressStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) - return -} - -// ResolveAddresses represents the imported function "resolve-addresses". -// -// resolve-addresses: func(network: borrow, name: string) -> result -// -//go:nosplit -func ResolveAddresses(network_ Network, name string) (result cm.Result[ResolveAddressStream, ResolveAddressStream, ErrorCode]) { - network0 := cm.Reinterpret[uint32](network_) - name0, name1 := cm.LowerString(name) - wasmimport_ResolveAddresses((uint32)(network0), (*uint8)(name0), (uint32)(name1), &result) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go deleted file mode 100755 index da5fb000..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/sockets/ip-name-lookup/ipnamelookup.wasm.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package ipnamelookup - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 [resource-drop]resolve-address-stream -//go:noescape -func wasmimport_ResolveAddressStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 [method]resolve-address-stream.resolve-next-address -//go:noescape -func wasmimport_ResolveAddressStreamResolveNextAddress(self0 uint32, result *cm.Result[OptionIPAddressShape, cm.Option[IPAddress], ErrorCode]) - -//go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 [method]resolve-address-stream.subscribe -//go:noescape -func wasmimport_ResolveAddressStreamSubscribe(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:sockets/ip-name-lookup@0.2.0 resolve-addresses -//go:noescape -func wasmimport_ResolveAddresses(network0 uint32, name0 *uint8, name1 uint32, result *cm.Result[ResolveAddressStream, ResolveAddressStream, ErrorCode]) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/sockets/network/abi.go b/examples/component/sqldb-postgres-query/gen/wasi/sockets/network/abi.go deleted file mode 100644 index a088bd1d..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/sockets/network/abi.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package network - -import ( - "go.bytecodealliance.org/cm" - "unsafe" -) - -// IPv6SocketAddressShape is used for storage in variant or result types. -type IPv6SocketAddressShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(IPv6SocketAddress{})]byte -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/sockets/network/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/sockets/network/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/sockets/network/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/sockets/network/network.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/sockets/network/network.wasm.go deleted file mode 100755 index 012a79ff..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/sockets/network/network.wasm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package network - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/network@0.2.0 [resource-drop]network -//go:noescape -func wasmimport_NetworkResourceDrop(self0 uint32) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/sockets/network/network.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/sockets/network/network.wit.go deleted file mode 100644 index f0fb7eef..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/sockets/network/network.wit.go +++ /dev/null @@ -1,241 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package network represents the imported interface "wasi:sockets/network@0.2.0". -package network - -import ( - "go.bytecodealliance.org/cm" -) - -// Network represents the imported resource "wasi:sockets/network@0.2.0#network". -// -// resource network -type Network cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "network". -// -// Drops a resource handle. -// -//go:nosplit -func (self Network) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_NetworkResourceDrop((uint32)(self0)) - return -} - -// ErrorCode represents the enum "wasi:sockets/network@0.2.0#error-code". -// -// enum error-code { -// unknown, -// access-denied, -// not-supported, -// invalid-argument, -// out-of-memory, -// timeout, -// concurrency-conflict, -// not-in-progress, -// would-block, -// invalid-state, -// new-socket-limit, -// address-not-bindable, -// address-in-use, -// remote-unreachable, -// connection-refused, -// connection-reset, -// connection-aborted, -// datagram-too-large, -// name-unresolvable, -// temporary-resolver-failure, -// permanent-resolver-failure -// } -type ErrorCode uint8 - -const ( - ErrorCodeUnknown ErrorCode = iota - ErrorCodeAccessDenied - ErrorCodeNotSupported - ErrorCodeInvalidArgument - ErrorCodeOutOfMemory - ErrorCodeTimeout - ErrorCodeConcurrencyConflict - ErrorCodeNotInProgress - ErrorCodeWouldBlock - ErrorCodeInvalidState - ErrorCodeNewSocketLimit - ErrorCodeAddressNotBindable - ErrorCodeAddressInUse - ErrorCodeRemoteUnreachable - ErrorCodeConnectionRefused - ErrorCodeConnectionReset - ErrorCodeConnectionAborted - ErrorCodeDatagramTooLarge - ErrorCodeNameUnresolvable - ErrorCodeTemporaryResolverFailure - ErrorCodePermanentResolverFailure -) - -var stringsErrorCode = [21]string{ - "unknown", - "access-denied", - "not-supported", - "invalid-argument", - "out-of-memory", - "timeout", - "concurrency-conflict", - "not-in-progress", - "would-block", - "invalid-state", - "new-socket-limit", - "address-not-bindable", - "address-in-use", - "remote-unreachable", - "connection-refused", - "connection-reset", - "connection-aborted", - "datagram-too-large", - "name-unresolvable", - "temporary-resolver-failure", - "permanent-resolver-failure", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e ErrorCode) String() string { - return stringsErrorCode[e] -} - -// IPAddressFamily represents the enum "wasi:sockets/network@0.2.0#ip-address-family". -// -// enum ip-address-family { -// ipv4, -// ipv6 -// } -type IPAddressFamily uint8 - -const ( - IPAddressFamilyIPv4 IPAddressFamily = iota - IPAddressFamilyIPv6 -) - -var stringsIPAddressFamily = [2]string{ - "ipv4", - "ipv6", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e IPAddressFamily) String() string { - return stringsIPAddressFamily[e] -} - -// IPv4Address represents the tuple "wasi:sockets/network@0.2.0#ipv4-address". -// -// type ipv4-address = tuple -type IPv4Address [4]uint8 - -// IPv6Address represents the tuple "wasi:sockets/network@0.2.0#ipv6-address". -// -// type ipv6-address = tuple -type IPv6Address [8]uint16 - -// IPAddress represents the variant "wasi:sockets/network@0.2.0#ip-address". -// -// variant ip-address { -// ipv4(ipv4-address), -// ipv6(ipv6-address), -// } -type IPAddress cm.Variant[uint8, IPv6Address, IPv6Address] - -// IPAddressIPv4 returns a [IPAddress] of case "ipv4". -func IPAddressIPv4(data IPv4Address) IPAddress { - return cm.New[IPAddress](0, data) -} - -// IPv4 returns a non-nil *[IPv4Address] if [IPAddress] represents the variant case "ipv4". -func (self *IPAddress) IPv4() *IPv4Address { - return cm.Case[IPv4Address](self, 0) -} - -// IPAddressIPv6 returns a [IPAddress] of case "ipv6". -func IPAddressIPv6(data IPv6Address) IPAddress { - return cm.New[IPAddress](1, data) -} - -// IPv6 returns a non-nil *[IPv6Address] if [IPAddress] represents the variant case "ipv6". -func (self *IPAddress) IPv6() *IPv6Address { - return cm.Case[IPv6Address](self, 1) -} - -var stringsIPAddress = [2]string{ - "ipv4", - "ipv6", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v IPAddress) String() string { - return stringsIPAddress[v.Tag()] -} - -// IPv4SocketAddress represents the record "wasi:sockets/network@0.2.0#ipv4-socket-address". -// -// record ipv4-socket-address { -// port: u16, -// address: ipv4-address, -// } -type IPv4SocketAddress struct { - _ cm.HostLayout - Port uint16 - Address IPv4Address -} - -// IPv6SocketAddress represents the record "wasi:sockets/network@0.2.0#ipv6-socket-address". -// -// record ipv6-socket-address { -// port: u16, -// flow-info: u32, -// address: ipv6-address, -// scope-id: u32, -// } -type IPv6SocketAddress struct { - _ cm.HostLayout - Port uint16 - FlowInfo uint32 - Address IPv6Address - ScopeID uint32 -} - -// IPSocketAddress represents the variant "wasi:sockets/network@0.2.0#ip-socket-address". -// -// variant ip-socket-address { -// ipv4(ipv4-socket-address), -// ipv6(ipv6-socket-address), -// } -type IPSocketAddress cm.Variant[uint8, IPv6SocketAddressShape, IPv6SocketAddress] - -// IPSocketAddressIPv4 returns a [IPSocketAddress] of case "ipv4". -func IPSocketAddressIPv4(data IPv4SocketAddress) IPSocketAddress { - return cm.New[IPSocketAddress](0, data) -} - -// IPv4 returns a non-nil *[IPv4SocketAddress] if [IPSocketAddress] represents the variant case "ipv4". -func (self *IPSocketAddress) IPv4() *IPv4SocketAddress { - return cm.Case[IPv4SocketAddress](self, 0) -} - -// IPSocketAddressIPv6 returns a [IPSocketAddress] of case "ipv6". -func IPSocketAddressIPv6(data IPv6SocketAddress) IPSocketAddress { - return cm.New[IPSocketAddress](1, data) -} - -// IPv6 returns a non-nil *[IPv6SocketAddress] if [IPSocketAddress] represents the variant case "ipv6". -func (self *IPSocketAddress) IPv6() *IPv6SocketAddress { - return cm.Case[IPv6SocketAddress](self, 1) -} - -var stringsIPSocketAddress = [2]string{ - "ipv4", - "ipv6", -} - -// String implements [fmt.Stringer], returning the variant case name of v. -func (v IPSocketAddress) String() string { - return stringsIPSocketAddress[v.Tag()] -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/sockets/tcp-create-socket/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/sockets/tcp-create-socket/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/sockets/tcp-create-socket/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go deleted file mode 100644 index a153fc84..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/sockets/tcp-create-socket/tcp-create-socket.wit.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package tcpcreatesocket represents the imported interface "wasi:sockets/tcp-create-socket@0.2.0". -package tcpcreatesocket - -import ( - "go.bytecodealliance.org/cm" - "sqldb-postgres-query/gen/wasi/sockets/network" - "sqldb-postgres-query/gen/wasi/sockets/tcp" -) - -// Network represents the imported type alias "wasi:sockets/tcp-create-socket@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// ErrorCode represents the type alias "wasi:sockets/tcp-create-socket@0.2.0#error-code". -// -// See [network.ErrorCode] for more information. -type ErrorCode = network.ErrorCode - -// IPAddressFamily represents the type alias "wasi:sockets/tcp-create-socket@0.2.0#ip-address-family". -// -// See [network.IPAddressFamily] for more information. -type IPAddressFamily = network.IPAddressFamily - -// TCPSocket represents the imported type alias "wasi:sockets/tcp-create-socket@0.2.0#tcp-socket". -// -// See [tcp.TCPSocket] for more information. -type TCPSocket = tcp.TCPSocket - -// CreateTCPSocket represents the imported function "create-tcp-socket". -// -// create-tcp-socket: func(address-family: ip-address-family) -> result -// -//go:nosplit -func CreateTCPSocket(addressFamily IPAddressFamily) (result cm.Result[TCPSocket, TCPSocket, ErrorCode]) { - addressFamily0 := (uint32)(addressFamily) - wasmimport_CreateTCPSocket((uint32)(addressFamily0), &result) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go deleted file mode 100755 index b7b43155..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/sockets/tcp-create-socket/tcpcreatesocket.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package tcpcreatesocket - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/tcp-create-socket@0.2.0 create-tcp-socket -//go:noescape -func wasmimport_CreateTCPSocket(addressFamily0 uint32, result *cm.Result[TCPSocket, TCPSocket, ErrorCode]) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/sockets/tcp/abi.go b/examples/component/sqldb-postgres-query/gen/wasi/sockets/tcp/abi.go deleted file mode 100644 index 3fa55217..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/sockets/tcp/abi.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package tcp - -import ( - "go.bytecodealliance.org/cm" - "sqldb-postgres-query/gen/wasi/sockets/network" - "unsafe" -) - -// TupleTCPSocketInputStreamOutputStreamShape is used for storage in variant or result types. -type TupleTCPSocketInputStreamOutputStreamShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Tuple3[TCPSocket, InputStream, OutputStream]{})]byte -} - -// TupleInputStreamOutputStreamShape is used for storage in variant or result types. -type TupleInputStreamOutputStreamShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Tuple[InputStream, OutputStream]{})]byte -} - -// IPSocketAddressShape is used for storage in variant or result types. -type IPSocketAddressShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(network.IPSocketAddress{})]byte -} - -func lower_IPv4Address(v network.IPv4Address) (f0 uint32, f1 uint32, f2 uint32, f3 uint32) { - f0 = (uint32)(v[0]) - f1 = (uint32)(v[1]) - f2 = (uint32)(v[2]) - f3 = (uint32)(v[3]) - return -} - -func lower_IPv4SocketAddress(v network.IPv4SocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32) { - f0 = (uint32)(v.Port) - f1, f2, f3, f4 = lower_IPv4Address(v.Address) - return -} - -func lower_IPv6Address(v network.IPv6Address) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32) { - f0 = (uint32)(v[0]) - f1 = (uint32)(v[1]) - f2 = (uint32)(v[2]) - f3 = (uint32)(v[3]) - f4 = (uint32)(v[4]) - f5 = (uint32)(v[5]) - f6 = (uint32)(v[6]) - f7 = (uint32)(v[7]) - return -} - -func lower_IPv6SocketAddress(v network.IPv6SocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32) { - f0 = (uint32)(v.Port) - f1 = (uint32)(v.FlowInfo) - f2, f3, f4, f5, f6, f7, f8, f9 = lower_IPv6Address(v.Address) - f10 = (uint32)(v.ScopeID) - return -} - -func lower_IPSocketAddress(v network.IPSocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32, f11 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 0: // ipv4 - v1, v2, v3, v4, v5 := lower_IPv4SocketAddress(*cm.Case[network.IPv4SocketAddress](&v, 0)) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 1: // ipv6 - v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11 := lower_IPv6SocketAddress(*cm.Case[network.IPv6SocketAddress](&v, 1)) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - f6 = (uint32)(v6) - f7 = (uint32)(v7) - f8 = (uint32)(v8) - f9 = (uint32)(v9) - f10 = (uint32)(v10) - f11 = (uint32)(v11) - } - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/sockets/tcp/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/sockets/tcp/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/sockets/tcp/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/sockets/tcp/tcp.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/sockets/tcp/tcp.wasm.go deleted file mode 100755 index 56247525..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/sockets/tcp/tcp.wasm.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package tcp - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/tcp@0.2.0 [resource-drop]tcp-socket -//go:noescape -func wasmimport_TCPSocketResourceDrop(self0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.accept -//go:noescape -func wasmimport_TCPSocketAccept(self0 uint32, result *cm.Result[TupleTCPSocketInputStreamOutputStreamShape, cm.Tuple3[TCPSocket, InputStream, OutputStream], ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.address-family -//go:noescape -func wasmimport_TCPSocketAddressFamily(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-bind -//go:noescape -func wasmimport_TCPSocketFinishBind(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-connect -//go:noescape -func wasmimport_TCPSocketFinishConnect(self0 uint32, result *cm.Result[TupleInputStreamOutputStreamShape, cm.Tuple[InputStream, OutputStream], ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-listen -//go:noescape -func wasmimport_TCPSocketFinishListen(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.hop-limit -//go:noescape -func wasmimport_TCPSocketHopLimit(self0 uint32, result *cm.Result[uint8, uint8, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.is-listening -//go:noescape -func wasmimport_TCPSocketIsListening(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-count -//go:noescape -func wasmimport_TCPSocketKeepAliveCount(self0 uint32, result *cm.Result[uint32, uint32, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-enabled -//go:noescape -func wasmimport_TCPSocketKeepAliveEnabled(self0 uint32, result *cm.Result[bool, bool, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-idle-time -//go:noescape -func wasmimport_TCPSocketKeepAliveIdleTime(self0 uint32, result *cm.Result[uint64, Duration, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-interval -//go:noescape -func wasmimport_TCPSocketKeepAliveInterval(self0 uint32, result *cm.Result[uint64, Duration, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.local-address -//go:noescape -func wasmimport_TCPSocketLocalAddress(self0 uint32, result *cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.receive-buffer-size -//go:noescape -func wasmimport_TCPSocketReceiveBufferSize(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.remote-address -//go:noescape -func wasmimport_TCPSocketRemoteAddress(self0 uint32, result *cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.send-buffer-size -//go:noescape -func wasmimport_TCPSocketSendBufferSize(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-hop-limit -//go:noescape -func wasmimport_TCPSocketSetHopLimit(self0 uint32, value0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-count -//go:noescape -func wasmimport_TCPSocketSetKeepAliveCount(self0 uint32, value0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-enabled -//go:noescape -func wasmimport_TCPSocketSetKeepAliveEnabled(self0 uint32, value0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-idle-time -//go:noescape -func wasmimport_TCPSocketSetKeepAliveIdleTime(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-interval -//go:noescape -func wasmimport_TCPSocketSetKeepAliveInterval(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-listen-backlog-size -//go:noescape -func wasmimport_TCPSocketSetListenBacklogSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-receive-buffer-size -//go:noescape -func wasmimport_TCPSocketSetReceiveBufferSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-send-buffer-size -//go:noescape -func wasmimport_TCPSocketSetSendBufferSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.shutdown -//go:noescape -func wasmimport_TCPSocketShutdown(self0 uint32, shutdownType0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-bind -//go:noescape -func wasmimport_TCPSocketStartBind(self0 uint32, network0 uint32, localAddress0 uint32, localAddress1 uint32, localAddress2 uint32, localAddress3 uint32, localAddress4 uint32, localAddress5 uint32, localAddress6 uint32, localAddress7 uint32, localAddress8 uint32, localAddress9 uint32, localAddress10 uint32, localAddress11 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-connect -//go:noescape -func wasmimport_TCPSocketStartConnect(self0 uint32, network0 uint32, remoteAddress0 uint32, remoteAddress1 uint32, remoteAddress2 uint32, remoteAddress3 uint32, remoteAddress4 uint32, remoteAddress5 uint32, remoteAddress6 uint32, remoteAddress7 uint32, remoteAddress8 uint32, remoteAddress9 uint32, remoteAddress10 uint32, remoteAddress11 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-listen -//go:noescape -func wasmimport_TCPSocketStartListen(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.subscribe -//go:noescape -func wasmimport_TCPSocketSubscribe(self0 uint32) (result0 uint32) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/sockets/tcp/tcp.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/sockets/tcp/tcp.wit.go deleted file mode 100644 index 2b31043c..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/sockets/tcp/tcp.wit.go +++ /dev/null @@ -1,420 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package tcp represents the imported interface "wasi:sockets/tcp@0.2.0". -package tcp - -import ( - "go.bytecodealliance.org/cm" - monotonicclock "sqldb-postgres-query/gen/wasi/clocks/monotonic-clock" - "sqldb-postgres-query/gen/wasi/io/poll" - "sqldb-postgres-query/gen/wasi/io/streams" - "sqldb-postgres-query/gen/wasi/sockets/network" -) - -// InputStream represents the imported type alias "wasi:sockets/tcp@0.2.0#input-stream". -// -// See [streams.InputStream] for more information. -type InputStream = streams.InputStream - -// OutputStream represents the imported type alias "wasi:sockets/tcp@0.2.0#output-stream". -// -// See [streams.OutputStream] for more information. -type OutputStream = streams.OutputStream - -// Pollable represents the imported type alias "wasi:sockets/tcp@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// Duration represents the type alias "wasi:sockets/tcp@0.2.0#duration". -// -// See [monotonicclock.Duration] for more information. -type Duration = monotonicclock.Duration - -// Network represents the imported type alias "wasi:sockets/tcp@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// ErrorCode represents the type alias "wasi:sockets/tcp@0.2.0#error-code". -// -// See [network.ErrorCode] for more information. -type ErrorCode = network.ErrorCode - -// IPSocketAddress represents the type alias "wasi:sockets/tcp@0.2.0#ip-socket-address". -// -// See [network.IPSocketAddress] for more information. -type IPSocketAddress = network.IPSocketAddress - -// IPAddressFamily represents the type alias "wasi:sockets/tcp@0.2.0#ip-address-family". -// -// See [network.IPAddressFamily] for more information. -type IPAddressFamily = network.IPAddressFamily - -// ShutdownType represents the enum "wasi:sockets/tcp@0.2.0#shutdown-type". -// -// enum shutdown-type { -// receive, -// send, -// both -// } -type ShutdownType uint8 - -const ( - ShutdownTypeReceive ShutdownType = iota - ShutdownTypeSend - ShutdownTypeBoth -) - -var stringsShutdownType = [3]string{ - "receive", - "send", - "both", -} - -// String implements [fmt.Stringer], returning the enum case name of e. -func (e ShutdownType) String() string { - return stringsShutdownType[e] -} - -// TCPSocket represents the imported resource "wasi:sockets/tcp@0.2.0#tcp-socket". -// -// resource tcp-socket -type TCPSocket cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "tcp-socket". -// -// Drops a resource handle. -// -//go:nosplit -func (self TCPSocket) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketResourceDrop((uint32)(self0)) - return -} - -// Accept represents the imported method "accept". -// -// accept: func() -> result, error-code> -// -//go:nosplit -func (self TCPSocket) Accept() (result cm.Result[TupleTCPSocketInputStreamOutputStreamShape, cm.Tuple3[TCPSocket, InputStream, OutputStream], ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketAccept((uint32)(self0), &result) - return -} - -// AddressFamily represents the imported method "address-family". -// -// address-family: func() -> ip-address-family -// -//go:nosplit -func (self TCPSocket) AddressFamily() (result IPAddressFamily) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_TCPSocketAddressFamily((uint32)(self0)) - result = (network.IPAddressFamily)((uint32)(result0)) - return -} - -// FinishBind represents the imported method "finish-bind". -// -// finish-bind: func() -> result<_, error-code> -// -//go:nosplit -func (self TCPSocket) FinishBind() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketFinishBind((uint32)(self0), &result) - return -} - -// FinishConnect represents the imported method "finish-connect". -// -// finish-connect: func() -> result, error-code> -// -//go:nosplit -func (self TCPSocket) FinishConnect() (result cm.Result[TupleInputStreamOutputStreamShape, cm.Tuple[InputStream, OutputStream], ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketFinishConnect((uint32)(self0), &result) - return -} - -// FinishListen represents the imported method "finish-listen". -// -// finish-listen: func() -> result<_, error-code> -// -//go:nosplit -func (self TCPSocket) FinishListen() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketFinishListen((uint32)(self0), &result) - return -} - -// HopLimit represents the imported method "hop-limit". -// -// hop-limit: func() -> result -// -//go:nosplit -func (self TCPSocket) HopLimit() (result cm.Result[uint8, uint8, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketHopLimit((uint32)(self0), &result) - return -} - -// IsListening represents the imported method "is-listening". -// -// is-listening: func() -> bool -// -//go:nosplit -func (self TCPSocket) IsListening() (result bool) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_TCPSocketIsListening((uint32)(self0)) - result = (bool)(cm.U32ToBool((uint32)(result0))) - return -} - -// KeepAliveCount represents the imported method "keep-alive-count". -// -// keep-alive-count: func() -> result -// -//go:nosplit -func (self TCPSocket) KeepAliveCount() (result cm.Result[uint32, uint32, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveCount((uint32)(self0), &result) - return -} - -// KeepAliveEnabled represents the imported method "keep-alive-enabled". -// -// keep-alive-enabled: func() -> result -// -//go:nosplit -func (self TCPSocket) KeepAliveEnabled() (result cm.Result[bool, bool, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveEnabled((uint32)(self0), &result) - return -} - -// KeepAliveIdleTime represents the imported method "keep-alive-idle-time". -// -// keep-alive-idle-time: func() -> result -// -//go:nosplit -func (self TCPSocket) KeepAliveIdleTime() (result cm.Result[uint64, Duration, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveIdleTime((uint32)(self0), &result) - return -} - -// KeepAliveInterval represents the imported method "keep-alive-interval". -// -// keep-alive-interval: func() -> result -// -//go:nosplit -func (self TCPSocket) KeepAliveInterval() (result cm.Result[uint64, Duration, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketKeepAliveInterval((uint32)(self0), &result) - return -} - -// LocalAddress represents the imported method "local-address". -// -// local-address: func() -> result -// -//go:nosplit -func (self TCPSocket) LocalAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketLocalAddress((uint32)(self0), &result) - return -} - -// ReceiveBufferSize represents the imported method "receive-buffer-size". -// -// receive-buffer-size: func() -> result -// -//go:nosplit -func (self TCPSocket) ReceiveBufferSize() (result cm.Result[uint64, uint64, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketReceiveBufferSize((uint32)(self0), &result) - return -} - -// RemoteAddress represents the imported method "remote-address". -// -// remote-address: func() -> result -// -//go:nosplit -func (self TCPSocket) RemoteAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketRemoteAddress((uint32)(self0), &result) - return -} - -// SendBufferSize represents the imported method "send-buffer-size". -// -// send-buffer-size: func() -> result -// -//go:nosplit -func (self TCPSocket) SendBufferSize() (result cm.Result[uint64, uint64, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketSendBufferSize((uint32)(self0), &result) - return -} - -// SetHopLimit represents the imported method "set-hop-limit". -// -// set-hop-limit: func(value: u8) -> result<_, error-code> -// -//go:nosplit -func (self TCPSocket) SetHopLimit(value uint8) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint32)(value) - wasmimport_TCPSocketSetHopLimit((uint32)(self0), (uint32)(value0), &result) - return -} - -// SetKeepAliveCount represents the imported method "set-keep-alive-count". -// -// set-keep-alive-count: func(value: u32) -> result<_, error-code> -// -//go:nosplit -func (self TCPSocket) SetKeepAliveCount(value uint32) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint32)(value) - wasmimport_TCPSocketSetKeepAliveCount((uint32)(self0), (uint32)(value0), &result) - return -} - -// SetKeepAliveEnabled represents the imported method "set-keep-alive-enabled". -// -// set-keep-alive-enabled: func(value: bool) -> result<_, error-code> -// -//go:nosplit -func (self TCPSocket) SetKeepAliveEnabled(value bool) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint32)(cm.BoolToU32(value)) - wasmimport_TCPSocketSetKeepAliveEnabled((uint32)(self0), (uint32)(value0), &result) - return -} - -// SetKeepAliveIdleTime represents the imported method "set-keep-alive-idle-time". -// -// set-keep-alive-idle-time: func(value: duration) -> result<_, error-code> -// -//go:nosplit -func (self TCPSocket) SetKeepAliveIdleTime(value Duration) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_TCPSocketSetKeepAliveIdleTime((uint32)(self0), (uint64)(value0), &result) - return -} - -// SetKeepAliveInterval represents the imported method "set-keep-alive-interval". -// -// set-keep-alive-interval: func(value: duration) -> result<_, error-code> -// -//go:nosplit -func (self TCPSocket) SetKeepAliveInterval(value Duration) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_TCPSocketSetKeepAliveInterval((uint32)(self0), (uint64)(value0), &result) - return -} - -// SetListenBacklogSize represents the imported method "set-listen-backlog-size". -// -// set-listen-backlog-size: func(value: u64) -> result<_, error-code> -// -//go:nosplit -func (self TCPSocket) SetListenBacklogSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_TCPSocketSetListenBacklogSize((uint32)(self0), (uint64)(value0), &result) - return -} - -// SetReceiveBufferSize represents the imported method "set-receive-buffer-size". -// -// set-receive-buffer-size: func(value: u64) -> result<_, error-code> -// -//go:nosplit -func (self TCPSocket) SetReceiveBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_TCPSocketSetReceiveBufferSize((uint32)(self0), (uint64)(value0), &result) - return -} - -// SetSendBufferSize represents the imported method "set-send-buffer-size". -// -// set-send-buffer-size: func(value: u64) -> result<_, error-code> -// -//go:nosplit -func (self TCPSocket) SetSendBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_TCPSocketSetSendBufferSize((uint32)(self0), (uint64)(value0), &result) - return -} - -// Shutdown represents the imported method "shutdown". -// -// shutdown: func(shutdown-type: shutdown-type) -> result<_, error-code> -// -//go:nosplit -func (self TCPSocket) Shutdown(shutdownType ShutdownType) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - shutdownType0 := (uint32)(shutdownType) - wasmimport_TCPSocketShutdown((uint32)(self0), (uint32)(shutdownType0), &result) - return -} - -// StartBind represents the imported method "start-bind". -// -// start-bind: func(network: borrow, local-address: ip-socket-address) -> -// result<_, error-code> -// -//go:nosplit -func (self TCPSocket) StartBind(network_ Network, localAddress IPSocketAddress) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - network0 := cm.Reinterpret[uint32](network_) - localAddress0, localAddress1, localAddress2, localAddress3, localAddress4, localAddress5, localAddress6, localAddress7, localAddress8, localAddress9, localAddress10, localAddress11 := lower_IPSocketAddress(localAddress) - wasmimport_TCPSocketStartBind((uint32)(self0), (uint32)(network0), (uint32)(localAddress0), (uint32)(localAddress1), (uint32)(localAddress2), (uint32)(localAddress3), (uint32)(localAddress4), (uint32)(localAddress5), (uint32)(localAddress6), (uint32)(localAddress7), (uint32)(localAddress8), (uint32)(localAddress9), (uint32)(localAddress10), (uint32)(localAddress11), &result) - return -} - -// StartConnect represents the imported method "start-connect". -// -// start-connect: func(network: borrow, remote-address: ip-socket-address) -// -> result<_, error-code> -// -//go:nosplit -func (self TCPSocket) StartConnect(network_ Network, remoteAddress IPSocketAddress) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - network0 := cm.Reinterpret[uint32](network_) - remoteAddress0, remoteAddress1, remoteAddress2, remoteAddress3, remoteAddress4, remoteAddress5, remoteAddress6, remoteAddress7, remoteAddress8, remoteAddress9, remoteAddress10, remoteAddress11 := lower_IPSocketAddress(remoteAddress) - wasmimport_TCPSocketStartConnect((uint32)(self0), (uint32)(network0), (uint32)(remoteAddress0), (uint32)(remoteAddress1), (uint32)(remoteAddress2), (uint32)(remoteAddress3), (uint32)(remoteAddress4), (uint32)(remoteAddress5), (uint32)(remoteAddress6), (uint32)(remoteAddress7), (uint32)(remoteAddress8), (uint32)(remoteAddress9), (uint32)(remoteAddress10), (uint32)(remoteAddress11), &result) - return -} - -// StartListen represents the imported method "start-listen". -// -// start-listen: func() -> result<_, error-code> -// -//go:nosplit -func (self TCPSocket) StartListen() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_TCPSocketStartListen((uint32)(self0), &result) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -> pollable -// -//go:nosplit -func (self TCPSocket) Subscribe() (result Pollable) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_TCPSocketSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/sockets/udp-create-socket/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/sockets/udp-create-socket/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/sockets/udp-create-socket/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go deleted file mode 100644 index c60a8253..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/sockets/udp-create-socket/udp-create-socket.wit.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package udpcreatesocket represents the imported interface "wasi:sockets/udp-create-socket@0.2.0". -package udpcreatesocket - -import ( - "go.bytecodealliance.org/cm" - "sqldb-postgres-query/gen/wasi/sockets/network" - "sqldb-postgres-query/gen/wasi/sockets/udp" -) - -// Network represents the imported type alias "wasi:sockets/udp-create-socket@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// ErrorCode represents the type alias "wasi:sockets/udp-create-socket@0.2.0#error-code". -// -// See [network.ErrorCode] for more information. -type ErrorCode = network.ErrorCode - -// IPAddressFamily represents the type alias "wasi:sockets/udp-create-socket@0.2.0#ip-address-family". -// -// See [network.IPAddressFamily] for more information. -type IPAddressFamily = network.IPAddressFamily - -// UDPSocket represents the imported type alias "wasi:sockets/udp-create-socket@0.2.0#udp-socket". -// -// See [udp.UDPSocket] for more information. -type UDPSocket = udp.UDPSocket - -// CreateUDPSocket represents the imported function "create-udp-socket". -// -// create-udp-socket: func(address-family: ip-address-family) -> result -// -//go:nosplit -func CreateUDPSocket(addressFamily IPAddressFamily) (result cm.Result[UDPSocket, UDPSocket, ErrorCode]) { - addressFamily0 := (uint32)(addressFamily) - wasmimport_CreateUDPSocket((uint32)(addressFamily0), &result) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go deleted file mode 100755 index 94b1ab67..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/sockets/udp-create-socket/udpcreatesocket.wasm.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package udpcreatesocket - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/udp-create-socket@0.2.0 create-udp-socket -//go:noescape -func wasmimport_CreateUDPSocket(addressFamily0 uint32, result *cm.Result[UDPSocket, UDPSocket, ErrorCode]) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/sockets/udp/abi.go b/examples/component/sqldb-postgres-query/gen/wasi/sockets/udp/abi.go deleted file mode 100644 index 7307da97..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/sockets/udp/abi.go +++ /dev/null @@ -1,103 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package udp - -import ( - "go.bytecodealliance.org/cm" - "sqldb-postgres-query/gen/wasi/sockets/network" - "unsafe" -) - -// IPSocketAddressShape is used for storage in variant or result types. -type IPSocketAddressShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(network.IPSocketAddress{})]byte -} - -func lower_IPv4Address(v network.IPv4Address) (f0 uint32, f1 uint32, f2 uint32, f3 uint32) { - f0 = (uint32)(v[0]) - f1 = (uint32)(v[1]) - f2 = (uint32)(v[2]) - f3 = (uint32)(v[3]) - return -} - -func lower_IPv4SocketAddress(v network.IPv4SocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32) { - f0 = (uint32)(v.Port) - f1, f2, f3, f4 = lower_IPv4Address(v.Address) - return -} - -func lower_IPv6Address(v network.IPv6Address) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32) { - f0 = (uint32)(v[0]) - f1 = (uint32)(v[1]) - f2 = (uint32)(v[2]) - f3 = (uint32)(v[3]) - f4 = (uint32)(v[4]) - f5 = (uint32)(v[5]) - f6 = (uint32)(v[6]) - f7 = (uint32)(v[7]) - return -} - -func lower_IPv6SocketAddress(v network.IPv6SocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32) { - f0 = (uint32)(v.Port) - f1 = (uint32)(v.FlowInfo) - f2, f3, f4, f5, f6, f7, f8, f9 = lower_IPv6Address(v.Address) - f10 = (uint32)(v.ScopeID) - return -} - -func lower_IPSocketAddress(v network.IPSocketAddress) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32, f11 uint32) { - f0 = (uint32)(v.Tag()) - switch f0 { - case 0: // ipv4 - v1, v2, v3, v4, v5 := lower_IPv4SocketAddress(*cm.Case[network.IPv4SocketAddress](&v, 0)) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - case 1: // ipv6 - v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11 := lower_IPv6SocketAddress(*cm.Case[network.IPv6SocketAddress](&v, 1)) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - f6 = (uint32)(v6) - f7 = (uint32)(v7) - f8 = (uint32)(v8) - f9 = (uint32)(v9) - f10 = (uint32)(v10) - f11 = (uint32)(v11) - } - return -} - -// TupleIncomingDatagramStreamOutgoingDatagramStreamShape is used for storage in variant or result types. -type TupleIncomingDatagramStreamOutgoingDatagramStreamShape struct { - _ cm.HostLayout - shape [unsafe.Sizeof(cm.Tuple[IncomingDatagramStream, OutgoingDatagramStream]{})]byte -} - -func lower_OptionIPSocketAddress(v cm.Option[IPSocketAddress]) (f0 uint32, f1 uint32, f2 uint32, f3 uint32, f4 uint32, f5 uint32, f6 uint32, f7 uint32, f8 uint32, f9 uint32, f10 uint32, f11 uint32, f12 uint32) { - some := v.Some() - if some != nil { - f0 = 1 - v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12 := lower_IPSocketAddress(*some) - f1 = (uint32)(v1) - f2 = (uint32)(v2) - f3 = (uint32)(v3) - f4 = (uint32)(v4) - f5 = (uint32)(v5) - f6 = (uint32)(v6) - f7 = (uint32)(v7) - f8 = (uint32)(v8) - f9 = (uint32)(v9) - f10 = (uint32)(v10) - f11 = (uint32)(v11) - f12 = (uint32)(v12) - } - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasi/sockets/udp/empty.s b/examples/component/sqldb-postgres-query/gen/wasi/sockets/udp/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/sockets/udp/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasi/sockets/udp/udp.wasm.go b/examples/component/sqldb-postgres-query/gen/wasi/sockets/udp/udp.wasm.go deleted file mode 100755 index 83ce8ca7..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/sockets/udp/udp.wasm.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package udp - -import ( - "go.bytecodealliance.org/cm" -) - -// This file contains wasmimport and wasmexport declarations for "wasi:sockets@0.2.0". - -//go:wasmimport wasi:sockets/udp@0.2.0 [resource-drop]udp-socket -//go:noescape -func wasmimport_UDPSocketResourceDrop(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.address-family -//go:noescape -func wasmimport_UDPSocketAddressFamily(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.finish-bind -//go:noescape -func wasmimport_UDPSocketFinishBind(self0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.local-address -//go:noescape -func wasmimport_UDPSocketLocalAddress(self0 uint32, result *cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.receive-buffer-size -//go:noescape -func wasmimport_UDPSocketReceiveBufferSize(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.remote-address -//go:noescape -func wasmimport_UDPSocketRemoteAddress(self0 uint32, result *cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.send-buffer-size -//go:noescape -func wasmimport_UDPSocketSendBufferSize(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.set-receive-buffer-size -//go:noescape -func wasmimport_UDPSocketSetReceiveBufferSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.set-send-buffer-size -//go:noescape -func wasmimport_UDPSocketSetSendBufferSize(self0 uint32, value0 uint64, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.set-unicast-hop-limit -//go:noescape -func wasmimport_UDPSocketSetUnicastHopLimit(self0 uint32, value0 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.start-bind -//go:noescape -func wasmimport_UDPSocketStartBind(self0 uint32, network0 uint32, localAddress0 uint32, localAddress1 uint32, localAddress2 uint32, localAddress3 uint32, localAddress4 uint32, localAddress5 uint32, localAddress6 uint32, localAddress7 uint32, localAddress8 uint32, localAddress9 uint32, localAddress10 uint32, localAddress11 uint32, result *cm.Result[ErrorCode, struct{}, ErrorCode]) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.stream -//go:noescape -func wasmimport_UDPSocketStream(self0 uint32, remoteAddress0 uint32, remoteAddress1 uint32, remoteAddress2 uint32, remoteAddress3 uint32, remoteAddress4 uint32, remoteAddress5 uint32, remoteAddress6 uint32, remoteAddress7 uint32, remoteAddress8 uint32, remoteAddress9 uint32, remoteAddress10 uint32, remoteAddress11 uint32, remoteAddress12 uint32, result *cm.Result[TupleIncomingDatagramStreamOutgoingDatagramStreamShape, cm.Tuple[IncomingDatagramStream, OutgoingDatagramStream], ErrorCode]) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.subscribe -//go:noescape -func wasmimport_UDPSocketSubscribe(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]udp-socket.unicast-hop-limit -//go:noescape -func wasmimport_UDPSocketUnicastHopLimit(self0 uint32, result *cm.Result[uint8, uint8, ErrorCode]) - -//go:wasmimport wasi:sockets/udp@0.2.0 [resource-drop]incoming-datagram-stream -//go:noescape -func wasmimport_IncomingDatagramStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]incoming-datagram-stream.receive -//go:noescape -func wasmimport_IncomingDatagramStreamReceive(self0 uint32, maxResults0 uint64, result *cm.Result[cm.List[IncomingDatagram], cm.List[IncomingDatagram], ErrorCode]) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]incoming-datagram-stream.subscribe -//go:noescape -func wasmimport_IncomingDatagramStreamSubscribe(self0 uint32) (result0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [resource-drop]outgoing-datagram-stream -//go:noescape -func wasmimport_OutgoingDatagramStreamResourceDrop(self0 uint32) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]outgoing-datagram-stream.check-send -//go:noescape -func wasmimport_OutgoingDatagramStreamCheckSend(self0 uint32, result *cm.Result[uint64, uint64, ErrorCode]) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]outgoing-datagram-stream.send -//go:noescape -func wasmimport_OutgoingDatagramStreamSend(self0 uint32, datagrams0 *OutgoingDatagram, datagrams1 uint32, result *cm.Result[uint64, uint64, ErrorCode]) - -//go:wasmimport wasi:sockets/udp@0.2.0 [method]outgoing-datagram-stream.subscribe -//go:noescape -func wasmimport_OutgoingDatagramStreamSubscribe(self0 uint32) (result0 uint32) diff --git a/examples/component/sqldb-postgres-query/gen/wasi/sockets/udp/udp.wit.go b/examples/component/sqldb-postgres-query/gen/wasi/sockets/udp/udp.wit.go deleted file mode 100644 index 150f0eca..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasi/sockets/udp/udp.wit.go +++ /dev/null @@ -1,319 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package udp represents the imported interface "wasi:sockets/udp@0.2.0". -package udp - -import ( - "go.bytecodealliance.org/cm" - "sqldb-postgres-query/gen/wasi/io/poll" - "sqldb-postgres-query/gen/wasi/sockets/network" -) - -// Pollable represents the imported type alias "wasi:sockets/udp@0.2.0#pollable". -// -// See [poll.Pollable] for more information. -type Pollable = poll.Pollable - -// Network represents the imported type alias "wasi:sockets/udp@0.2.0#network". -// -// See [network.Network] for more information. -type Network = network.Network - -// ErrorCode represents the type alias "wasi:sockets/udp@0.2.0#error-code". -// -// See [network.ErrorCode] for more information. -type ErrorCode = network.ErrorCode - -// IPSocketAddress represents the type alias "wasi:sockets/udp@0.2.0#ip-socket-address". -// -// See [network.IPSocketAddress] for more information. -type IPSocketAddress = network.IPSocketAddress - -// IPAddressFamily represents the type alias "wasi:sockets/udp@0.2.0#ip-address-family". -// -// See [network.IPAddressFamily] for more information. -type IPAddressFamily = network.IPAddressFamily - -// IncomingDatagram represents the record "wasi:sockets/udp@0.2.0#incoming-datagram". -// -// record incoming-datagram { -// data: list, -// remote-address: ip-socket-address, -// } -type IncomingDatagram struct { - _ cm.HostLayout - Data cm.List[uint8] - RemoteAddress IPSocketAddress -} - -// OutgoingDatagram represents the record "wasi:sockets/udp@0.2.0#outgoing-datagram". -// -// record outgoing-datagram { -// data: list, -// remote-address: option, -// } -type OutgoingDatagram struct { - _ cm.HostLayout - Data cm.List[uint8] - RemoteAddress cm.Option[IPSocketAddress] -} - -// UDPSocket represents the imported resource "wasi:sockets/udp@0.2.0#udp-socket". -// -// resource udp-socket -type UDPSocket cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "udp-socket". -// -// Drops a resource handle. -// -//go:nosplit -func (self UDPSocket) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketResourceDrop((uint32)(self0)) - return -} - -// AddressFamily represents the imported method "address-family". -// -// address-family: func() -> ip-address-family -// -//go:nosplit -func (self UDPSocket) AddressFamily() (result IPAddressFamily) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_UDPSocketAddressFamily((uint32)(self0)) - result = (network.IPAddressFamily)((uint32)(result0)) - return -} - -// FinishBind represents the imported method "finish-bind". -// -// finish-bind: func() -> result<_, error-code> -// -//go:nosplit -func (self UDPSocket) FinishBind() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketFinishBind((uint32)(self0), &result) - return -} - -// LocalAddress represents the imported method "local-address". -// -// local-address: func() -> result -// -//go:nosplit -func (self UDPSocket) LocalAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketLocalAddress((uint32)(self0), &result) - return -} - -// ReceiveBufferSize represents the imported method "receive-buffer-size". -// -// receive-buffer-size: func() -> result -// -//go:nosplit -func (self UDPSocket) ReceiveBufferSize() (result cm.Result[uint64, uint64, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketReceiveBufferSize((uint32)(self0), &result) - return -} - -// RemoteAddress represents the imported method "remote-address". -// -// remote-address: func() -> result -// -//go:nosplit -func (self UDPSocket) RemoteAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketRemoteAddress((uint32)(self0), &result) - return -} - -// SendBufferSize represents the imported method "send-buffer-size". -// -// send-buffer-size: func() -> result -// -//go:nosplit -func (self UDPSocket) SendBufferSize() (result cm.Result[uint64, uint64, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketSendBufferSize((uint32)(self0), &result) - return -} - -// SetReceiveBufferSize represents the imported method "set-receive-buffer-size". -// -// set-receive-buffer-size: func(value: u64) -> result<_, error-code> -// -//go:nosplit -func (self UDPSocket) SetReceiveBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_UDPSocketSetReceiveBufferSize((uint32)(self0), (uint64)(value0), &result) - return -} - -// SetSendBufferSize represents the imported method "set-send-buffer-size". -// -// set-send-buffer-size: func(value: u64) -> result<_, error-code> -// -//go:nosplit -func (self UDPSocket) SetSendBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint64)(value) - wasmimport_UDPSocketSetSendBufferSize((uint32)(self0), (uint64)(value0), &result) - return -} - -// SetUnicastHopLimit represents the imported method "set-unicast-hop-limit". -// -// set-unicast-hop-limit: func(value: u8) -> result<_, error-code> -// -//go:nosplit -func (self UDPSocket) SetUnicastHopLimit(value uint8) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - value0 := (uint32)(value) - wasmimport_UDPSocketSetUnicastHopLimit((uint32)(self0), (uint32)(value0), &result) - return -} - -// StartBind represents the imported method "start-bind". -// -// start-bind: func(network: borrow, local-address: ip-socket-address) -> -// result<_, error-code> -// -//go:nosplit -func (self UDPSocket) StartBind(network_ Network, localAddress IPSocketAddress) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - network0 := cm.Reinterpret[uint32](network_) - localAddress0, localAddress1, localAddress2, localAddress3, localAddress4, localAddress5, localAddress6, localAddress7, localAddress8, localAddress9, localAddress10, localAddress11 := lower_IPSocketAddress(localAddress) - wasmimport_UDPSocketStartBind((uint32)(self0), (uint32)(network0), (uint32)(localAddress0), (uint32)(localAddress1), (uint32)(localAddress2), (uint32)(localAddress3), (uint32)(localAddress4), (uint32)(localAddress5), (uint32)(localAddress6), (uint32)(localAddress7), (uint32)(localAddress8), (uint32)(localAddress9), (uint32)(localAddress10), (uint32)(localAddress11), &result) - return -} - -// Stream represents the imported method "stream". -// -// %stream: func(remote-address: option) -> result, error-code> -// -//go:nosplit -func (self UDPSocket) Stream(remoteAddress cm.Option[IPSocketAddress]) (result cm.Result[TupleIncomingDatagramStreamOutgoingDatagramStreamShape, cm.Tuple[IncomingDatagramStream, OutgoingDatagramStream], ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - remoteAddress0, remoteAddress1, remoteAddress2, remoteAddress3, remoteAddress4, remoteAddress5, remoteAddress6, remoteAddress7, remoteAddress8, remoteAddress9, remoteAddress10, remoteAddress11, remoteAddress12 := lower_OptionIPSocketAddress(remoteAddress) - wasmimport_UDPSocketStream((uint32)(self0), (uint32)(remoteAddress0), (uint32)(remoteAddress1), (uint32)(remoteAddress2), (uint32)(remoteAddress3), (uint32)(remoteAddress4), (uint32)(remoteAddress5), (uint32)(remoteAddress6), (uint32)(remoteAddress7), (uint32)(remoteAddress8), (uint32)(remoteAddress9), (uint32)(remoteAddress10), (uint32)(remoteAddress11), (uint32)(remoteAddress12), &result) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -> pollable -// -//go:nosplit -func (self UDPSocket) Subscribe() (result Pollable) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_UDPSocketSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) - return -} - -// UnicastHopLimit represents the imported method "unicast-hop-limit". -// -// unicast-hop-limit: func() -> result -// -//go:nosplit -func (self UDPSocket) UnicastHopLimit() (result cm.Result[uint8, uint8, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_UDPSocketUnicastHopLimit((uint32)(self0), &result) - return -} - -// IncomingDatagramStream represents the imported resource "wasi:sockets/udp@0.2.0#incoming-datagram-stream". -// -// resource incoming-datagram-stream -type IncomingDatagramStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "incoming-datagram-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self IncomingDatagramStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_IncomingDatagramStreamResourceDrop((uint32)(self0)) - return -} - -// Receive represents the imported method "receive". -// -// receive: func(max-results: u64) -> result, error-code> -// -//go:nosplit -func (self IncomingDatagramStream) Receive(maxResults uint64) (result cm.Result[cm.List[IncomingDatagram], cm.List[IncomingDatagram], ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - maxResults0 := (uint64)(maxResults) - wasmimport_IncomingDatagramStreamReceive((uint32)(self0), (uint64)(maxResults0), &result) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -> pollable -// -//go:nosplit -func (self IncomingDatagramStream) Subscribe() (result Pollable) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_IncomingDatagramStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) - return -} - -// OutgoingDatagramStream represents the imported resource "wasi:sockets/udp@0.2.0#outgoing-datagram-stream". -// -// resource outgoing-datagram-stream -type OutgoingDatagramStream cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "outgoing-datagram-stream". -// -// Drops a resource handle. -// -//go:nosplit -func (self OutgoingDatagramStream) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingDatagramStreamResourceDrop((uint32)(self0)) - return -} - -// CheckSend represents the imported method "check-send". -// -// check-send: func() -> result -// -//go:nosplit -func (self OutgoingDatagramStream) CheckSend() (result cm.Result[uint64, uint64, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - wasmimport_OutgoingDatagramStreamCheckSend((uint32)(self0), &result) - return -} - -// Send represents the imported method "send". -// -// send: func(datagrams: list) -> result -// -//go:nosplit -func (self OutgoingDatagramStream) Send(datagrams cm.List[OutgoingDatagram]) (result cm.Result[uint64, uint64, ErrorCode]) { - self0 := cm.Reinterpret[uint32](self) - datagrams0, datagrams1 := cm.LowerList(datagrams) - wasmimport_OutgoingDatagramStreamSend((uint32)(self0), (*OutgoingDatagram)(datagrams0), (uint32)(datagrams1), &result) - return -} - -// Subscribe represents the imported method "subscribe". -// -// subscribe: func() -> pollable -// -//go:nosplit -func (self OutgoingDatagramStream) Subscribe() (result Pollable) { - self0 := cm.Reinterpret[uint32](self) - result0 := wasmimport_OutgoingDatagramStreamSubscribe((uint32)(self0)) - result = cm.Reinterpret[Pollable]((uint32)(result0)) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasmcloud/bus/lattice/empty.s b/examples/component/sqldb-postgres-query/gen/wasmcloud/bus/lattice/empty.s deleted file mode 100644 index 5444f200..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasmcloud/bus/lattice/empty.s +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists for testing this package without WebAssembly, -// allowing empty function bodies with a //go:wasmimport directive. -// See https://pkg.go.dev/cmd/compile for more information. diff --git a/examples/component/sqldb-postgres-query/gen/wasmcloud/bus/lattice/lattice.wasm.go b/examples/component/sqldb-postgres-query/gen/wasmcloud/bus/lattice/lattice.wasm.go deleted file mode 100755 index 7c7b9094..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasmcloud/bus/lattice/lattice.wasm.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -package lattice - -// This file contains wasmimport and wasmexport declarations for "wasmcloud:bus@1.0.0". - -//go:wasmimport wasmcloud:bus/lattice@1.0.0 [resource-drop]call-target-interface -//go:noescape -func wasmimport_CallTargetInterfaceResourceDrop(self0 uint32) - -//go:wasmimport wasmcloud:bus/lattice@1.0.0 [constructor]call-target-interface -//go:noescape -func wasmimport_NewCallTargetInterface(namespace0 *uint8, namespace1 uint32, package0 *uint8, package1 uint32, interface0 *uint8, interface1 uint32) (result0 uint32) - -//go:wasmimport wasmcloud:bus/lattice@1.0.0 set-link-name -//go:noescape -func wasmimport_SetLinkName(name0 *uint8, name1 uint32, interfaces0 *CallTargetInterface, interfaces1 uint32) diff --git a/examples/component/sqldb-postgres-query/gen/wasmcloud/bus/lattice/lattice.wit.go b/examples/component/sqldb-postgres-query/gen/wasmcloud/bus/lattice/lattice.wit.go deleted file mode 100644 index ba34d30c..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasmcloud/bus/lattice/lattice.wit.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by wit-bindgen-go. DO NOT EDIT. - -// Package lattice represents the imported interface "wasmcloud:bus/lattice@1.0.0". -package lattice - -import ( - "go.bytecodealliance.org/cm" -) - -// CallTargetInterface represents the imported resource "wasmcloud:bus/lattice@1.0.0#call-target-interface". -// -// resource call-target-interface -type CallTargetInterface cm.Resource - -// ResourceDrop represents the imported resource-drop for resource "call-target-interface". -// -// Drops a resource handle. -// -//go:nosplit -func (self CallTargetInterface) ResourceDrop() { - self0 := cm.Reinterpret[uint32](self) - wasmimport_CallTargetInterfaceResourceDrop((uint32)(self0)) - return -} - -// NewCallTargetInterface represents the imported constructor for resource "call-target-interface". -// -// constructor(namespace: string, %package: string, %interface: string) -// -//go:nosplit -func NewCallTargetInterface(namespace string, package_ string, interface_ string) (result CallTargetInterface) { - namespace0, namespace1 := cm.LowerString(namespace) - package0, package1 := cm.LowerString(package_) - interface0, interface1 := cm.LowerString(interface_) - result0 := wasmimport_NewCallTargetInterface((*uint8)(namespace0), (uint32)(namespace1), (*uint8)(package0), (uint32)(package1), (*uint8)(interface0), (uint32)(interface1)) - result = cm.Reinterpret[CallTargetInterface]((uint32)(result0)) - return -} - -// SetLinkName represents the imported function "set-link-name". -// -// set-link-name: func(name: string, interfaces: list) -// -//go:nosplit -func SetLinkName(name string, interfaces cm.List[CallTargetInterface]) { - name0, name1 := cm.LowerString(name) - interfaces0, interfaces1 := cm.LowerList(interfaces) - wasmimport_SetLinkName((*uint8)(name0), (uint32)(name1), (*CallTargetInterface)(interfaces0), (uint32)(interfaces1)) - return -} diff --git a/examples/component/sqldb-postgres-query/gen/wasmcloud/examples/component/component.wit b/examples/component/sqldb-postgres-query/gen/wasmcloud/examples/component/component.wit deleted file mode 100755 index fe465440..00000000 --- a/examples/component/sqldb-postgres-query/gen/wasmcloud/examples/component/component.wit +++ /dev/null @@ -1,1001 +0,0 @@ -package wasmcloud:component-go@0.1.0; - -package wasmcloud:examples { - /// Invoke a component and receive string output. Similar to wasi:cli/command.run, - /// without args - /// - /// This enables the component to be used with `wash call` - interface invoke { - /// Invoke a component - call: func() -> string; - } - - world component { - import wasmcloud:postgres/types@0.1.1-draft; - import wasmcloud:postgres/query@0.1.1-draft; - import wasi:logging/logging@0.1.0-draft; - import wasi:config/runtime@0.2.0-draft; - import wasi:io/poll@0.2.0; - import wasi:clocks/monotonic-clock@0.2.0; - import wasi:io/error@0.2.0; - import wasi:io/streams@0.2.0; - import wasi:http/types@0.2.0; - import wasi:http/outgoing-handler@0.2.0; - import wasmcloud:bus/lattice@1.0.0; - import wasmcloud:secrets/store@0.1.0-draft; - import wasmcloud:secrets/reveal@0.1.0-draft; - import wasi:cli/environment@0.2.0; - import wasi:cli/exit@0.2.0; - import wasi:cli/stdin@0.2.0; - import wasi:cli/stdout@0.2.0; - import wasi:cli/stderr@0.2.0; - import wasi:cli/terminal-input@0.2.0; - import wasi:cli/terminal-output@0.2.0; - import wasi:cli/terminal-stdin@0.2.0; - import wasi:cli/terminal-stdout@0.2.0; - import wasi:cli/terminal-stderr@0.2.0; - import wasi:clocks/wall-clock@0.2.0; - import wasi:filesystem/types@0.2.0; - import wasi:filesystem/preopens@0.2.0; - import wasi:sockets/network@0.2.0; - import wasi:sockets/instance-network@0.2.0; - import wasi:sockets/udp@0.2.0; - import wasi:sockets/udp-create-socket@0.2.0; - import wasi:sockets/tcp@0.2.0; - import wasi:sockets/tcp-create-socket@0.2.0; - import wasi:sockets/ip-name-lookup@0.2.0; - import wasi:random/random@0.2.0; - import wasi:random/insecure@0.2.0; - import wasi:random/insecure-seed@0.2.0; - export invoke; - } -} - -package wasi:cli@0.2.0 { - interface environment { - get-environment: func() -> list>; - get-arguments: func() -> list; - initial-cwd: func() -> option; - } - - interface exit { - exit: func(status: result); - } - - interface stdin { - use wasi:io/streams@0.2.0.{input-stream}; - get-stdin: func() -> input-stream; - } - - interface stdout { - use wasi:io/streams@0.2.0.{output-stream}; - get-stdout: func() -> output-stream; - } - - interface stderr { - use wasi:io/streams@0.2.0.{output-stream}; - get-stderr: func() -> output-stream; - } - - interface terminal-input { - resource terminal-input; - } - - interface terminal-output { - resource terminal-output; - } - - interface terminal-stdin { - use terminal-input.{terminal-input}; - get-terminal-stdin: func() -> option; - } - - interface terminal-stdout { - use terminal-output.{terminal-output}; - get-terminal-stdout: func() -> option; - } - - interface terminal-stderr { - use terminal-output.{terminal-output}; - get-terminal-stderr: func() -> option; - } -} - -package wasi:clocks@0.2.0 { - interface monotonic-clock { - use wasi:io/poll@0.2.0.{pollable}; - type instant = u64; - type duration = u64; - now: func() -> instant; - resolution: func() -> duration; - subscribe-instant: func(when: instant) -> pollable; - subscribe-duration: func(when: duration) -> pollable; - } - - interface wall-clock { - record datetime { - seconds: u64, - nanoseconds: u32, - } - now: func() -> datetime; - resolution: func() -> datetime; - } -} - -package wasi:config@0.2.0-draft { - interface runtime { - variant config-error { - upstream(string), - io(string), - } - get: func(key: string) -> result, config-error>; - get-all: func() -> result>, config-error>; - } -} - -package wasi:filesystem@0.2.0 { - interface types { - use wasi:io/streams@0.2.0.{input-stream}; - use wasi:io/streams@0.2.0.{output-stream}; - use wasi:io/streams@0.2.0.{error}; - use wasi:clocks/wall-clock@0.2.0.{datetime}; - type filesize = u64; - enum descriptor-type { - unknown, - block-device, - character-device, - directory, - fifo, - symbolic-link, - regular-file, - socket - } - flags descriptor-flags { - read, - write, - file-integrity-sync, - data-integrity-sync, - requested-write-sync, - mutate-directory, - } - flags path-flags { symlink-follow } - flags open-flags { - create, - directory, - exclusive, - truncate, - } - type link-count = u64; - record descriptor-stat { - %type: descriptor-type, - link-count: link-count, - size: filesize, - data-access-timestamp: option, - data-modification-timestamp: option, - status-change-timestamp: option, - } - variant new-timestamp { - no-change, - now, - timestamp(datetime), - } - record directory-entry { - %type: descriptor-type, - name: string, - } - enum error-code { - access, - would-block, - already, - bad-descriptor, - busy, - deadlock, - quota, - exist, - file-too-large, - illegal-byte-sequence, - in-progress, - interrupted, - invalid, - io, - is-directory, - loop, - too-many-links, - message-size, - name-too-long, - no-device, - no-entry, - no-lock, - insufficient-memory, - insufficient-space, - not-directory, - not-empty, - not-recoverable, - unsupported, - no-tty, - no-such-device, - overflow, - not-permitted, - pipe, - read-only, - invalid-seek, - text-file-busy, - cross-device - } - enum advice { - normal, - sequential, - random, - will-need, - dont-need, - no-reuse - } - record metadata-hash-value { - lower: u64, - upper: u64, - } - resource descriptor { - advise: func(offset: filesize, length: filesize, advice: advice) -> result<_, error-code>; - append-via-stream: func() -> result; - create-directory-at: func(path: string) -> result<_, error-code>; - get-flags: func() -> result; - get-type: func() -> result; - is-same-object: func(other: borrow) -> bool; - link-at: func(old-path-flags: path-flags, old-path: string, new-descriptor: borrow, new-path: string) -> result<_, error-code>; - metadata-hash: func() -> result; - metadata-hash-at: func(path-flags: path-flags, path: string) -> result; - open-at: func(path-flags: path-flags, path: string, open-flags: open-flags, %flags: descriptor-flags) -> result; - read: func(length: filesize, offset: filesize) -> result, bool>, error-code>; - read-directory: func() -> result; - read-via-stream: func(offset: filesize) -> result; - readlink-at: func(path: string) -> result; - remove-directory-at: func(path: string) -> result<_, error-code>; - rename-at: func(old-path: string, new-descriptor: borrow, new-path: string) -> result<_, error-code>; - set-size: func(size: filesize) -> result<_, error-code>; - set-times: func(data-access-timestamp: new-timestamp, data-modification-timestamp: new-timestamp) -> result<_, error-code>; - set-times-at: func(path-flags: path-flags, path: string, data-access-timestamp: new-timestamp, data-modification-timestamp: new-timestamp) -> result<_, error-code>; - stat: func() -> result; - stat-at: func(path-flags: path-flags, path: string) -> result; - symlink-at: func(old-path: string, new-path: string) -> result<_, error-code>; - sync: func() -> result<_, error-code>; - sync-data: func() -> result<_, error-code>; - unlink-file-at: func(path: string) -> result<_, error-code>; - write: func(buffer: list, offset: filesize) -> result; - write-via-stream: func(offset: filesize) -> result; - } - resource directory-entry-stream { - read-directory-entry: func() -> result, error-code>; - } - filesystem-error-code: func(err: borrow) -> option; - } - - interface preopens { - use types.{descriptor}; - get-directories: func() -> list>; - } -} - -package wasi:http@0.2.0 { - interface types { - use wasi:clocks/monotonic-clock@0.2.0.{duration}; - use wasi:io/streams@0.2.0.{input-stream}; - use wasi:io/streams@0.2.0.{output-stream}; - use wasi:io/error@0.2.0.{error as io-error}; - use wasi:io/poll@0.2.0.{pollable}; - variant method { - get, - head, - post, - put, - delete, - connect, - options, - trace, - patch, - other(string), - } - variant scheme { HTTP, HTTPS, other(string) } - record DNS-error-payload { - rcode: option, - info-code: option, - } - record TLS-alert-received-payload { - alert-id: option, - alert-message: option, - } - record field-size-payload { - field-name: option, - field-size: option, - } - variant error-code { - DNS-timeout, - DNS-error(DNS-error-payload), - destination-not-found, - destination-unavailable, - destination-IP-prohibited, - destination-IP-unroutable, - connection-refused, - connection-terminated, - connection-timeout, - connection-read-timeout, - connection-write-timeout, - connection-limit-reached, - TLS-protocol-error, - TLS-certificate-error, - TLS-alert-received(TLS-alert-received-payload), - HTTP-request-denied, - HTTP-request-length-required, - HTTP-request-body-size(option), - HTTP-request-method-invalid, - HTTP-request-URI-invalid, - HTTP-request-URI-too-long, - HTTP-request-header-section-size(option), - HTTP-request-header-size(option), - HTTP-request-trailer-section-size(option), - HTTP-request-trailer-size(field-size-payload), - HTTP-response-incomplete, - HTTP-response-header-section-size(option), - HTTP-response-header-size(field-size-payload), - HTTP-response-body-size(option), - HTTP-response-trailer-section-size(option), - HTTP-response-trailer-size(field-size-payload), - HTTP-response-transfer-coding(option), - HTTP-response-content-coding(option), - HTTP-response-timeout, - HTTP-upgrade-failed, - HTTP-protocol-error, - loop-detected, - configuration-error, - internal-error(option), - } - variant header-error { - invalid-syntax, - forbidden, - immutable, - } - type field-key = string; - type field-value = list; - resource fields { - constructor(); - append: func(name: field-key, value: field-value) -> result<_, header-error>; - clone: func() -> fields; - delete: func(name: field-key) -> result<_, header-error>; - entries: func() -> list>; - get: func(name: field-key) -> list; - has: func(name: field-key) -> bool; - set: func(name: field-key, value: list) -> result<_, header-error>; - from-list: static func(entries: list>) -> result; - } - type headers = fields; - type trailers = fields; - resource incoming-request { - authority: func() -> option; - consume: func() -> result; - headers: func() -> headers; - method: func() -> method; - path-with-query: func() -> option; - scheme: func() -> option; - } - resource outgoing-request { - constructor(headers: headers); - authority: func() -> option; - body: func() -> result; - headers: func() -> headers; - method: func() -> method; - path-with-query: func() -> option; - scheme: func() -> option; - set-authority: func(authority: option) -> result; - set-method: func(method: method) -> result; - set-path-with-query: func(path-with-query: option) -> result; - set-scheme: func(scheme: option) -> result; - } - resource request-options { - constructor(); - between-bytes-timeout: func() -> option; - connect-timeout: func() -> option; - first-byte-timeout: func() -> option; - set-between-bytes-timeout: func(duration: option) -> result; - set-connect-timeout: func(duration: option) -> result; - set-first-byte-timeout: func(duration: option) -> result; - } - resource response-outparam { - set: static func(param: response-outparam, response: result); - } - type status-code = u16; - resource incoming-response { - consume: func() -> result; - headers: func() -> headers; - status: func() -> status-code; - } - resource incoming-body { - %stream: func() -> result; - finish: static func(this: incoming-body) -> future-trailers; - } - resource future-trailers { - get: func() -> option, error-code>>>; - subscribe: func() -> pollable; - } - resource outgoing-response { - constructor(headers: headers); - body: func() -> result; - headers: func() -> headers; - set-status-code: func(status-code: status-code) -> result; - status-code: func() -> status-code; - } - resource outgoing-body { - write: func() -> result; - finish: static func(this: outgoing-body, trailers: option) -> result<_, error-code>; - } - resource future-incoming-response { - get: func() -> option>>; - subscribe: func() -> pollable; - } - http-error-code: func(err: borrow) -> option; - } - - interface outgoing-handler { - use types.{outgoing-request}; - use types.{request-options}; - use types.{future-incoming-response}; - use types.{error-code}; - handle: func(request: outgoing-request, options: option) -> result; - } -} - -package wasi:io@0.2.0 { - interface poll { - resource pollable { - block: func(); - ready: func() -> bool; - } - poll: func(in: list>) -> list; - } - - interface error { - resource error { - to-debug-string: func() -> string; - } - } - - interface streams { - use error.{error}; - use poll.{pollable}; - variant stream-error { - last-operation-failed(error), - closed, - } - resource input-stream { - blocking-read: func(len: u64) -> result, stream-error>; - blocking-skip: func(len: u64) -> result; - read: func(len: u64) -> result, stream-error>; - skip: func(len: u64) -> result; - subscribe: func() -> pollable; - } - resource output-stream { - blocking-flush: func() -> result<_, stream-error>; - blocking-splice: func(src: borrow, len: u64) -> result; - blocking-write-and-flush: func(contents: list) -> result<_, stream-error>; - blocking-write-zeroes-and-flush: func(len: u64) -> result<_, stream-error>; - check-write: func() -> result; - flush: func() -> result<_, stream-error>; - splice: func(src: borrow, len: u64) -> result; - subscribe: func() -> pollable; - write: func(contents: list) -> result<_, stream-error>; - write-zeroes: func(len: u64) -> result<_, stream-error>; - } - } -} - -package wasi:logging@0.1.0-draft { - interface logging { - enum level { - trace, - debug, - info, - warn, - error, - critical - } - log: func(level: level, context: string, message: string); - } -} - -package wasi:random@0.2.0 { - interface random { - get-random-bytes: func(len: u64) -> list; - get-random-u64: func() -> u64; - } - - interface insecure { - get-insecure-random-bytes: func(len: u64) -> list; - get-insecure-random-u64: func() -> u64; - } - - interface insecure-seed { - insecure-seed: func() -> tuple; - } -} - -package wasi:sockets@0.2.0 { - interface network { - resource network; - enum error-code { - unknown, - access-denied, - not-supported, - invalid-argument, - out-of-memory, - timeout, - concurrency-conflict, - not-in-progress, - would-block, - invalid-state, - new-socket-limit, - address-not-bindable, - address-in-use, - remote-unreachable, - connection-refused, - connection-reset, - connection-aborted, - datagram-too-large, - name-unresolvable, - temporary-resolver-failure, - permanent-resolver-failure - } - enum ip-address-family { ipv4, ipv6 } - type ipv4-address = tuple; - type ipv6-address = tuple; - variant ip-address { - ipv4(ipv4-address), - ipv6(ipv6-address), - } - record ipv4-socket-address { - port: u16, - address: ipv4-address, - } - record ipv6-socket-address { - port: u16, - flow-info: u32, - address: ipv6-address, - scope-id: u32, - } - variant ip-socket-address { - ipv4(ipv4-socket-address), - ipv6(ipv6-socket-address), - } - } - - interface instance-network { - use network.{network}; - instance-network: func() -> network; - } - - interface udp { - use wasi:io/poll@0.2.0.{pollable}; - use network.{network}; - use network.{error-code}; - use network.{ip-socket-address}; - use network.{ip-address-family}; - record incoming-datagram { - data: list, - remote-address: ip-socket-address, - } - record outgoing-datagram { - data: list, - remote-address: option, - } - resource udp-socket { - address-family: func() -> ip-address-family; - finish-bind: func() -> result<_, error-code>; - local-address: func() -> result; - receive-buffer-size: func() -> result; - remote-address: func() -> result; - send-buffer-size: func() -> result; - set-receive-buffer-size: func(value: u64) -> result<_, error-code>; - set-send-buffer-size: func(value: u64) -> result<_, error-code>; - set-unicast-hop-limit: func(value: u8) -> result<_, error-code>; - start-bind: func(network: borrow, local-address: ip-socket-address) -> result<_, error-code>; - %stream: func(remote-address: option) -> result, error-code>; - subscribe: func() -> pollable; - unicast-hop-limit: func() -> result; - } - resource incoming-datagram-stream { - receive: func(max-results: u64) -> result, error-code>; - subscribe: func() -> pollable; - } - resource outgoing-datagram-stream { - check-send: func() -> result; - send: func(datagrams: list) -> result; - subscribe: func() -> pollable; - } - } - - interface udp-create-socket { - use network.{network}; - use network.{error-code}; - use network.{ip-address-family}; - use udp.{udp-socket}; - create-udp-socket: func(address-family: ip-address-family) -> result; - } - - interface tcp { - use wasi:io/streams@0.2.0.{input-stream}; - use wasi:io/streams@0.2.0.{output-stream}; - use wasi:io/poll@0.2.0.{pollable}; - use wasi:clocks/monotonic-clock@0.2.0.{duration}; - use network.{network}; - use network.{error-code}; - use network.{ip-socket-address}; - use network.{ip-address-family}; - enum shutdown-type { receive, send, both } - resource tcp-socket { - accept: func() -> result, error-code>; - address-family: func() -> ip-address-family; - finish-bind: func() -> result<_, error-code>; - finish-connect: func() -> result, error-code>; - finish-listen: func() -> result<_, error-code>; - hop-limit: func() -> result; - is-listening: func() -> bool; - keep-alive-count: func() -> result; - keep-alive-enabled: func() -> result; - keep-alive-idle-time: func() -> result; - keep-alive-interval: func() -> result; - local-address: func() -> result; - receive-buffer-size: func() -> result; - remote-address: func() -> result; - send-buffer-size: func() -> result; - set-hop-limit: func(value: u8) -> result<_, error-code>; - set-keep-alive-count: func(value: u32) -> result<_, error-code>; - set-keep-alive-enabled: func(value: bool) -> result<_, error-code>; - set-keep-alive-idle-time: func(value: duration) -> result<_, error-code>; - set-keep-alive-interval: func(value: duration) -> result<_, error-code>; - set-listen-backlog-size: func(value: u64) -> result<_, error-code>; - set-receive-buffer-size: func(value: u64) -> result<_, error-code>; - set-send-buffer-size: func(value: u64) -> result<_, error-code>; - shutdown: func(shutdown-type: shutdown-type) -> result<_, error-code>; - start-bind: func(network: borrow, local-address: ip-socket-address) -> result<_, error-code>; - start-connect: func(network: borrow, remote-address: ip-socket-address) -> result<_, error-code>; - start-listen: func() -> result<_, error-code>; - subscribe: func() -> pollable; - } - } - - interface tcp-create-socket { - use network.{network}; - use network.{error-code}; - use network.{ip-address-family}; - use tcp.{tcp-socket}; - create-tcp-socket: func(address-family: ip-address-family) -> result; - } - - interface ip-name-lookup { - use wasi:io/poll@0.2.0.{pollable}; - use network.{network}; - use network.{error-code}; - use network.{ip-address}; - resource resolve-address-stream { - resolve-next-address: func() -> result, error-code>; - subscribe: func() -> pollable; - } - resolve-addresses: func(network: borrow, name: string) -> result; - } -} - -package wasmcloud:bus@1.0.0 { - interface lattice { - resource call-target-interface { - constructor(namespace: string, %package: string, %interface: string); - } - set-link-name: func(name: string, interfaces: list); - } -} - -package wasmcloud:postgres@0.1.1-draft { - /// Types used by components and providers of a SQLDB Postgres interface - interface types { - /// Errors that occur while executing queries - variant query-error { - /// Unknown/invalid query parameters - invalid-params(string), - /// Invalid/malformed query - invalid-query(string), - /// A completely unexpected error, specific to executing queries - unexpected(string), - } - - /// Errors that occur while preparing a statement - variant statement-prepare-error { - /// A completely unexpected error - unexpected(string), - } - - /// Errors that occur during prepared statement execution - variant prepared-statement-exec-error { - /// Unknown/invalid prepared statement token - unknown-prepared-query, - /// An otherwise known query execution error - query-error(query-error), - /// A completely unexpected error, specific to prepared statements - unexpected(string), - } - - /// This type of floating point is necessary as rust does not allow Eq/PartialEq/Hash - /// on real `f64` - /// Instead we use a sign + mantissa + exponent - /// - /// see: https://docs.rs/num/latest/num/trait.Float.html#tymethod.integer_decode - type hashable-f64 = tuple; - type hashable-f32 = hashable-f64; - type point = tuple; - type lower-left-point = point; - type upper-right-point = point; - type start-point = point; - type end-point = point; - type center-point = point; - type radius = hashable-f64; - type ipv4-addr = string; - type ipv6-addr = string; - type subnet = string; - type xmin = s64; - type xmax = s64; - type xip-list = list; - type logfile-num = u32; - type logfile-byte-offset = u32; - type column-name = string; - - /// Arbitrary precision numeric type - type numeric = string; - - /// Chosen weight of a Lexeme - enum lexeme-weight { A, B, C, D } - - /// Represents an arbitrary precision numeric type - record lexeme { - /// Position (1->16383) - position: option, - /// Weight of the lexeme (in a relevant ts-vector) - weight: option, - /// Data - data: string, - } - - /// Offsets are expressed in seconds of timezone difference in either from the - /// eastern hemisphere or western hemisphere. - /// - /// ex. "America/New York", which is UTC-4 can be expressed as western-hemisphere-secs(4 - /// * 3600) - variant offset { - eastern-hemisphere-secs(s32), - western-hemisphere-secs(s32), - } - - /// Dates are represented similarly to tokio-postgres implementation - /// see: https://docs.rs/postgres-types/0.2.6/postgres_types/enum.Date.html#variant.Value - variant date { - positive-infinity, - negative-infinity, - ymd(tuple), - } - record interval { - start: date, - start-inclusive: bool, - end: date, - end-inclusive: bool, - } - record time { - hour: u32, - min: u32, - sec: u32, - micro: u32, - } - record time-tz { - timesonze: string, - time: time, - } - record timestamp { date: date, time: time } - record timestamp-tz { - timestamp: timestamp, - offset: offset, - } - record mac-address-eui48 { - bytes: tuple, - } - record mac-address-eui64 { - bytes: tuple, - } - - /// Postgres data values, usable as parameters or via queries - /// see: https://www.postgresql.org/docs/current/datatype.html - /// - /// This datatype is primarily intended to be used with the `raw` encoding scheme. - /// - /// NOTE: all numeric values are little-endian unless otherwise specified - variant pg-value { - null, - /// Numeric - big-int(s64), - int8(s64), - int8-array(list), - big-serial(s64), - serial8(s64), - %bool(bool), - boolean(bool), - bool-array(list), - double(hashable-f64), - float8(hashable-f64), - float8-array(list), - real(hashable-f32), - float4(hashable-f32), - float4-array(list), - integer(s32), - int(s32), - int4(s32), - int4-array(list), - numeric(numeric), - decimal(numeric), - numeric-array(list), - serial(u32), - serial4(u32), - small-int(s16), - int2(s16), - int2-array(list), - int2-vector(list), - int2-vector-array(list>), - small-serial(s16), - serial2(s16), - /// note: matches tokio-postgres - /// Bytes - /// - /// For bit & bit-varying, see the encoding scheme used by bit-vec: - /// https://contain-rs.github.io/bit-vec/bit_vec/struct.BitVec.html#method.to_bytes - bit(tuple>), - bit-array(list>>), - bit-varying(tuple, list>), - varbit(tuple, list>), - varbit-array(list, list>>), - bytea(list), - bytea-array(list>), - /// Characters - /// TODO: specify text encoding, to negotiate possible component/DB mismatch? - %char(tuple>), - char-array(list>>), - varchar(tuple, list>), - varchar-array(list, list>>), - /// Networking - cidr(string), - cidr-array(list), - inet(string), - inet-array(list), - macaddr(mac-address-eui48), - /// EUI-48 - macaddr-array(list), - /// EUI-48 - macaddr8(mac-address-eui64), - /// EUI-64 (deprecated) - macaddr8-array(list), - /// EUI-64 (deprecated) - /// Geo - box(tuple), - box-array(list>), - circle(tuple), - circle-array(list>), - line(tuple), - line-array(list>), - lseg(tuple), - lseg-array(list>), - path(list), - path-array(list>), - point(point), - point-array(list), - polygon(list), - polygon-array(list>), - /// Date-time - date(date), - date-array(list), - interval(interval), - interval-array(list), - time(time), - time-array(list