-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from adamreese/update-import-paths
Update import paths to new package
- Loading branch information
Showing
80 changed files
with
181 additions
and
190 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module examples/http-outbound/hello | ||
|
||
go 1.20 | ||
|
||
require github.com/fermyon/spin-go-sdk v0.0.0 | ||
|
||
require github.com/julienschmidt/httprouter v1.3.0 // indirect | ||
|
||
replace github.com/fermyon/spin-go-sdk v0.0.0 => ../../../ |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module examples/http-outbound/http-to-same-app | ||
|
||
go 1.20 | ||
|
||
require github.com/fermyon/spin-go-sdk v0.0.0 | ||
|
||
require github.com/julienschmidt/httprouter v1.3.0 // indirect | ||
|
||
replace github.com/fermyon/spin-go-sdk v0.0.0 => ../../../ |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,31 +3,31 @@ spin_manifest_version = 2 | |
[application] | ||
authors = ["Fermyon Engineering <[email protected]>"] | ||
description = "A simple Spin application written in (Tiny)Go that performs outbound HTTP requests." | ||
name = "spin-tinygo-outbound-http" | ||
name = "http-outbound-example" | ||
version = "1.0.0" | ||
|
||
[[trigger.http]] | ||
route = "/hello" | ||
component = "tinygo-hello" | ||
component = "hello" | ||
|
||
[[trigger.http]] | ||
route = "/outbound-http-to-same-app" | ||
component = "outbound-http-to-same-app" | ||
route = "/http-to-same-app" | ||
component = "http-to-same-app" | ||
|
||
[component.tinygo-hello] | ||
source = "tinygo-hello/main.wasm" | ||
[component.hello] | ||
source = "hello/main.wasm" | ||
allowed_outbound_hosts = [ | ||
"https://random-data-api.fermyon.app:443", | ||
"https://postman-echo.com:443", | ||
"https://random-data-api.fermyon.app:443", | ||
"https://postman-echo.com:443", | ||
] | ||
[component.tinygo-hello.build] | ||
workdir = "tinygo-hello" | ||
[component.hello.build] | ||
workdir = "hello" | ||
command = "tinygo build -target=wasi -gc=leaking -no-debug -o main.wasm main.go" | ||
|
||
[component.outbound-http-to-same-app] | ||
source = "outbound-http-to-same-app/main.wasm" | ||
[component.http-to-same-app] | ||
source = "http-to-same-app/main.wasm" | ||
# Use self to make outbound requests to components in the same Spin application. | ||
allowed_outbound_hosts = ["http://self"] | ||
[component.outbound-http-to-same-app.build] | ||
workdir = "outbound-http-to-same-app" | ||
[component.http-to-same-app.build] | ||
workdir = "http-to-same-app" | ||
command = "tinygo build -target=wasi -gc=leaking -no-debug -o main.wasm main.go" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module examples/http-router | ||
|
||
go 1.20 | ||
|
||
require github.com/fermyon/spin-go-sdk v0.0.0 | ||
|
||
require github.com/julienschmidt/httprouter v1.3.0 // indirect | ||
|
||
replace github.com/fermyon/spin-go-sdk v0.0.0 => ../../ |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,14 +3,14 @@ spin_manifest_version = 2 | |
[application] | ||
authors = ["Fermyon Engineering <[email protected]>"] | ||
description = "A simple Spin application written in (Tiny)Go." | ||
name = "spin-hello-tinygo" | ||
name = "hello-router-example" | ||
version = "1.0.0" | ||
|
||
[[trigger.http]] | ||
route = "/..." | ||
component = "tinygo-hello" | ||
component = "hello" | ||
|
||
[component.tinygo-hello] | ||
[component.hello] | ||
source = "main.wasm" | ||
[component.tinygo-hello.build] | ||
[component.hello.build] | ||
command = "tinygo build -target=wasi -gc=leaking -no-debug -o main.wasm main.go" |
9 changes: 0 additions & 9 deletions
9
examples/http-tinygo-outbound-http/outbound-http-to-same-app/go.mod
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module examples/http | ||
|
||
go 1.20 | ||
|
||
require github.com/fermyon/spin-go-sdk v0.0.0 | ||
|
||
require github.com/julienschmidt/httprouter v1.3.0 // indirect | ||
|
||
replace github.com/fermyon/spin-go-sdk v0.0.0 => ../../ |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,14 +3,14 @@ spin_manifest_version = 2 | |
[application] | ||
authors = ["Fermyon Engineering <[email protected]>"] | ||
description = "A simple Spin application written in (Tiny)Go." | ||
name = "spin-hello-tinygo" | ||
name = "hello-example" | ||
version = "1.0.0" | ||
|
||
[[trigger.http]] | ||
route = "/hello" | ||
component = "tinygo-hello" | ||
component = "hello" | ||
|
||
[component.tinygo-hello] | ||
[component.hello] | ||
source = "main.wasm" | ||
[component.tinygo-hello.build] | ||
[component.hello.build] | ||
command = "tinygo build -target=wasi -gc=leaking -no-debug -o main.wasm main.go" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module examples/key-value | ||
|
||
go 1.20 | ||
|
||
require github.com/fermyon/spin-go-sdk v0.0.0 | ||
|
||
require github.com/julienschmidt/httprouter v1.3.0 // indirect | ||
|
||
replace github.com/fermyon/spin-go-sdk v0.0.0 => ../../ |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ spin_manifest_version = 2 | |
|
||
[application] | ||
authors = ["Fermyon Engineering <[email protected]>"] | ||
name = "tinygo-key-value-example" | ||
name = "key-value-example" | ||
version = "0.1.0" | ||
|
||
[[trigger.http]] | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module examples/llm | ||
|
||
go 1.20 | ||
|
||
require github.com/fermyon/spin-go-sdk v0.0.0 | ||
|
||
require github.com/julienschmidt/httprouter v1.3.0 // indirect | ||
|
||
replace github.com/fermyon/spin-go-sdk v0.0.0 => ../../ |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,17 +3,17 @@ spin_manifest_version = 2 | |
[application] | ||
authors = ["Fermyon Engineering <[email protected]>"] | ||
description = "Simple example using the llm sdk." | ||
name = "tinygo-llm" | ||
name = "llm-example" | ||
version = "0.1.0" | ||
|
||
[[trigger.http]] | ||
route = "/..." | ||
component = "tinygo-llm" | ||
component = "llm" | ||
|
||
[component.tinygo-llm] | ||
[component.llm] | ||
source = "main.wasm" | ||
allowed_outbound_hosts = [] | ||
ai_models = ["llama2-chat", "all-minilm-l6-v2"] | ||
[component.tinygo-llm.build] | ||
[component.llm.build] | ||
command = "tinygo build -target=wasi -gc=leaking -no-debug -o main.wasm main.go" | ||
watch = ["**/*.go", "go.mod"] |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module examples/mysql-outbound | ||
|
||
go 1.20 | ||
|
||
require github.com/fermyon/spin-go-sdk v0.0.0 | ||
|
||
require github.com/julienschmidt/httprouter v1.3.0 // indirect | ||
|
||
replace github.com/fermyon/spin-go-sdk v0.0.0 => ../../ |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,17 +3,17 @@ spin_manifest_version = 2 | |
[application] | ||
authors = ["Patrick Jiang <[email protected]>"] | ||
description = "" | ||
name = "tinygo-mysql" | ||
name = "mysql-outbound-example" | ||
version = "0.1.0" | ||
|
||
[[trigger.http]] | ||
route = "/..." | ||
component = "tinygo-mysql" | ||
component = "mysql" | ||
|
||
[component.tinygo-mysql] | ||
[component.mysql] | ||
environment = { DB_URL = "mysql://spin:[email protected]/spin_dev" } | ||
source = "main.wasm" | ||
allowed_outbound_hosts = ["mysql://127.0.0.1"] | ||
[component.tinygo-mysql.build] | ||
[component.mysql.build] | ||
command = "tinygo build -target=wasi -gc=leaking -o main.wasm main.go" | ||
watch = ["**/*.go", "go.mod"] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module examples/pg-outbound | ||
|
||
go 1.20 | ||
|
||
require github.com/fermyon/spin-go-sdk v0.0.0 | ||
|
||
require github.com/julienschmidt/httprouter v1.3.0 // indirect | ||
|
||
replace github.com/fermyon/spin-go-sdk v0.0.0 => ../../ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= | ||
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,17 +3,17 @@ spin_manifest_version = 2 | |
[application] | ||
authors = ["Patrick Jiang <[email protected]>"] | ||
description = "" | ||
name = "tinygo-outbound-pg-example" | ||
name = "pg-outbound-example" | ||
version = "0.1.0" | ||
|
||
[[trigger.http]] | ||
route = "/..." | ||
component = "tinygo-outbound-pg-example" | ||
component = "pg-outbound" | ||
|
||
[component.tinygo-outbound-pg-example] | ||
[component.pg-outbound] | ||
environment = { DB_URL = "host=localhost user=postgres dbname=spin_dev" } | ||
source = "main.wasm" | ||
allowed_outbound_hosts = ["postgres://localhost"] | ||
[component.tinygo-outbound-pg-example.build] | ||
[component.pg-outbound.build] | ||
command = "tinygo build -target=wasi -gc=leaking -o main.wasm main.go" | ||
watch = ["**/*.go", "go.mod"] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module examples/redis-outbound | ||
|
||
go 1.20 | ||
|
||
require github.com/fermyon/spin-go-sdk v0.0.0 | ||
|
||
require github.com/julienschmidt/httprouter v1.3.0 // indirect | ||
|
||
replace github.com/fermyon/spin-go-sdk v0.0.0 => ../../ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
github.com/fermyon/spin/sdk/go v1.4.1 h1:n8KTYTnkErTJdyMBBEtPmJe8dXrvMT6R7iVWbLRjq5E= | ||
github.com/fermyon/spin/sdk/go v1.4.1/go.mod h1:yb8lGesopgj/GwPzLPATxcOeqWZT/HjrzEFfwbztAXE= | ||
github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= | ||
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ spin_manifest_version = 2 | |
|
||
[application] | ||
authors = ["Fermyon Engineering <[email protected]>"] | ||
name = "tinygo-outbound-redis-example" | ||
name = "redis-outbound-example" | ||
version = "0.1.0" | ||
|
||
[[trigger.http]] | ||
|
File renamed without changes.
Oops, something went wrong.