You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For Go applications, you must use the TinyGo compiler, as the standard Go compiler does not yet support the WASI standard. See the [TinyGo installation guide](https://tinygo.org/getting-started/install/).
128
-
129
-
The build command calls TinyGo with the WASI backend and appropriate options:
127
+
The build command calls `go tool` to run the `componentize-go` tool with appropriate options:
-[Creating Futures and Streams](#creating-futures-and-streams)
16
16
-[Storing Data in Redis From Go Components](#storing-data-in-redis-from-go-components)
17
-
-[Using Go Packages in Spin Components](#using-go-packages-in-spin-components)
18
17
-[Storing Data in the Spin Key-Value Store](#storing-data-in-the-spin-key-value-store)
19
18
-[Storing Data in SQLite](#storing-data-in-sqlite)
20
19
-[AI Inferencing From Go Components](#ai-inferencing-from-go-components)
21
20
22
21
> This guide assumes you have Spin installed. If this is your first encounter with Spin, please see the [Quick Start](quickstart), which includes information about installing Spin with the Go templates, installing required tools, and creating Go applications.
23
22
24
-
> This guide assumes you are familiar with the Go programming language, and that
25
-
> you have
26
-
> [configured the TinyGo toolchain locally](https://tinygo.org/getting-started/install/).
27
-
Using TinyGo to compile components for Spin is currently required, as the
28
-
[Go compiler doesn't currently have support for compiling to WASI](https://github.com/golang/go/issues/31105).
23
+
> This guide assumes you are familiar with the Go programming language.
29
24
30
25
> All examples from this page can be found in [the Spin Go SDK repository on GitHub](https://github.com/spinframework/spin-go-sdk/tree/main/examples).
31
26
32
-
[**Want to go straight to the Spin SDK reference documentation?** Find it here.](https://pkg.go.dev/github.com/spinframework/spin-go-sdk/v2)
27
+
[**Want to go straight to the Spin SDK reference documentation?** Find it here.](https://pkg.go.dev/github.com/spinframework/spin-go-sdk/v3)
33
28
34
29
## Versions
35
30
36
-
TinyGo `0.35.0` is recommended, which requires Go `v1.22+`. Older versions of TinyGo may not support the command-line flags used when building Spin applications.
Copy file name to clipboardExpand all lines: content/v4/http-outbound.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -201,15 +201,15 @@ You can find a complete example for using outbound HTTP in the [Python SDK repos
201
201
202
202
{{ blockEnd }}
203
203
204
-
{{ startTab "TinyGo"}}
204
+
{{ startTab "Go"}}
205
205
206
-
> [**Want to go straight to the reference documentation?** Find it here.](https://pkg.go.dev/github.com/spinframework/spin-go-sdk/v2@v2.2.1/http)
206
+
> [**Want to go straight to the reference documentation?** Find it here.](https://pkg.go.dev/github.com/spinframework/spin-go-sdk/v3@v3.0.0/http)
207
207
208
-
HTTP functions are available in the `github.com/spinframework/spin-go-sdk/v2/http` package. [See Go Packages for reference documentation.](https://pkg.go.dev/github.com/spinframework/spin-go-sdk/v2/http) The general function is named `Send`, but the Go SDK also surfaces individual functions, with request-specific parameters, for the `Get` and `Post` operations. For example:
208
+
HTTP functions are available in the `github.com/spinframework/spin-go-sdk/v3/http` package. [See Go Packages for reference documentation.](https://pkg.go.dev/github.com/spinframework/spin-go-sdk/v3/http) The general function is named `Send`, but the Go SDK also surfaces individual functions, with request-specific parameters, for the `Get` and `Post` operations. For example:
* In the `Post` function, the body is an `io.Reader`. The Spin SDK reads this into the underlying Wasm byte array.
227
226
* The `NewRequest` function is part of the standard library. The `Send` method adapts the standard request type to the underlying Wasm interface.
227
+
* The response has a `Body` field of type `io.Reader`.
228
228
* Errors are returned through the usual Go multiple return values mechanism.
229
229
230
230
You can find a complete example for using outbound HTTP in the [Spin repository on GitHub](https://github.com/spinframework/spin-go-sdk/tree/main/examples/http-outbound).
Copy file name to clipboardExpand all lines: content/v4/http-trigger.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -143,7 +143,7 @@ Other paths within the reserved space currently return 404 Not Found.
143
143
144
144
## Authoring HTTP Components
145
145
146
-
> Spin has two ways of running HTTP components, depending on language support for the evolving WebAssembly component standards. This section describes the default way, which is currently used by Rust, JavaScript/TypeScript, Python, and TinyGo components. For other languages, see [HTTP Components with Wagi](#http-with-wagi-webassembly-gateway-interface) below.
146
+
> Spin has two ways of running HTTP components, depending on language support for the evolving WebAssembly component standards. This section describes the default way, which is currently used by Rust, JavaScript/TypeScript, Python, and Go components. For other languages, see [HTTP Components with Wagi](#http-with-wagi-webassembly-gateway-interface) below.
147
147
148
148
By default, Spin runs components using the [WebAssembly component model](https://component-model.bytecodealliance.org/). In this model, the Wasm module exports a well-known interface that Spin calls to handle the HTTP request.
149
149
@@ -247,9 +247,9 @@ You can find a complete example for handling a HTTP request in the [Python SDK r
247
247
248
248
{{ blockEnd }}
249
249
250
-
{{ startTab "TinyGo"}}
250
+
{{ startTab "Go"}}
251
251
252
-
> [**Want to go straight to the reference documentation?** Find it here.](https://pkg.go.dev/github.com/spinframework/spin-go-sdk/v2@v2.2.1/http)
252
+
> [**Want to go straight to the reference documentation?** Find it here.](https://pkg.go.dev/github.com/spinframework/spin-go-sdk/v3@v3.0.0/http)
253
253
254
254
In Go, you register the handler as a callback in your program's `init` function. Set `handler.Exports.Handle` to your handler function. Your handler takes a `*Request` pointer, and returns a `Result[Response, ErrorCode]` with the response.
Copy file name to clipboardExpand all lines: content/v4/kv-store-api-guide.md
+4-5Lines changed: 4 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -176,21 +176,20 @@ You can find a complete Python code example using the Key Value store in the [Sp
176
176
177
177
{{ blockEnd }}
178
178
179
-
{{ startTab "TinyGo"}}
179
+
{{ startTab "Go"}}
180
180
181
-
> [**Want to go straight to the Spin SDK reference documentation?** Find it here.](https://pkg.go.dev/github.com/spinframework/spin-go-sdk/v2@v2.2.1/kv)
181
+
> [**Want to go straight to the Spin SDK reference documentation?** Find it here.](https://pkg.go.dev/github.com/spinframework/spin-go-sdk/v3@v3.0.0/kv)
182
182
183
-
Key value functions are provided by the `github.com/spinframework/spin-go-sdk/v2/kv` module. [See Go Packages for reference documentation.](https://pkg.go.dev/github.com/spinframework/spin-go-sdk/v2/kv) For example:
183
+
Key value functions are provided by the `github.com/spinframework/spin-go-sdk/v3/kv` module. [See Go Packages for reference documentation.](https://pkg.go.dev/github.com/spinframework/spin-go-sdk/v3/kv) For example:
Copy file name to clipboardExpand all lines: content/v4/language-support-overview.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,9 +83,9 @@ This page contains information about language support for Spin features:
83
83
84
84
{{ blockEnd }}
85
85
86
-
{{ startTab "TinyGo"}}
86
+
{{ startTab "Go"}}
87
87
88
-
**[📄 Visit the TinyGo Spin SDK reference documentation](https://pkg.go.dev/github.com/spinframework/spin-go-sdk/v2) to see specific modules, functions, variables and syntax relating to the following TinyGo SDK.**
88
+
**[📄 Visit the Go Spin SDK reference documentation](https://pkg.go.dev/github.com/spinframework/spin-go-sdk/v3) to see specific modules, functions, variables and syntax relating to the following Go SDK.**
0 commit comments