Skip to content

Commit

Permalink
fix: rename go-runtime/sdk to go-runtime/ftl
Browse files Browse the repository at this point in the history
Fixes #907
  • Loading branch information
alecthomas committed Feb 12, 2024
1 parent 5207057 commit 9defc32
Show file tree
Hide file tree
Showing 27 changed files with 21 additions and 19 deletions.
2 changes: 1 addition & 1 deletion cmd/ftl/cmd_call.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/titanous/json5"

"github.com/TBD54566975/ftl/backend/common/log"
"github.com/TBD54566975/ftl/go-runtime/sdk"
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"
)
Expand Down
2 changes: 1 addition & 1 deletion examples/go/echo/echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"ftl/time"

"github.com/TBD54566975/ftl/go-runtime/sdk"
"github.com/TBD54566975/ftl/go-runtime/ftl"
)

// An echo request.
Expand Down
2 changes: 1 addition & 1 deletion examples/go/httpingress/httpingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"ftl/builtin"

"github.com/TBD54566975/ftl/go-runtime/sdk"
"github.com/TBD54566975/ftl/go-runtime/ftl"
)

type GetRequest struct {
Expand Down
2 changes: 1 addition & 1 deletion examples/online-boutique/services/checkout/checkout.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 3 additions & 2 deletions go-runtime/compile/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ import (
"reflect"
"strings"

"github.com/TBD54566975/scaffolder"
"golang.org/x/mod/modfile"
"google.golang.org/protobuf/proto"

"github.com/TBD54566975/scaffolder"

"github.com/TBD54566975/ftl"
"github.com/TBD54566975/ftl/backend/common/exec"
"github.com/TBD54566975/ftl/backend/common/log"
Expand Down Expand Up @@ -175,7 +176,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:
}
Expand Down
6 changes: 3 additions & 3 deletions go-runtime/compile/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion go-runtime/compile/testdata/one/one.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"time"

"github.com/TBD54566975/ftl/go-runtime/compile/testdata/two"
"github.com/TBD54566975/ftl/go-runtime/sdk"
sdk "github.com/TBD54566975/ftl/go-runtime/ftl"
)

type Nested struct {
Expand Down
2 changes: 1 addition & 1 deletion go-runtime/compile/testdata/two/two.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package two
import (
"context"

"github.com/TBD54566975/ftl/go-runtime/sdk"
sdk "github.com/TBD54566975/ftl/go-runtime/ftl"
)

type User struct {
Expand Down
2 changes: 1 addition & 1 deletion go-runtime/encoding/encoding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/alecthomas/assert/v2"

. "github.com/TBD54566975/ftl/go-runtime/encoding"
"github.com/TBD54566975/ftl/go-runtime/sdk"
sdk "github.com/TBD54566975/ftl/go-runtime/ftl"
)

func TestMarshal(t *testing.T) {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion go-runtime/sdk/config.go → go-runtime/ftl/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/") {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"context"
"fmt"

ftl "github.com/TBD54566975/ftl/go-runtime/sdk" // Import the FTL SDK.
ftl "github.com/TBD54566975/ftl/go-runtime/ftl" // Import the FTL SDK.
)

type EchoRequest struct {
Expand Down
2 changes: 1 addition & 1 deletion go-runtime/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion integration/testdata/go/database/echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package echo
import (
"context"

ftl "github.com/TBD54566975/ftl/go-runtime/sdk" // Import the FTL SDK.
ftl "github.com/TBD54566975/ftl/go-runtime/ftl" // Import the FTL SDK.
)

var db = ftl.PostgresDatabase("testdb")
Expand Down
3 changes: 2 additions & 1 deletion integration/testdata/go/externalcalls/echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import (
"fmt"

"ftl/echo2"
ftl "github.com/TBD54566975/ftl/go-runtime/sdk" // Import the FTL SDK.

ftl "github.com/TBD54566975/ftl/go-runtime/ftl" // Import the FTL SDK.
)

type EchoRequest struct {
Expand Down
2 changes: 1 addition & 1 deletion integration/testdata/go/httpingress/echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"ftl/builtin"

ftl "github.com/TBD54566975/ftl/go-runtime/sdk" // Import the FTL SDK.
ftl "github.com/TBD54566975/ftl/go-runtime/ftl" // Import the FTL SDK.
)

type GetRequest struct {
Expand Down

0 comments on commit 9defc32

Please sign in to comment.