Skip to content

Commit

Permalink
Merge pull request #1 from adamreese/update-import-paths
Browse files Browse the repository at this point in the history
Update import paths to new package
  • Loading branch information
adamreese authored Feb 20, 2024
2 parents d4d8822 + b22d53f commit 48ddef7
Show file tree
Hide file tree
Showing 80 changed files with 181 additions and 190 deletions.
File renamed without changes.
9 changes: 9 additions & 0 deletions examples/http-outbound/hello/go.mod
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.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/http"
"os"

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

func init() {
Expand Down
9 changes: 9 additions & 0 deletions examples/http-outbound/http-to-same-app/go.mod
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 => ../../../
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"net/http"

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

func init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
9 changes: 9 additions & 0 deletions examples/http-router/go.mod
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.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"net/http"

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

func init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"

This file was deleted.

9 changes: 0 additions & 9 deletions examples/http-tinygo-outbound-http/tinygo-hello/go.mod

This file was deleted.

9 changes: 0 additions & 9 deletions examples/http-tinygo-router/go.mod

This file was deleted.

9 changes: 0 additions & 9 deletions examples/http-tinygo/go.mod

This file was deleted.

File renamed without changes.
9 changes: 9 additions & 0 deletions examples/http/go.mod
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.
2 changes: 1 addition & 1 deletion examples/http-tinygo/main.go → examples/http/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"io"
"net/http"

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

func init() {
Expand Down
8 changes: 4 additions & 4 deletions examples/http-tinygo/spin.toml → examples/http/spin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
9 changes: 9 additions & 0 deletions examples/key-value/go.mod
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.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"io"
"net/http"

spin_http "github.com/fermyon/spin/sdk/go/v2/http"
"github.com/fermyon/spin/sdk/go/v2/kv"
spin_http "github.com/fermyon/spin-go-sdk/http"
"github.com/fermyon/spin-go-sdk/kv"
)

func init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down
File renamed without changes.
9 changes: 9 additions & 0 deletions examples/llm/go.mod
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.
4 changes: 2 additions & 2 deletions examples/tinygo-llm/main.go → 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/fermyon/spin/sdk/go/v2/http"
"github.com/fermyon/spin/sdk/go/v2/llm"
spinhttp "github.com/fermyon/spin-go-sdk/http"
"github.com/fermyon/spin-go-sdk/llm"
)

func init() {
Expand Down
8 changes: 4 additions & 4 deletions examples/tinygo-llm/spin.toml → examples/llm/spin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
9 changes: 9 additions & 0 deletions examples/mysql-outbound/go.mod
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.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"net/http"
"os"

spinhttp "github.com/fermyon/spin/sdk/go/v2/http"
"github.com/fermyon/spin/sdk/go/v2/mysql"
spinhttp "github.com/fermyon/spin-go-sdk/http"
"github.com/fermyon/spin-go-sdk/mysql"
)

type Pet struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
9 changes: 9 additions & 0 deletions examples/pg-outbound/go.mod
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 => ../../
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=
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"net/http"
"os"

spinhttp "github.com/fermyon/spin/sdk/go/v2/http"
"github.com/fermyon/spin/sdk/go/v2/pg"
spinhttp "github.com/fermyon/spin-go-sdk/http"
"github.com/fermyon/spin-go-sdk/pg"
)

type Pet struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
9 changes: 9 additions & 0 deletions examples/redis-outbound/go.mod
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 => ../../
2 changes: 0 additions & 2 deletions examples/tinygo-llm/go.sum → examples/redis-outbound/go.sum
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=
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"sort"
"strconv"

spin_http "github.com/fermyon/spin/sdk/go/v2/http"
"github.com/fermyon/spin/sdk/go/v2/redis"
spin_http "github.com/fermyon/spin-go-sdk/http"
"github.com/fermyon/spin-go-sdk/redis"
)

func init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down
File renamed without changes.
Loading

0 comments on commit 48ddef7

Please sign in to comment.