Skip to content

Commit 97b1e83

Browse files
committed
fix: update NAME:
wit-bindgen-go - inspect or manipulate WebAssembly Interface Types for Go USAGE: wit-bindgen-go [global options] [command [command options]] COMMANDS: generate, go generate Go bindings from from WIT (WebAssembly Interface Types) wit reverses a WIT JSON file into WIT syntax version print the version help, h Shows a list of commands or help for one command GLOBAL OPTIONS: --version print the version --force-wit force loading WIT via wasm-tools (default: false) --verbose, -v print verbose logging messages (default: false) --debug, --vv print debug logging messages (default: false) --help, -h show help version Signed-off-by: Andrew Steurer <[email protected]>
1 parent a65f13a commit 97b1e83

File tree

4 files changed

+83
-23
lines changed

4 files changed

+83
-23
lines changed

v3/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.PHONY: go-bindings
2+
go-bindings:
3+
go run go.bytecodealliance.org/cmd/wit-bindgen-go generate -w http-trigger -p github.com/spinframework/spin-go-sdk/v3/internal --out internal ./wit

v3/README.md

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,23 @@
1-
WIP
1+
# Overview
22

3-
spin-go-sdk with wasip2 support
3+
WORK IN PROGRESS
44

5-
Notes:
5+
Adding wasip2 support to the `spin-go-sdk`
66

7-
The current version of tooling used for this work:
7+
# Requirements
88

9-
- wit-bindgen-go `wit-bindgen-go version (devel) (0e3b31e354b31b4f2d5e7d5163e29fb2ffd0b052)`
10-
- wasm-tools `wasm-tools 1.227.1`
11-
- tinygo `tinygo version 0.37.0 darwin/arm64 (using go version go1.24.1 and LLVM version 19.1.2)`
12-
- spin `spin 3.2.0-pre0 (3d07b0cb 2025-03-14)`
13-
- go `go version go1.24.1 darwin/arm64`
14-
- binaryen tools `binaryen-version_123`
9+
- TinyGo [v0.38.0](https://github.com/tinygo-org/tinygo/releases/tag/v0.38.0)
10+
- Spin [v3.3.1](https://spinframework.dev/v3/install)
11+
- Go [v1.24.5](https://go.dev/dl/)
1512

1613

17-
Regeneratin bindings:
14+
# Usage
1815

19-
- install tooling as specified above
20-
- make sure they are on PATH and picking up the versions as specified above
21-
- cd `<root>/v3`
22-
- Run: `wit-bindgen-go generate -w http-trigger -p github.com/spinframework/spin-go-sdk/v3/internal --out internal ./wit`
16+
To regenerate the bindings, run the following commands from within the `v3` directory:
17+
```sh
18+
make go-bindings
19+
```
2320

24-
Testing:
21+
# Testing
2522

26-
- cd `<root>/v3/examples/http`
27-
- Run `spin build`
28-
- Run `spin up`
29-
- In a separate terminal, run: `curl http://127.0.0.1:3000/hello`
23+
To test the SDK, try running the example applications in `v3/examples`

v3/go.mod

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,24 @@ module github.com/spinframework/spin-go-sdk/v3
22

33
go 1.23.2
44

5+
tool go.bytecodealliance.org/cmd/wit-bindgen-go
6+
57
require (
68
github.com/julienschmidt/httprouter v1.3.0
7-
go.bytecodealliance.org/cm v0.2.2
9+
go.bytecodealliance.org/cm v0.3.0
10+
)
11+
12+
require (
13+
github.com/coreos/go-semver v0.3.1 // indirect
14+
github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 // indirect
15+
github.com/klauspost/compress v1.18.0 // indirect
16+
github.com/opencontainers/go-digest v1.0.0 // indirect
17+
github.com/regclient/regclient v0.8.3 // indirect
18+
github.com/sirupsen/logrus v1.9.3 // indirect
19+
github.com/tetratelabs/wazero v1.9.0 // indirect
20+
github.com/ulikunitz/xz v0.5.12 // indirect
21+
github.com/urfave/cli/v3 v3.3.3 // indirect
22+
go.bytecodealliance.org v0.7.0 // indirect
23+
golang.org/x/mod v0.24.0 // indirect
24+
golang.org/x/sys v0.33.0 // indirect
825
)

v3/go.sum

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,50 @@
1+
github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4=
2+
github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec=
3+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
4+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
5+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
6+
github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 h1:UhxFibDNY/bfvqU5CAUmr9zpesgbU6SWc8/B4mflAE4=
7+
github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE=
18
github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=
29
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
3-
go.bytecodealliance.org/cm v0.2.2 h1:M9iHS6qs884mbQbIjtLX1OifgyPG9DuMs2iwz8G4WQA=
4-
go.bytecodealliance.org/cm v0.2.2/go.mod h1:JD5vtVNZv7sBoQQkvBvAAVKJPhR/bqBH7yYXTItMfZI=
10+
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
11+
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
12+
github.com/olareg/olareg v0.1.2 h1:75G8X6E9FUlzL/CSjgFcYfMgNzlc7CxULpUUNsZBIvI=
13+
github.com/olareg/olareg v0.1.2/go.mod h1:TWs+N6pO1S4bdB6eerzUm/ITRQ6kw91mVf9ZYeGtw+Y=
14+
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
15+
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
16+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
17+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
18+
github.com/regclient/regclient v0.8.3 h1:AFAPu/vmOYGyY22AIgzdBUKbzH+83lEpRioRYJ/reCs=
19+
github.com/regclient/regclient v0.8.3/go.mod h1:gjQh5uBVZoo/CngchghtQh9Hx81HOMKRRDd5WPcPkbk=
20+
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
21+
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
22+
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
23+
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
24+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
25+
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
26+
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
27+
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
28+
github.com/tetratelabs/wazero v1.9.0 h1:IcZ56OuxrtaEz8UYNRHBrUa9bYeX9oVY93KspZZBf/I=
29+
github.com/tetratelabs/wazero v1.9.0/go.mod h1:TSbcXCfFP0L2FGkRPxHphadXPjo1T6W+CseNNY7EkjM=
30+
github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc=
31+
github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
32+
github.com/urfave/cli/v3 v3.3.3 h1:byCBaVdIXuLPIDm5CYZRVG6NvT7tv1ECqdU4YzlEa3I=
33+
github.com/urfave/cli/v3 v3.3.3/go.mod h1:FJSKtM/9AiiTOJL4fJ6TbMUkxBXn7GO9guZqoZtpYpo=
34+
go.bytecodealliance.org v0.7.0 h1:CTJ1eb5kFhBKHw1/xycxxz4SmVWNKXYHhrA78oLNXhY=
35+
go.bytecodealliance.org v0.7.0/go.mod h1:PCLMft5yTQsHT9oNPWlq0I6Qdmo6THvdky2AZHjNUkA=
36+
go.bytecodealliance.org/cm v0.3.0 h1:VhV+4vjZPUGCozCg9+up+FNL3YU6XR+XKghk7kQ0vFc=
37+
go.bytecodealliance.org/cm v0.3.0/go.mod h1:JD5vtVNZv7sBoQQkvBvAAVKJPhR/bqBH7yYXTItMfZI=
38+
golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU=
39+
golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
40+
golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ=
41+
golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
42+
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
43+
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
44+
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
45+
golang.org/x/tools v0.33.0 h1:4qz2S3zmRxbGIhDIAgjxvFutSvH5EfnsYrRBj0UI0bc=
46+
golang.org/x/tools v0.33.0/go.mod h1:CIJMaWEY88juyUfo7UbgPqbC8rU2OqfAV1h2Qp0oMYI=
47+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
48+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
49+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
50+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 commit comments

Comments
 (0)