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

Discuss: ftl.Config and ftl.Secret could be declared with non-FTL types #1293

Closed
matt2e opened this issue Apr 17, 2024 · 1 comment
Closed
Labels
duplicate This issue or pull request already exists

Comments

@matt2e
Copy link
Collaborator

matt2e commented Apr 17, 2024

Currently when defining config and secrets, only ftl types are allowed. eg:

var complexSecret = ftl.Secret[map[string]any]("custom_secret")

Every time they declare things like this, they'll also need to add a helper function which reads this generally typed value and parses it into their custom type (eg: CustomSecretType)

We should discuss if we want to allow this:

var complexSecret = ftl.Secret[CustomSecretType]("custom_secret")

When called within the module, it would return the custom struct.
Everywhere else it will be returned as map[string]any

@github-actions github-actions bot added the triage Issue needs triaging label Apr 17, 2024
@alecthomas
Copy link
Collaborator

Hey @matt2e I forgot you were writing this up, but I created #1296 with more detail so I'll close this one. Apologies!

@alecthomas alecthomas closed this as not planned Won't fix, can't repro, duplicate, stale Apr 18, 2024
@alecthomas alecthomas added duplicate This issue or pull request already exists and removed triage Issue needs triaging labels Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants