Get started with the GO Feature Flag integrations
Questi contenuti non sono ancora disponibili nella tua lingua.
Feature flags let you modify system behavior without changing code. Deploy every day, release when you are ready. Reduce risk by releasing your features progressively.
- GO Feature Flag believes in simplicity and offers a simple and lightweight solution to use feature flags.
- Target individual segments, users, and development environments, use advanced rollout functionality.
- 100% Opensource, no vendor locking, supports your favorite languages and is pushing for standardisation with the support of OpenFeature.
In this introduction, you’ll see how to install and use the Aspire GO Feature Flag integrations in a simple configuration. If you already have this knowledge, see GO Feature Flag hosting integration for full reference details.
Set up hosting integration
Section titled “Set up hosting integration”To begin, install the Aspire GO Feature Flag hosting integration in your Aspire AppHost project:
aspire add communitytoolkit-gofeatureflagLa CLI Aspire è interattiva; seleziona il risultato corretto quando richiesto:
Select an integration to add:
> communitytoolkit-gofeatureflag (CommunityToolkit.Aspire.Hosting.GoFeatureFlag)> Other results listed as selectable options...#:package CommunityToolkit.Aspire.Hosting.GoFeatureFlag@*<PackageReference Include="CommunityToolkit.Aspire.Hosting.GoFeatureFlag" Version="*" />In your app host project, call AddGoFeatureFlag on the builder instance to add a goff container resource:
var builder = DistributedApplication.CreateBuilder(args);
var goff = builder.AddGoFeatureFlag("goff") .WithGoffBindMount("./goff");
builder.AddProject<Projects.ExampleProject>() .WithReference(goff);
// After adding all resources, run the app...goff uses either the YAML, JSON or TOML format to configure feature flags. The WithGoffBindMount method mounts a local folder into the container where goff reads its flag configuration files.
Set up client integration
Section titled “Set up client integration”Next, install the Aspire GO Feature Flag client integration in your client-consuming project:
dotnet add package CommunityToolkit.Aspire.GoFeatureFlag#:package CommunityToolkit.Aspire.GoFeatureFlag@*<PackageReference Include="CommunityToolkit.Aspire.GoFeatureFlag" Version="*" />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:
builder.AddGoFeatureFlagClient(connectionName: "goff");You can then retrieve the GoFeatureFlagProvider instance using dependency injection. For example, to retrieve the provider from a service:
public class ExampleService(GoFeatureFlagProvider provider){ // Use provider...}For full reference details, see GO Feature Flag hosting integration and GO Feature Flag client integration.