Skip to content

Commit c3bbfeb

Browse files
authored
Merge pull request #717 from sealmove/go-docs
2 parents 68cb0a8 + 13c6b8c commit c3bbfeb

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

docs/content/go-components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ allowed_http_hosts = [ "some-random-api.ml" ]
132132
route = "/hello"
133133
```
134134

135-
> Spin HTTP components written in Go must currently use the Wagi executor.
135+
> Spin HTTP components written in Go use the Spin executor.
136136
137137
Running the application using `spin up --file spin.toml` will start the HTTP
138138
listener locally (by default on `localhost:3000`), and our component can

docs/content/http-trigger.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ print("content-type: text/html; charset=UTF-8\n\n");
214214
print("hello world\n");
215215
```
216216

217-
The [Go SDK for Spin](./go-components.md) is built on the Wagi executor support.
217+
The [Go SDK for Spin](./go-components.md) supports the Spin executor.
218218
Here is another example, written in [Grain](https://grain-lang.org/),
219219
a new programming language that natively targets WebAssembly:
220220

examples/http-tinygo-outbound-http/readme.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ source = "main.wasm"
4242
allowed_http_hosts = [ "https://some-random-api.ml", "https://postman-echo.com" ]
4343
[component.trigger]
4444
route = "/hello"
45-
executor = { type = "wagi" }
4645
```
4746

4847
At this point, we can execute the application with the `spin` CLI:

sdk/go/readme.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
# The (Tiny)Go SDK for Spin
22

33
This package contains an SDK that facilitates building Spin components in
4-
(Tiny)Go. It currently allows building HTTP components that target the Wagi
4+
(Tiny)Go. It allows building HTTP components that target the Spin
55
executor.
66

77
```go
8-
func main() {
9-
// call the HandleRequest function
10-
spin_http.HandleRequest(func(w http.ResponseWriter, r *http.Request) {
11-
fmt.Fprintln(w, "Hello, Fermyon!")
12-
})
8+
import (
9+
"fmt"
10+
spinhttp "github.com/fermyon/spin/sdk/go/http"
11+
)
12+
13+
func init() {
14+
// call the Handle function
15+
spinhttp.Handle(func(w http.ResponseWriter, r *http.Request) {
16+
fmt.Fprintln(w, "Hello, Fermyon!")
17+
})
1318
}
19+
20+
func main() {}
1421
```

0 commit comments

Comments
 (0)