-
Notifications
You must be signed in to change notification settings - Fork 15
x/wasihttp: add wasihttp package #305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Can we have this share WIT files with the files in |
Should this have its own |
@ydnar I thought testdata is for testing purposes With that said, why do you want to share the WIT files in |
Nice work on this one @Mossaka! |
This PR highlights a bug (or a feature, depending on how you look at it) of TinyGo’s stdlib already includes the generated bindings for I’d like to propose a feature for |
@ydnar I am interested in following along on this. I would add that when developing libraries that intend to wrap imports and exports off shared interfaces, there are also conflicts in generating code. This is not directly related, but it is something I've been attempting to resolve. Happy to write a separate issue for this explaining what I think is the conflict. |
This commit ports the wasihttp package from the [wasi-http-go](https://github.com/ydnar/wasi-http-go) repository to here under the `x/wasihttp` directory. The wasihttp package provides a WASI HTTP server and client implementation using Go net/http package. The ./x/wasihttp/internal directory is regenerated using `make go-bindings` command from the wasihttp Makefile. Examples can be found in the `x/wasihttp/examples` directory and can be run under the ./x/wasihttp working directory. This new package has its own CHANGELOG.md, README.md, and RELEASE.md files to document the changes, usage, and release notes. Signed-off-by: Jiaxiao Zhou <[email protected]>
Signed-off-by: Jiaxiao Zhou <[email protected]>
- also update go.work to include the new package - slice the proxy.wit to only include the necessary imports - re-generate the bindings Signed-off-by: Jiaxiao Zhou <[email protected]>
and update the examples docs to refer to the right working directory and command to build. Signed-off-by: Jiaxiao Zhou <[email protected]>
Sounds good to me. I've limited the generated code to this specific WIT world: world proxy {
import wasi:clocks/monotonic-clock@0.2.0;
import wasi:io/streams@0.2.0;
import wasi:io/error@0.2.0;
import wasi:io/poll@0.2.0;
import wasi:http/types@0.2.0;
import wasi:http/outgoing-handler@0.2.0;
export wasi:http/incoming-handler@0.2.0;
} it's much more narrowly scoped than before and |
Signed-off-by: Jiaxiao Zhou <[email protected]>
Signed-off-by: Jiaxiao Zhou <[email protected]>
Signed-off-by: Jiaxiao Zhou <[email protected]>
@ydnar please take a look and let me know your thoughts on how to proceed with this PR |
This commit ports the wasihttp package from the wasi-http-go repository to here under the
x/wasihttp
directory. The wasihttp package provides a WASI HTTP server and client implementation using Go net/http package.The
./x/wasihttp/internal
directory is regenerated usingmake go-bindings
command from the wasihttp Makefile. Examples can be found in thex/wasihttp/examples
directory and can be run under the ./x/wasihttp working directory.This new package has its own CHANGELOG.md, README.md, and RELEASE.md files to document the changes, usage, and release notes.
Signed-off-by: Jiaxiao Zhou [email protected]