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

Configuration: Allow customizing through functional opts #2425

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alvaroaleman
Copy link

Currently, any customization to the default config is very very awkward to do:

cfg := datadog.DefaultConfiguration()
cfg.Debug = true

client := datadog.NewAPIClient(cfg)

with this change, functional opts can be used to simplify that:

client := datadog.NewAPIClient(datadog.DefaultConfiguration(func(cfg *datadog.Configuration){
    cfg.Debug = true
}))

What does this PR do?

Additional Notes

Review checklist

Please check relevant items below:

  • This PR includes all newly recorded cassettes for any modified tests.

  • This PR does not rely on API client schema changes.

    • The CI should be fully passing.
  • Or, this PR relies on API schema changes and this is a Draft PR to include tests for that new functionality.

    • Note: CI shouldn't be run on this Draft PR, as its expected to fail without the corresponding schema changes.

Currently, any customization to the default config is very very awkward
to do:
```
cfg := datadog.DefaultConfiguration()
cfg.Debug = true

client := datadog.NewAPIClient(cfg)
```

with this change, functional opts can be used to simplify that:
```
client := datadog.NewAPIClient(datadog.DefaultConfiguration(func(cfg *datadog.Configuration){
    cfg.Debug = true
}))
```
@alvaroaleman alvaroaleman requested a review from a team as a code owner March 12, 2024 18:25
@alvaroaleman
Copy link
Author

@HantingZhang2 @nkzou any chance you could have a look, please?

Copy link

github-actions bot commented May 9, 2024

This issue has been automatically marked as stale because it has not had activity in the last 30 days.
Note that the issue will not be automatically closed, but this notification will remind us to investigate why there's been inactivity.

@github-actions github-actions bot added the stale Stale - Bot reminder label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Stale - Bot reminder
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant