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

New config primitive for handling VRL / primitive values? 🤔 #222

Closed
dotansimha opened this issue Dec 25, 2023 · 0 comments · Fixed by #439
Closed

New config primitive for handling VRL / primitive values? 🤔 #222

dotansimha opened this issue Dec 25, 2023 · 0 comments · Fixed by #439
Assignees

Comments

@dotansimha
Copy link
Member

We can do something like that:

enum ConfigCondition<Context, Alternative> {
  Primitive(Alternative),
  Condition(Context)
}

struct SomeConfig {
   do_something: Option<ConfigCondition<ConditionContext, bool>>
}

In this way we can easily enable configurations like the following:

do_something: true
do_something: false # pass primitive value
do_something: "%request.headers.some-header" == "my-value"    # Context will represent the available data on %
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 a pull request may close this issue.

1 participant