diff --git a/cmd/ftl/cmd_call.go b/cmd/ftl/cmd_call.go
index 5d1d0c6064..93fdf1ed06 100644
--- a/cmd/ftl/cmd_call.go
+++ b/cmd/ftl/cmd_call.go
@@ -9,13 +9,13 @@ import (
"github.com/titanous/json5"
"github.com/TBD54566975/ftl/backend/common/log"
- "github.com/TBD54566975/ftl/go-runtime/sdk"
+ "github.com/TBD54566975/ftl/go-runtime/ftl"
ftlv1 "github.com/TBD54566975/ftl/protos/xyz/block/ftl/v1"
"github.com/TBD54566975/ftl/protos/xyz/block/ftl/v1/ftlv1connect"
)
type callCmd struct {
- Verb sdk.VerbRef `arg:"" required:"" help:"Full path of Verb to call."`
+ Verb ftl.VerbRef `arg:"" required:"" help:"Full path of Verb to call."`
Request string `arg:"" optional:"" help:"JSON5 request payload." default:"{}"`
}
diff --git a/examples/go/echo/echo.go b/examples/go/echo/echo.go
index 659f235254..9a8b47b827 100644
--- a/examples/go/echo/echo.go
+++ b/examples/go/echo/echo.go
@@ -9,12 +9,12 @@ import (
"ftl/time"
- "github.com/TBD54566975/ftl/go-runtime/sdk"
+ "github.com/TBD54566975/ftl/go-runtime/ftl"
)
// An echo request.
type EchoRequest struct {
- Name sdk.Option[string] `json:"name"`
+ Name ftl.Option[string] `json:"name"`
}
type EchoResponse struct {
@@ -26,7 +26,7 @@ type EchoResponse struct {
//ftl:verb
func Echo(ctx context.Context, req EchoRequest) (EchoResponse, error) {
fmt.Println("Echo received a request!")
- tresp, err := sdk.Call(ctx, time.Time, time.TimeRequest{})
+ tresp, err := ftl.Call(ctx, time.Time, time.TimeRequest{})
if err != nil {
return EchoResponse{}, err
}
diff --git a/examples/go/httpingress/httpingress.go b/examples/go/httpingress/httpingress.go
index d5109169e9..22ea515253 100644
--- a/examples/go/httpingress/httpingress.go
+++ b/examples/go/httpingress/httpingress.go
@@ -7,7 +7,7 @@ import (
"ftl/builtin"
- "github.com/TBD54566975/ftl/go-runtime/sdk"
+ "github.com/TBD54566975/ftl/go-runtime/ftl"
)
type GetRequest struct {
@@ -28,10 +28,10 @@ type GetResponse struct {
//
//ftl:verb
//ftl:ingress http GET /http/users/{userID}/posts
-func Get(ctx context.Context, req builtin.HttpRequest[GetRequest]) (builtin.HttpResponse[GetResponse, sdk.Unit], error) {
- return builtin.HttpResponse[GetResponse, sdk.Unit]{
+func Get(ctx context.Context, req builtin.HttpRequest[GetRequest]) (builtin.HttpResponse[GetResponse, ftl.Unit], error) {
+ return builtin.HttpResponse[GetResponse, ftl.Unit]{
Headers: map[string][]string{"Get": {"Header from FTL"}},
- Body: sdk.Some(GetResponse{
+ Body: ftl.Some(GetResponse{
Message: fmt.Sprintf("Got userId %s and postId %s", req.Body.UserID, req.Body.PostID),
Nested: Nested{GoodStuff: "Nested Good Stuff"},
}),
@@ -51,11 +51,11 @@ type PostResponse struct {
//
//ftl:verb
//ftl:ingress http POST /http/users
-func Post(ctx context.Context, req builtin.HttpRequest[PostRequest]) (builtin.HttpResponse[PostResponse, sdk.Unit], error) {
- return builtin.HttpResponse[PostResponse, sdk.Unit]{
+func Post(ctx context.Context, req builtin.HttpRequest[PostRequest]) (builtin.HttpResponse[PostResponse, ftl.Unit], error) {
+ return builtin.HttpResponse[PostResponse, ftl.Unit]{
Status: 201,
Headers: map[string][]string{"Post": {"Header from FTL"}},
- Body: sdk.Some(PostResponse{Success: true}),
+ Body: ftl.Some(PostResponse{Success: true}),
}, nil
}
@@ -70,8 +70,8 @@ type PutResponse struct{}
//
//ftl:verb
//ftl:ingress http PUT /http/users/{userID}
-func Put(ctx context.Context, req builtin.HttpRequest[PutRequest]) (builtin.HttpResponse[PutResponse, sdk.Unit], error) {
- return builtin.HttpResponse[PutResponse, sdk.Unit]{
+func Put(ctx context.Context, req builtin.HttpRequest[PutRequest]) (builtin.HttpResponse[PutResponse, ftl.Unit], error) {
+ return builtin.HttpResponse[PutResponse, ftl.Unit]{
Headers: map[string][]string{"Put": {"Header from FTL"}},
}, nil
}
@@ -86,8 +86,8 @@ type DeleteResponse struct{}
//
//ftl:verb
//ftl:ingress http DELETE /http/users/{userID}
-func Delete(ctx context.Context, req builtin.HttpRequest[DeleteRequest]) (builtin.HttpResponse[DeleteResponse, sdk.Unit], error) {
- return builtin.HttpResponse[DeleteResponse, sdk.Unit]{
+func Delete(ctx context.Context, req builtin.HttpRequest[DeleteRequest]) (builtin.HttpResponse[DeleteResponse, ftl.Unit], error) {
+ return builtin.HttpResponse[DeleteResponse, ftl.Unit]{
Headers: map[string][]string{"Put": {"Header from FTL"}},
}, nil
}
@@ -96,10 +96,10 @@ type HtmlRequest struct{}
//ftl:verb
//ftl:ingress http GET /http/html
-func Html(ctx context.Context, req builtin.HttpRequest[HtmlRequest]) (builtin.HttpResponse[string, sdk.Unit], error) {
- return builtin.HttpResponse[string, sdk.Unit]{
+func Html(ctx context.Context, req builtin.HttpRequest[HtmlRequest]) (builtin.HttpResponse[string, ftl.Unit], error) {
+ return builtin.HttpResponse[string, ftl.Unit]{
Headers: map[string][]string{"Content-Type": {"text/html; charset=utf-8"}},
- Body: sdk.Some("
HTML Page From FTL 🚀!
"),
+ Body: ftl.Some("HTML Page From FTL 🚀!
"),
}, nil
}
@@ -107,9 +107,9 @@ func Html(ctx context.Context, req builtin.HttpRequest[HtmlRequest]) (builtin.Ht
//
//ftl:verb
//ftl:ingress http POST /http/bytes
-func Bytes(ctx context.Context, req builtin.HttpRequest[[]byte]) (builtin.HttpResponse[[]byte, sdk.Unit], error) {
- return builtin.HttpResponse[[]byte, sdk.Unit]{
+func Bytes(ctx context.Context, req builtin.HttpRequest[[]byte]) (builtin.HttpResponse[[]byte, ftl.Unit], error) {
+ return builtin.HttpResponse[[]byte, ftl.Unit]{
Headers: map[string][]string{"Content-Type": {"application/octet-stream"}},
- Body: sdk.Some(req.Body),
+ Body: ftl.Some(req.Body),
}, nil
}
diff --git a/examples/online-boutique/services/checkout/checkout.go b/examples/online-boutique/services/checkout/checkout.go
index 303a922f46..076720f311 100644
--- a/examples/online-boutique/services/checkout/checkout.go
+++ b/examples/online-boutique/services/checkout/checkout.go
@@ -17,7 +17,7 @@ import (
"github.com/TBD54566975/ftl/backend/common/slices"
"github.com/TBD54566975/ftl/examples/online-boutique/common/money"
- ftl "github.com/TBD54566975/ftl/go-runtime/sdk"
+ ftl "github.com/TBD54566975/ftl/go-runtime/ftl"
)
type PlaceOrderRequest struct {
diff --git a/examples/online-boutique/services/recommendation/recommendation.go b/examples/online-boutique/services/recommendation/recommendation.go
index fa5264a074..85d990d8d5 100644
--- a/examples/online-boutique/services/recommendation/recommendation.go
+++ b/examples/online-boutique/services/recommendation/recommendation.go
@@ -9,7 +9,7 @@ import (
"ftl/builtin"
"ftl/productcatalog"
- ftl "github.com/TBD54566975/ftl/go-runtime/sdk"
+ ftl "github.com/TBD54566975/ftl/go-runtime/ftl"
)
type ListRequest struct {
diff --git a/go-runtime/compile/build.go b/go-runtime/compile/build.go
index cd0aa42a16..457b8a6325 100644
--- a/go-runtime/compile/build.go
+++ b/go-runtime/compile/build.go
@@ -175,7 +175,7 @@ var scaffoldFuncs = scaffolder.FuncMap{
imports["time"] = "stdtime"
case *schema.Optional, *schema.Unit:
- imports["github.com/TBD54566975/ftl/go-runtime/sdk"] = ""
+ imports["github.com/TBD54566975/ftl/go-runtime/ftl"] = ""
default:
}
@@ -230,10 +230,10 @@ func genType(module *schema.Module, t schema.Type) string {
return "map[" + genType(module, t.Key) + "]" + genType(module, t.Value)
case *schema.Optional:
- return "sdk.Option[" + genType(module, t.Type) + "]"
+ return "ftl.Option[" + genType(module, t.Type) + "]"
case *schema.Unit:
- return "sdk.Unit"
+ return "ftl.Unit"
case *schema.Any:
return "any"
diff --git a/go-runtime/compile/external-module-template/_ftl/go/modules/{{ range .NonMainModules }}{{ push .Name . }}{{ end }}/external_module.go b/go-runtime/compile/external-module-template/_ftl/go/modules/{{ range .NonMainModules }}{{ push .Name . }}{{ end }}/external_module.go
index 73d017c79a..0ade747c28 100644
--- a/go-runtime/compile/external-module-template/_ftl/go/modules/{{ range .NonMainModules }}{{ push .Name . }}{{ end }}/external_module.go
+++ b/go-runtime/compile/external-module-template/_ftl/go/modules/{{ range .NonMainModules }}{{ push .Name . }}{{ end }}/external_module.go
@@ -30,7 +30,7 @@ type {{.Name|title}}
{{end -}}
//ftl:verb
func {{.Name|title}}(context.Context, {{type $ .Request}}) ({{type $ .Response}}, error) {
- panic("Verb stubs should not be called directly, instead use github.com/TBD54566975/ftl/runtime-go/sdk.Call()")
+ panic("Verb stubs should not be called directly, instead use github.com/TBD54566975/ftl/runtime-go/ftl.Call()")
}
{{- end}}
{{- end}}
diff --git a/go-runtime/compile/schema.go b/go-runtime/compile/schema.go
index c5e04fb7c9..54c7cd5480 100644
--- a/go-runtime/compile/schema.go
+++ b/go-runtime/compile/schema.go
@@ -27,7 +27,7 @@ var (
errorIFaceType = once(func() *types.Interface {
return mustLoadRef("builtin", "error").Type().Underlying().(*types.Interface) //nolint:forcetypeassert
})
- ftlCallFuncPath = "github.com/TBD54566975/ftl/go-runtime/sdk.Call"
+ ftlCallFuncPath = "github.com/TBD54566975/ftl/go-runtime/ftl.Call"
aliasFieldTag = "alias"
)
@@ -462,10 +462,10 @@ func visitType(pctx *parseContext, node ast.Node, tnode types.Type) (schema.Type
case "time.Time":
return &schema.Time{Pos: goPosToSchemaPos(node.Pos())}, nil
- case "github.com/TBD54566975/ftl/go-runtime/sdk.Unit":
+ case "github.com/TBD54566975/ftl/go-runtime/ftl.Unit":
return &schema.Unit{Pos: goPosToSchemaPos(node.Pos())}, nil
- case "github.com/TBD54566975/ftl/go-runtime/sdk.Option":
+ case "github.com/TBD54566975/ftl/go-runtime/ftl.Option":
underlying, err := visitType(pctx, node, named.TypeArgs().At(0))
if err != nil {
return nil, err
diff --git a/go-runtime/compile/testdata/one/one.go b/go-runtime/compile/testdata/one/one.go
index eef34f128e..1138c62585 100644
--- a/go-runtime/compile/testdata/one/one.go
+++ b/go-runtime/compile/testdata/one/one.go
@@ -6,7 +6,7 @@ import (
"time"
"github.com/TBD54566975/ftl/go-runtime/compile/testdata/two"
- "github.com/TBD54566975/ftl/go-runtime/sdk"
+ "github.com/TBD54566975/ftl/go-runtime/ftl"
)
type Nested struct {
@@ -20,7 +20,7 @@ type Req struct {
Slice []string
Map map[string]string
Nested Nested
- Optional sdk.Option[Nested]
+ Optional ftl.Option[Nested]
Time time.Time
User two.User `alias:"u"`
Bytes []byte
diff --git a/go-runtime/compile/testdata/two/two.go b/go-runtime/compile/testdata/two/two.go
index 780f903233..9edc45b76b 100644
--- a/go-runtime/compile/testdata/two/two.go
+++ b/go-runtime/compile/testdata/two/two.go
@@ -4,7 +4,7 @@ package two
import (
"context"
- "github.com/TBD54566975/ftl/go-runtime/sdk"
+ "github.com/TBD54566975/ftl/go-runtime/ftl"
)
type User struct {
@@ -22,5 +22,5 @@ func Two(ctx context.Context, req Payload[string]) (Payload[string], error) {
//ftl:verb
func CallsTwo(ctx context.Context, req Payload[string]) (Payload[string], error) {
- return sdk.Call(ctx, Two, req)
+ return ftl.Call(ctx, Two, req)
}
diff --git a/go-runtime/encoding/encoding_test.go b/go-runtime/encoding/encoding_test.go
index 1276dbd88a..ca29f4b48d 100644
--- a/go-runtime/encoding/encoding_test.go
+++ b/go-runtime/encoding/encoding_test.go
@@ -6,14 +6,14 @@ import (
"github.com/alecthomas/assert/v2"
. "github.com/TBD54566975/ftl/go-runtime/encoding"
- "github.com/TBD54566975/ftl/go-runtime/sdk"
+ "github.com/TBD54566975/ftl/go-runtime/ftl"
)
func TestMarshal(t *testing.T) {
type inner struct {
FooBar string
}
- somePtr := sdk.Some(42)
+ somePtr := ftl.Some(42)
tests := []struct {
name string
input any
@@ -28,9 +28,9 @@ func TestMarshal(t *testing.T) {
{name: "Nil", input: struct{ Nil *int }{nil}, expected: `{"nil":null}`},
{name: "Slice", input: struct{ Slice []int }{[]int{1, 2, 3}}, expected: `{"slice":[1,2,3]}`},
{name: "Map", input: struct{ Map map[string]int }{map[string]int{"foo": 42}}, expected: `{"map":{"foo":42}}`},
- {name: "Option", input: struct{ Option sdk.Option[int] }{sdk.Some(42)}, expected: `{"option":42}`},
- {name: "OptionPtr", input: struct{ Option *sdk.Option[int] }{&somePtr}, expected: `{"option":42}`},
- {name: "OptionStruct", input: struct{ Option sdk.Option[inner] }{sdk.Some(inner{"foo"})}, expected: `{"option":{"fooBar":"foo"}}`},
+ {name: "Option", input: struct{ Option ftl.Option[int] }{ftl.Some(42)}, expected: `{"option":42}`},
+ {name: "OptionPtr", input: struct{ Option *ftl.Option[int] }{&somePtr}, expected: `{"option":42}`},
+ {name: "OptionStruct", input: struct{ Option ftl.Option[inner] }{ftl.Some(inner{"foo"})}, expected: `{"option":{"fooBar":"foo"}}`},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
diff --git a/go-runtime/sdk/call.go b/go-runtime/ftl/call.go
similarity index 99%
rename from go-runtime/sdk/call.go
rename to go-runtime/ftl/call.go
index 5d880c79bf..ce1b4ef0d1 100644
--- a/go-runtime/sdk/call.go
+++ b/go-runtime/ftl/call.go
@@ -1,4 +1,4 @@
-package sdk
+package ftl
import (
"context"
diff --git a/go-runtime/sdk/config.go b/go-runtime/ftl/config.go
similarity index 98%
rename from go-runtime/sdk/config.go
rename to go-runtime/ftl/config.go
index efb49441ac..2773d86c5c 100644
--- a/go-runtime/sdk/config.go
+++ b/go-runtime/ftl/config.go
@@ -1,4 +1,4 @@
-package sdk
+package ftl
import (
"encoding/json"
@@ -49,7 +49,7 @@ func callerModule() string {
panic("failed to get caller")
}
module := details.Name()
- if strings.HasPrefix(module, "github.com/TBD54566975/ftl/go-runtime/sdk") {
+ if strings.HasPrefix(module, "github.com/TBD54566975/ftl/go-runtime/ftl") {
return "testing"
}
if !strings.HasPrefix(module, "ftl/") {
diff --git a/go-runtime/sdk/config_test.go b/go-runtime/ftl/config_test.go
similarity index 95%
rename from go-runtime/sdk/config_test.go
rename to go-runtime/ftl/config_test.go
index ee7a85947c..75b269da88 100644
--- a/go-runtime/sdk/config_test.go
+++ b/go-runtime/ftl/config_test.go
@@ -1,4 +1,4 @@
-package sdk
+package ftl
import (
"testing"
diff --git a/go-runtime/sdk/database.go b/go-runtime/ftl/database.go
similarity index 98%
rename from go-runtime/sdk/database.go
rename to go-runtime/ftl/database.go
index 7713eb815b..efdef16420 100644
--- a/go-runtime/sdk/database.go
+++ b/go-runtime/ftl/database.go
@@ -1,4 +1,4 @@
-package sdk
+package ftl
import (
"database/sql"
diff --git a/go-runtime/sdk/logging.go b/go-runtime/ftl/logging.go
similarity index 96%
rename from go-runtime/sdk/logging.go
rename to go-runtime/ftl/logging.go
index db6aa2d172..e47730885b 100644
--- a/go-runtime/sdk/logging.go
+++ b/go-runtime/ftl/logging.go
@@ -1,4 +1,4 @@
-package sdk
+package ftl
import (
"context"
diff --git a/go-runtime/sdk/observability/metrics.go b/go-runtime/ftl/observability/metrics.go
similarity index 100%
rename from go-runtime/sdk/observability/metrics.go
rename to go-runtime/ftl/observability/metrics.go
diff --git a/go-runtime/sdk/observability/traces.go b/go-runtime/ftl/observability/traces.go
similarity index 100%
rename from go-runtime/sdk/observability/traces.go
rename to go-runtime/ftl/observability/traces.go
diff --git a/go-runtime/sdk/option.go b/go-runtime/ftl/option.go
similarity index 99%
rename from go-runtime/sdk/option.go
rename to go-runtime/ftl/option.go
index 2d81a135b0..99e39fbefe 100644
--- a/go-runtime/sdk/option.go
+++ b/go-runtime/ftl/option.go
@@ -1,5 +1,5 @@
//nolint:wrapcheck
-package sdk
+package ftl
import (
"database/sql"
diff --git a/go-runtime/sdk/option_test.go b/go-runtime/ftl/option_test.go
similarity index 99%
rename from go-runtime/sdk/option_test.go
rename to go-runtime/ftl/option_test.go
index 9d7fad0af5..13b104fc1f 100644
--- a/go-runtime/sdk/option_test.go
+++ b/go-runtime/ftl/option_test.go
@@ -1,4 +1,4 @@
-package sdk
+package ftl
import (
"database/sql"
diff --git a/go-runtime/sdk/secrets.go b/go-runtime/ftl/secrets.go
similarity index 98%
rename from go-runtime/sdk/secrets.go
rename to go-runtime/ftl/secrets.go
index 95bc97aafb..5e1841c7cf 100644
--- a/go-runtime/sdk/secrets.go
+++ b/go-runtime/ftl/secrets.go
@@ -1,4 +1,4 @@
-package sdk
+package ftl
import (
"encoding/json"
diff --git a/go-runtime/sdk/secrets_test.go b/go-runtime/ftl/secrets_test.go
similarity index 95%
rename from go-runtime/sdk/secrets_test.go
rename to go-runtime/ftl/secrets_test.go
index e0671486c1..b012295693 100644
--- a/go-runtime/sdk/secrets_test.go
+++ b/go-runtime/ftl/secrets_test.go
@@ -1,4 +1,4 @@
-package sdk
+package ftl
import (
"testing"
diff --git a/go-runtime/sdk/types.go b/go-runtime/ftl/types.go
similarity index 99%
rename from go-runtime/sdk/types.go
rename to go-runtime/ftl/types.go
index 1cc74f0639..79194e67fd 100644
--- a/go-runtime/sdk/types.go
+++ b/go-runtime/ftl/types.go
@@ -1,4 +1,4 @@
-package sdk
+package ftl
import (
"context"
diff --git a/go-runtime/scaffolding/{{ .Name | camel | lower }}/{{ .Name | camel | lower }}.go.tmpl b/go-runtime/scaffolding/{{ .Name | camel | lower }}/{{ .Name | camel | lower }}.go.tmpl
index 25e8356a29..e82a3c655e 100644
--- a/go-runtime/scaffolding/{{ .Name | camel | lower }}/{{ .Name | camel | lower }}.go.tmpl
+++ b/go-runtime/scaffolding/{{ .Name | camel | lower }}/{{ .Name | camel | lower }}.go.tmpl
@@ -5,7 +5,7 @@ import (
"context"
"fmt"
- ftl "github.com/TBD54566975/ftl/go-runtime/sdk" // Import the FTL SDK.
+ "github.com/TBD54566975/ftl/go-runtime/ftl" // Import the FTL SDK.
)
type EchoRequest struct {
diff --git a/go-runtime/server/server.go b/go-runtime/server/server.go
index 1b52643dd1..17611e08c1 100644
--- a/go-runtime/server/server.go
+++ b/go-runtime/server/server.go
@@ -15,7 +15,7 @@ import (
"github.com/TBD54566975/ftl/backend/common/plugin"
"github.com/TBD54566975/ftl/backend/common/rpc"
"github.com/TBD54566975/ftl/go-runtime/encoding"
- sdkgo "github.com/TBD54566975/ftl/go-runtime/sdk"
+ sdkgo "github.com/TBD54566975/ftl/go-runtime/ftl"
ftlv1 "github.com/TBD54566975/ftl/protos/xyz/block/ftl/v1"
"github.com/TBD54566975/ftl/protos/xyz/block/ftl/v1/ftlv1connect"
)
diff --git a/integration/testdata/go/database/echo.go b/integration/testdata/go/database/echo.go
index 43c297da06..86df85e7c4 100644
--- a/integration/testdata/go/database/echo.go
+++ b/integration/testdata/go/database/echo.go
@@ -4,7 +4,7 @@ package echo
import (
"context"
- ftl "github.com/TBD54566975/ftl/go-runtime/sdk" // Import the FTL SDK.
+ "github.com/TBD54566975/ftl/go-runtime/ftl" // Import the FTL SDK.
)
var db = ftl.PostgresDatabase("testdb")
diff --git a/integration/testdata/go/externalcalls/echo.go b/integration/testdata/go/externalcalls/echo.go
index b335fd108d..16371480a4 100644
--- a/integration/testdata/go/externalcalls/echo.go
+++ b/integration/testdata/go/externalcalls/echo.go
@@ -6,7 +6,8 @@ import (
"fmt"
"ftl/echo2"
- ftl "github.com/TBD54566975/ftl/go-runtime/sdk" // Import the FTL SDK.
+
+ "github.com/TBD54566975/ftl/go-runtime/ftl" // Import the FTL SDK.
)
type EchoRequest struct {
diff --git a/integration/testdata/go/httpingress/echo.go b/integration/testdata/go/httpingress/echo.go
index 63c9a6ef13..dc1092837f 100644
--- a/integration/testdata/go/httpingress/echo.go
+++ b/integration/testdata/go/httpingress/echo.go
@@ -7,7 +7,7 @@ import (
"ftl/builtin"
- ftl "github.com/TBD54566975/ftl/go-runtime/sdk" // Import the FTL SDK.
+ "github.com/TBD54566975/ftl/go-runtime/ftl" // Import the FTL SDK.
)
type GetRequest struct {