Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ test-integration: http/testdata/http-tinygo/main.wasm
go test -v -count=1 .

.PHONY: test-integration-wasip2
test-integration-wasip2:
cd v2 && go test -v -count=1 .
test-integration-wasip2:
cd v3 && go test -v -count=1 .

http/testdata/http-tinygo/main.wasm: generate
http/testdata/http-tinygo/main.wasm: http/testdata/http-tinygo/main.go
Expand Down
12 changes: 0 additions & 12 deletions v2/examples/http/go.mod

This file was deleted.

12 changes: 0 additions & 12 deletions v2/examples/kv/go.mod

This file was deleted.

12 changes: 0 additions & 12 deletions v2/examples/llm/go.mod

This file was deleted.

12 changes: 0 additions & 12 deletions v2/examples/variables/go.mod

This file was deleted.

12 changes: 0 additions & 12 deletions v2/http/testdata/http-tinygo/go.mod

This file was deleted.

12 changes: 0 additions & 12 deletions v2/kv/testdata/key-value/go.mod

This file was deleted.

12 changes: 0 additions & 12 deletions v2/variables/testdata/variables/go.mod

This file was deleted.

6 changes: 3 additions & 3 deletions v2/README.md → v3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ Regeneratin bindings:

- install tooling as specified above
- make sure they are on PATH and picking up the versions as specified above
- cd `<root>/v2`
- Run: `wit-bindgen-go generate -w http-trigger -p github.com/spinframework/spin-go-sdk/v2/internal --out internal ./wit`
- cd `<root>/v3`
- Run: `wit-bindgen-go generate -w http-trigger -p github.com/spinframework/spin-go-sdk/v3/internal --out internal ./wit`

Testing:

- cd `<root>/v2/examples/http`
- cd `<root>/v3/examples/http`
- Run `spin build`
- Run `spin up`
- In a separate terminal, run: `curl http://127.0.0.1:3000/hello`
12 changes: 12 additions & 0 deletions v3/examples/http/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module github.com/spinframework/spin-go-sdk/v3/examples/http

go 1.23.2

require github.com/spinframework/spin-go-sdk/v3 v3.0.0

require (
github.com/julienschmidt/httprouter v1.3.0 // indirect
go.bytecodealliance.org/cm v0.2.2 // indirect
)

replace github.com/spinframework/spin-go-sdk/v3 => ../../
File renamed without changes.
2 changes: 1 addition & 1 deletion v2/examples/http/main.go → v3/examples/http/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"net/http"

spinhttp "github.com/spinframework/spin-go-sdk/v2/http"
spinhttp "github.com/spinframework/spin-go-sdk/v3/http"
)

func init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ component = "hello"
[component.hello]
source = "main.wasm"
[component.hello.build]
command = "tinygo build -target=wasip2 --wit-package $(go list -mod=readonly -m -f '{{.Dir}}' github.com/spinframework/spin-go-sdk/v2)/wit --wit-world http-trigger -gc=leaking -no-debug -o main.wasm main.go"
command = "tinygo build -target=wasip2 --wit-package $(go list -mod=readonly -m -f '{{.Dir}}' github.com/spinframework/spin-go-sdk/v3)/wit --wit-world http-trigger -gc=leaking -no-debug -o main.wasm main.go"

12 changes: 12 additions & 0 deletions v3/examples/kv/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module github.com/spinframework/spin-go-sdk/v3/examples/kv

go 1.24.1

require github.com/spinframework/spin-go-sdk/v3 v3.0.0

require (
github.com/julienschmidt/httprouter v1.3.0 // indirect
go.bytecodealliance.org/cm v0.2.2 // indirect
)

replace github.com/spinframework/spin-go-sdk/v3 => ../../
File renamed without changes.
4 changes: 2 additions & 2 deletions v2/examples/kv/main.go → v3/examples/kv/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"net/http"

spinhttp "github.com/spinframework/spin-go-sdk/v2/http"
"github.com/spinframework/spin-go-sdk/v2/kv"
spinhttp "github.com/spinframework/spin-go-sdk/v3/http"
"github.com/spinframework/spin-go-sdk/v3/kv"
)

func init() {
Expand Down
3 changes: 2 additions & 1 deletion v2/examples/kv/spin.toml → v3/examples/kv/spin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ component = "hello"
source = "main.wasm"
key_value_stores = ["default"]
[component.hello.build]
command = "tinygo build -target=wasip2 --wit-package $(go list -mod=readonly -m -f '{{.Dir}}' github.com/spinframework/spin-go-sdk/v2)/wit --wit-world http-trigger -gc=leaking -no-debug -o main.wasm main.go"
command = "tinygo build -target=wasip2 --wit-package $(go list -mod=readonly -m -f '{{.Dir}}' github.com/spinframework/spin-go-sdk/v3)/wit --wit-world http-trigger -gc=leaking -no-debug -o main.wasm main.go"

File renamed without changes.
12 changes: 12 additions & 0 deletions v3/examples/llm/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module github.com/spinframework/spin-go-sdk/v3/examples/llm

go 1.24.1

require github.com/spinframework/spin-go-sdk/v3 v3.0.0

require (
github.com/julienschmidt/httprouter v1.3.0 // indirect
go.bytecodealliance.org/cm v0.2.2 // indirect
)

replace github.com/spinframework/spin-go-sdk/v3 => ../../
File renamed without changes.
4 changes: 2 additions & 2 deletions v2/examples/llm/main.go → v3/examples/llm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"net/http"

spinhttp "github.com/spinframework/spin-go-sdk/v2/http"
"github.com/spinframework/spin-go-sdk/v2/llm"
spinhttp "github.com/spinframework/spin-go-sdk/v3/http"
"github.com/spinframework/spin-go-sdk/v3/llm"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion v2/examples/llm/spin.toml → v3/examples/llm/spin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ source = "main.wasm"
allowed_outbound_hosts = []
ai_models = ["llama2-chat", "all-minilm-l6-v2"]
[component.llm.build]
command = "tinygo build -target=wasip2 --wit-package $(go list -mod=readonly -m -f '{{.Dir}}' github.com/spinframework/spin-go-sdk/v2)/wit --wit-world http-trigger -gc=leaking -no-debug -o main.wasm main.go"
command = "tinygo build -target=wasip2 --wit-package $(go list -mod=readonly -m -f '{{.Dir}}' github.com/spinframework/spin-go-sdk/v3)/wit --wit-world http-trigger -gc=leaking -no-debug -o main.wasm main.go"
watch = ["**/*.go", "go.mod"]
12 changes: 12 additions & 0 deletions v3/examples/variables/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module github.com/spinframework/spin-go-sdk/v3/examples/variables

go 1.24.1

require github.com/spinframework/spin-go-sdk/v3 v3.0.0

require (
github.com/julienschmidt/httprouter v1.3.0 // indirect
go.bytecodealliance.org/cm v0.2.2 // indirect
)

replace github.com/spinframework/spin-go-sdk/v3 => ../../
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"net/http"

spinhttp "github.com/spinframework/spin-go-sdk/v2/http"
"github.com/spinframework/spin-go-sdk/v2/variables"
spinhttp "github.com/spinframework/spin-go-sdk/v3/http"
"github.com/spinframework/spin-go-sdk/v3/variables"
)

func init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ source = "main.wasm"
message = "I'm a {{object}}"

[component.hello.build]
command = "tinygo build -target=wasip2 --wit-package $(go list -mod=readonly -m -f '{{.Dir}}' github.com/spinframework/spin-go-sdk/v2)/wit --wit-world http-trigger -gc=leaking -no-debug -o main.wasm main.go"
command = "tinygo build -target=wasip2 --wit-package $(go list -mod=readonly -m -f '{{.Dir}}' github.com/spinframework/spin-go-sdk/v3)/wit --wit-world http-trigger -gc=leaking -no-debug -o main.wasm main.go"

2 changes: 1 addition & 1 deletion v2/go.mod → v3/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/spinframework/spin-go-sdk/v2
module github.com/spinframework/spin-go-sdk/v3

go 1.23.2

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions v2/http/client.go → v3/http/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"io"
"net/http"

outgoinghandler "github.com/spinframework/spin-go-sdk/v2/internal/wasi/http/v0.2.0/outgoing-handler"
"github.com/spinframework/spin-go-sdk/v2/internal/wasi/http/v0.2.0/types"
outgoinghandler "github.com/spinframework/spin-go-sdk/v3/internal/wasi/http/v0.2.0/outgoing-handler"
"github.com/spinframework/spin-go-sdk/v3/internal/wasi/http/v0.2.0/types"
"go.bytecodealliance.org/cm"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"io"
"net/http"

"github.com/spinframework/spin-go-sdk/v2/internal/wasi/http/v0.2.0/types"
"github.com/spinframework/spin-go-sdk/v3/internal/wasi/http/v0.2.0/types"
"go.bytecodealliance.org/cm"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package http
import (
"net/http"

"github.com/spinframework/spin-go-sdk/v2/internal/wasi/http/v0.2.0/types"
"github.com/spinframework/spin-go-sdk/v3/internal/wasi/http/v0.2.0/types"
"go.bytecodealliance.org/cm"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"net/http"
"strings"

"github.com/spinframework/spin-go-sdk/v2/internal/wasi/http/v0.2.0/types"
"github.com/spinframework/spin-go-sdk/v2/internal/wasi/io/v0.2.0/streams"
"github.com/spinframework/spin-go-sdk/v3/internal/wasi/http/v0.2.0/types"
"github.com/spinframework/spin-go-sdk/v3/internal/wasi/io/v0.2.0/streams"
"go.bytecodealliance.org/cm"
)

Expand Down
6 changes: 3 additions & 3 deletions v2/http/http.go → v3/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"os"

"github.com/julienschmidt/httprouter"
incominghandler "github.com/spinframework/spin-go-sdk/v2/internal/wasi/http/v0.2.0/incoming-handler"
"github.com/spinframework/spin-go-sdk/v2/internal/wasi/http/v0.2.0/types"
"github.com/spinframework/spin-go-sdk/v2/wit"
incominghandler "github.com/spinframework/spin-go-sdk/v3/internal/wasi/http/v0.2.0/incoming-handler"
"github.com/spinframework/spin-go-sdk/v3/internal/wasi/http/v0.2.0/types"
"github.com/spinframework/spin-go-sdk/v3/wit"
)

// force wit files to be shipped with sdk dependency
Expand Down
2 changes: 1 addition & 1 deletion v2/http/streams.go → v3/http/streams.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"io"

"github.com/spinframework/spin-go-sdk/v2/internal/wasi/io/v0.2.0/streams"
"github.com/spinframework/spin-go-sdk/v3/internal/wasi/io/v0.2.0/streams"
)

type inputStreamReader struct {
Expand Down
12 changes: 12 additions & 0 deletions v3/http/testdata/http-tinygo/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module github.com/spinframework/spin-go-sdk/v3/http/testdata/http

go 1.23.2

require github.com/spinframework/spin-go-sdk/v3 v3.0.0

require (
github.com/julienschmidt/httprouter v1.3.0 // indirect
go.bytecodealliance.org/cm v0.2.2 // indirect
)

replace github.com/spinframework/spin-go-sdk/v3 => ../../../
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"net/http"

spinhttp "github.com/spinframework/spin-go-sdk/v2/http"
spinhttp "github.com/spinframework/spin-go-sdk/v3/http"
)

func init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ component = "hello"
[component.hello]
source = "main.wasm"
[component.hello.build]
command = "tinygo build -target=wasip2 --wit-package $(go list -mod=readonly -m -f '{{.Dir}}' github.com/spinframework/spin-go-sdk/v2)/wit --wit-world http-trigger -gc=leaking -no-debug -o main.wasm main.go"
command = "tinygo build -target=wasip2 --wit-package $(go list -mod=readonly -m -f '{{.Dir}}' github.com/spinframework/spin-go-sdk/v3)/wit --wit-world http-trigger -gc=leaking -no-debug -o main.wasm main.go"

File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading