-
Notifications
You must be signed in to change notification settings - Fork 8
Enhanced feature flags #73
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
Open
linglingye001
wants to merge
7
commits into
release/v1.7.0-preview
Choose a base branch
from
linglingye/enhanced-ff
base: release/v1.7.0-preview
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8c499a9
enhanced feature flags
linglingye001 7f638e6
update conditional request
linglingye001 56bd640
resolve comments
linglingye001 215ff28
fix race
linglingye001 6fc4340
Merge branch 'release/v1.7.0-preview' of https://github.com/Azure/App…
linglingye001 89ac55b
update enhanced ff filter parameter/variant value handling
linglingye001 78d0330
resolve comment
linglingye001 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| package azureappconfiguration | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
| "github.com/Azure/azure-sdk-for-go/sdk/azcore" | ||
| "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" | ||
| "github.com/Azure/azure-sdk-for-go/sdk/data/azappconfig/v2" | ||
| ) | ||
|
|
||
| // appConfigClient abstracts the Azure App Configuration operations used by the provider. | ||
| type appConfigClient interface { | ||
| // Key-value operations. | ||
| NewListSettingsPager(selector azappconfig.SettingSelector, options *azappconfig.ListSettingsOptions) *runtime.Pager[azappconfig.ListSettingsPageResponse] | ||
| GetSetting(ctx context.Context, key string, options *azappconfig.GetSettingOptions) (azappconfig.GetSettingResponse, error) | ||
| GetSnapshot(ctx context.Context, snapshotName string, options *azappconfig.GetSnapshotOptions) (azappconfig.GetSnapshotResponse, error) | ||
| NewListSettingsForSnapshotPager(snapshotName string, options *azappconfig.ListSettingsForSnapshotOptions) *runtime.Pager[azappconfig.ListSettingsForSnapshotResponse] | ||
|
|
||
| // Enhanced feature flag operations. | ||
| NewListFeatureFlagsPager(selector azappconfig.FeatureFlagSelector, options *azappconfig.ListFeatureFlagsOptions) *runtime.Pager[azappconfig.ListFeatureFlagsPageResponse] | ||
| } | ||
|
|
||
| // appConfigurationClient is the default appConfigClient implementation. | ||
| // The feature flag client is derived from the configuration client so both share the same pipeline and sync-token cache. | ||
| type appConfigurationClient struct { | ||
| configurationClient *azappconfig.Client | ||
| featureFlagClient *azappconfig.FeatureFlagClient | ||
| } | ||
|
|
||
| func newAppConfigurationClient(endpoint string, credential azcore.TokenCredential, options *azappconfig.ClientOptions) (appConfigClient, error) { | ||
| configurationClient, err := azappconfig.NewClient(endpoint, credential, options) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
|
|
||
| return &appConfigurationClient{ | ||
| configurationClient: configurationClient, | ||
| featureFlagClient: configurationClient.NewFeatureFlagClient(), | ||
| }, nil | ||
| } | ||
|
|
||
| func newAppConfigurationClientFromConnectionString(connectionString string, options *azappconfig.ClientOptions) (appConfigClient, error) { | ||
| configurationClient, err := azappconfig.NewClientFromConnectionString(connectionString, options) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
|
|
||
| return &appConfigurationClient{ | ||
| configurationClient: configurationClient, | ||
| featureFlagClient: configurationClient.NewFeatureFlagClient(), | ||
| }, nil | ||
| } | ||
|
|
||
| func (c *appConfigurationClient) NewListSettingsPager(selector azappconfig.SettingSelector, options *azappconfig.ListSettingsOptions) *runtime.Pager[azappconfig.ListSettingsPageResponse] { | ||
| return c.configurationClient.NewListSettingsPager(selector, options) | ||
| } | ||
|
|
||
| func (c *appConfigurationClient) GetSetting(ctx context.Context, key string, options *azappconfig.GetSettingOptions) (azappconfig.GetSettingResponse, error) { | ||
| return c.configurationClient.GetSetting(ctx, key, options) | ||
| } | ||
|
|
||
| func (c *appConfigurationClient) GetSnapshot(ctx context.Context, snapshotName string, options *azappconfig.GetSnapshotOptions) (azappconfig.GetSnapshotResponse, error) { | ||
| return c.configurationClient.GetSnapshot(ctx, snapshotName, options) | ||
| } | ||
|
|
||
| func (c *appConfigurationClient) NewListSettingsForSnapshotPager(snapshotName string, options *azappconfig.ListSettingsForSnapshotOptions) *runtime.Pager[azappconfig.ListSettingsForSnapshotResponse] { | ||
| return c.configurationClient.NewListSettingsForSnapshotPager(snapshotName, options) | ||
| } | ||
|
|
||
| func (c *appConfigurationClient) NewListFeatureFlagsPager(selector azappconfig.FeatureFlagSelector, options *azappconfig.ListFeatureFlagsOptions) *runtime.Pager[azappconfig.ListFeatureFlagsPageResponse] { | ||
| return c.featureFlagClient.NewListFeatureFlagsPager(selector, options) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.