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: dynamic config struct #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

feat: dynamic config struct #4

wants to merge 1 commit into from

Conversation

tore-statsig
Copy link
Contributor

Adds a struct representing a DynamicConfig. DynamicConfig is typically a class returned by the getConfig and getExperiment methods, which has some accessor methods for metadata and convenience methods for getting values from your config.

For now, ive just included metadata and the value

Bonus - this adds support for groupName, and passes the test for consistency with other server sdks:

 PASS  ../__tests__/common-rulesets-based/dynamic-config-group-name.test.ts
  Dynamic Config Group Name
    Elixir
      ✓ getConfig + Passes Targeting = null (2 ms)
      ✓ getConfig + default = null (1 ms)
      ✓ getExperiment + In Control Group = Control (1 ms)
      ✓ getExperiment + In Control Group = Test (1 ms)
      ✓ getExperiment + In Control Group = Test2
      ✓ getExperiment + Fail Targeting = null (1 ms)
      ✓ getExperiment + Not Allocated = null (1 ms)

secondary_exposures: []
]

def new(config_name, value \\ %{}, rule_id \\ "", group_name \\ nil, id_type \\ nil, secondary_exposures \\ []) do
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are too many default params here.

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.

2 participants