GO Feature Flag Client integration reference
Bu içerik henüz dilinizde mevcut değil.
To get started with the Aspire GO Feature Flag integrations, follow the Get started with GO Feature Flag integrations guide.
This article includes full details about the Aspire GO Feature Flag Client integration.
Installation
Section titled “Installation”To access the types and APIs for the GO Feature Flag client integration, install the 📦 CommunityToolkit.Aspire.GoFeatureFlag NuGet package in the client-consuming project:
dotnet add package CommunityToolkit.Aspire.GoFeatureFlag#:package CommunityToolkit.Aspire.GoFeatureFlag@*<PackageReference Include="CommunityToolkit.Aspire.GoFeatureFlag" Version="*" />Add GO Feature Flag client
Section titled “Add GO Feature Flag client”In the Program.cs file of your client-consuming project, call the AddGoFeatureFlagClient extension method to register a GoFeatureFlagProvider for use via the dependency injection container. The method takes a connection name parameter.
builder.AddGoFeatureFlagClient(connectionName: "goff");You can then retrieve the GoFeatureFlagProvider instance using dependency injection:
public class ExampleService(GoFeatureFlagProvider provider){ // Use provider...}Add keyed GO Feature Flag client
Section titled “Add keyed GO Feature Flag client”There might be situations where you want to register multiple GoFeatureFlagProvider instances with different connection names. To register keyed goff clients, call the AddKeyedGoFeatureFlagClient method:
builder.AddKeyedGoFeatureFlagClient(name: "technical");builder.AddKeyedGoFeatureFlagClient(name: "business");Then you can retrieve the GoFeatureFlagProvider instances using dependency injection:
public class ExampleService( [FromKeyedServices("technical")] GoFeatureFlagProvider technicalProvider, [FromKeyedServices("business")] GoFeatureFlagProvider businessProvider){ // Use providers...}Client integration health checks
Section titled “Client integration health checks”The Aspire goff integration uses the configured client to perform a health check.