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: Expressions anywhere in the configuration #930

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Feb 6, 2024

  1. feat(config): process expressions in config data before unmarshalling

    This commit introduces the ability to preprocess configuration data to evaluate expressions contained within it before the data is unmarshalled into Go structures. It leverages a new function, `ProcessConfig`, from the `expr` package, which searches for and evaluates expressions denoted by `${{...}}` syntax.
    
    Additionally, this commit includes comprehensive tests for both the `LoadConfig` function and the newly added `processConfig` logic to ensure that expressions are correctly evaluated and that the configuration loading behaves as expected, even when faced with invalid configurations or expressions.
    
    The ability to preprocess and evaluate expressions within the configuration could simplify dynamic configuration scenarios and reduce the need for external templating tools.
    skrashevich committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    988d83c View commit details
    Browse the repository at this point in the history