Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make ftl build et al work with Go #775

Merged
merged 2 commits into from
Jan 14, 2024
Merged

feat: make ftl build et al work with Go #775

merged 2 commits into from
Jan 14, 2024

Conversation

alecthomas
Copy link
Collaborator

  • ftl-go has been deleted.
  • There must be a 1:1 mapping between FTL modules and Go modules.
  • Updated ftl init go to generate a valid module.
  • Updated all of the Go examples, including online-boutique, which can now be trivially started with ftl dev ./examples/online-boutique
  • The tooling is quite restrictive about code layout at the moment, but we can come back to that later.

eg. Create, deploy and call a new module.

🐚 ~/dev/ftl $ ftl init go examples echo2
info: Initializing FTL Go module echo2 in examples
info: Running go mod tidy
🐚 ~/dev/ftl $ ftl deploy examples/echo2
info: Creating deployment for module echo2
info: Building Go module 'echo2'
info: Generating external modules
info: Extracting schema
info: Generating main module
info: Compiling
info: Uploading 1/1 files
info: Uploaded examples/echo2/_ftl/main as ba6f7f20ee5dac4e97197633348b5bb41e68e63c7e2d9b1da614d0a011b83872:main
info: Created deployment echo2-0a1cebbfcc
🐚 ~/dev/ftl $ ftl call echo2.echo
{"message":"Hello, anonymous!"}

- `ftl-go` has been deleted.
- There must be a 1:1 mapping between FTL modules and Go modules.
- Updated `ftl init go` to generate a valid module.
- Updated all of the Go examples, including online-boutique, which can
  now be trivially started with `ftl dev ./examples/online-boutique`
- The tooling is quite restrictive about code layout at the moment, but
  we can come back to that later.

eg. Create, deploy and call a new module.

```
🐚 ~/dev/ftl $ ftl init go examples echo2
info: Initializing FTL Go module echo2 in examples
info: Running go mod tidy
🐚 ~/dev/ftl $ ftl deploy examples/echo2
info: Creating deployment for module echo2
info: Building Go module 'echo2'
info: Generating external modules
info: Extracting schema
info: Generating main module
info: Compiling
info: Uploading 1/1 files
info: Uploaded examples/echo2/_ftl/main as ba6f7f20ee5dac4e97197633348b5bb41e68e63c7e2d9b1da614d0a011b83872:main
info: Created deployment echo2-0a1cebbfcc
🐚 ~/dev/ftl $ ftl call echo2.echo
{"message":"Hello, anonymous!"}
```
@alecthomas alecthomas changed the title feat: make ftl build work with Go feat: make ftl build et al work with Go Jan 14, 2024
@alecthomas alecthomas merged commit 7b477b1 into main Jan 14, 2024
@alecthomas alecthomas deleted the aat/go-scaffolder branch January 14, 2024 08:39
alecthomas added a commit that referenced this pull request Jan 14, 2024
- `ftl-go` has been deleted.
- There must be a 1:1 mapping between FTL modules and Go modules.
- Updated `ftl init go` to generate a valid module.
- Updated all of the Go examples, including online-boutique, which can
now be trivially started with `ftl dev ./examples/online-boutique`
- The tooling is quite restrictive about code layout at the moment, but
we can come back to that later.

eg. Create, deploy and call a new module.

```
🐚 ~/dev/ftl $ ftl init go examples echo2
info: Initializing FTL Go module echo2 in examples
info: Running go mod tidy
🐚 ~/dev/ftl $ ftl deploy examples/echo2
info: Creating deployment for module echo2
info: Building Go module 'echo2'
info: Generating external modules
info: Extracting schema
info: Generating main module
info: Compiling
info: Uploading 1/1 files
info: Uploaded examples/echo2/_ftl/main as ba6f7f20ee5dac4e97197633348b5bb41e68e63c7e2d9b1da614d0a011b83872:main
info: Created deployment echo2-0a1cebbfcc
🐚 ~/dev/ftl $ ftl call echo2.echo
{"message":"Hello, anonymous!"}
```

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
alecthomas added a commit that referenced this pull request Jan 14, 2024
- `ftl-go` has been deleted.
- There must be a 1:1 mapping between FTL modules and Go modules.
- Updated `ftl init go` to generate a valid module.
- Updated all of the Go examples, including online-boutique, which can
now be trivially started with `ftl dev ./examples/online-boutique`
- The tooling is quite restrictive about code layout at the moment, but
we can come back to that later.

eg. Create, deploy and call a new module.

```
🐚 ~/dev/ftl $ ftl init go examples echo2
info: Initializing FTL Go module echo2 in examples
info: Running go mod tidy
🐚 ~/dev/ftl $ ftl deploy examples/echo2
info: Creating deployment for module echo2
info: Building Go module 'echo2'
info: Generating external modules
info: Extracting schema
info: Generating main module
info: Compiling
info: Uploading 1/1 files
info: Uploaded examples/echo2/_ftl/main as ba6f7f20ee5dac4e97197633348b5bb41e68e63c7e2d9b1da614d0a011b83872:main
info: Created deployment echo2-0a1cebbfcc
🐚 ~/dev/ftl $ ftl call echo2.echo
{"message":"Hello, anonymous!"}
```

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
alecthomas added a commit that referenced this pull request Jan 14, 2024
- `ftl-go` has been deleted.
- There must be a 1:1 mapping between FTL modules and Go modules.
- Updated `ftl init go` to generate a valid module.
- Updated all of the Go examples, including online-boutique, which can
now be trivially started with `ftl dev ./examples/online-boutique`
- The tooling is quite restrictive about code layout at the moment, but
we can come back to that later.

eg. Create, deploy and call a new module.

```
🐚 ~/dev/ftl $ ftl init go examples echo2
info: Initializing FTL Go module echo2 in examples
info: Running go mod tidy
🐚 ~/dev/ftl $ ftl deploy examples/echo2
info: Creating deployment for module echo2
info: Building Go module 'echo2'
info: Generating external modules
info: Extracting schema
info: Generating main module
info: Compiling
info: Uploading 1/1 files
info: Uploaded examples/echo2/_ftl/main as ba6f7f20ee5dac4e97197633348b5bb41e68e63c7e2d9b1da614d0a011b83872:main
info: Created deployment echo2-0a1cebbfcc
🐚 ~/dev/ftl $ ftl call echo2.echo
{"message":"Hello, anonymous!"}
```

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
alecthomas added a commit that referenced this pull request Jan 14, 2024
- `ftl-go` has been deleted.
- There must be a 1:1 mapping between FTL modules and Go modules.
- Updated `ftl init go` to generate a valid module.
- Updated all of the Go examples, including online-boutique, which can
now be trivially started with `ftl dev ./examples/online-boutique`
- The tooling is quite restrictive about code layout at the moment, but
we can come back to that later.

eg. Create, deploy and call a new module.

```
🐚 ~/dev/ftl $ ftl init go examples echo2
info: Initializing FTL Go module echo2 in examples
info: Running go mod tidy
🐚 ~/dev/ftl $ ftl deploy examples/echo2
info: Creating deployment for module echo2
info: Building Go module 'echo2'
info: Generating external modules
info: Extracting schema
info: Generating main module
info: Compiling
info: Uploading 1/1 files
info: Uploaded examples/echo2/_ftl/main as ba6f7f20ee5dac4e97197633348b5bb41e68e63c7e2d9b1da614d0a011b83872:main
info: Created deployment echo2-0a1cebbfcc
🐚 ~/dev/ftl $ ftl call echo2.echo
{"message":"Hello, anonymous!"}
```

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant