Skip to content
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

feat(example-http-server): update wadge #13

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _examples/http-server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.23.0
require (
github.com/bytecodealliance/wasm-tools-go v0.2.0
github.com/stretchr/testify v1.9.0
github.com/wasmCloud/west v0.2.0
github.com/wasmCloud/wadge v0.3.0
go.wasmcloud.dev/component v0.0.0-20240910182305-2785f866ff0f
)

Expand Down
4 changes: 2 additions & 2 deletions _examples/http-server/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/urfave/cli/v3 v3.0.0-alpha9 h1:P0RMy5fQm1AslQS+XCmy9UknDXctOmG/q/FZkUFnJSo=
github.com/urfave/cli/v3 v3.0.0-alpha9/go.mod h1:0kK/RUFHyh+yIKSfWxwheGndfnrvYSmYFVeKCh03ZUc=
github.com/wasmCloud/west v0.2.0 h1:R2/lbixcyKc0AmroBjEDU6qiDXDaLibe1b9NlsScgmY=
github.com/wasmCloud/west v0.2.0/go.mod h1:ShI3dVzzb7UUyJsHEyGwJviBB3DitSk4qI+p2RGKJNI=
github.com/wasmCloud/wadge v0.3.0 h1:uDmsxgeACARbW9idI9HBf9CQj+nQHskRN7lch6WzJN0=
github.com/wasmCloud/wadge v0.3.0/go.mod h1:d1D1q/mtLr6v6hg/UCIq4G8Ygf6ku7M8VS6/4MhL5Xk=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0=
Expand Down
12 changes: 6 additions & 6 deletions _examples/http-server/main_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:generate go run github.com/wasmCloud/west/cmd/west-bindgen-go
//go:generate go run github.com/wasmCloud/wadge/cmd/wadge-bindgen-go

package main

Expand All @@ -11,9 +11,9 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"github.com/wasmCloud/west"
_ "github.com/wasmCloud/west/bindings"
"github.com/wasmCloud/west/westhttp"
"github.com/wasmCloud/wadge"
_ "github.com/wasmCloud/wadge/bindings"
"github.com/wasmCloud/wadge/wadgehttp"
incominghandler "go.wasmcloud.dev/component/gen/wasi/http/incoming-handler"
)

Expand All @@ -30,15 +30,15 @@ func init() {
}

func TestIncomingHandler(t *testing.T) {
west.RunTest(t, func() {
wadge.RunTest(t, func() {
req, err := http.NewRequest("", "/test", nil)
if err != nil {
t.Fatalf("failed to create new HTTP request: %s", err)
}
req.Header.Add("foo", "bar")
req.Header.Add("foo", "baz")
req.Header.Add("key", "value")
resp, err := westhttp.HandleIncomingRequest(incominghandler.Exports.Handle, req)
resp, err := wadgehttp.HandleIncomingRequest(incominghandler.Exports.Handle, req)
if err != nil {
t.Fatalf("failed to handle incoming HTTP request: %s", err)
}
Expand Down
2 changes: 1 addition & 1 deletion _examples/http-server/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ package main

import (
_ "github.com/bytecodealliance/wasm-tools-go/cmd/wit-bindgen-go"
_ "github.com/wasmCloud/west/cmd/west-bindgen-go"
_ "github.com/wasmCloud/wadge/cmd/wadge-bindgen-go"
)
Loading
Loading