コンテンツにスキップ

Get started with the GO Feature Flag integrations

このコンテンツはまだ日本語訳がありません。

⭐ Community Toolkit goff logo

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.

To begin, install the Aspire GO Feature Flag hosting integration in your Aspire AppHost project:

Aspire CLI — CommunityToolkit.Aspire.Hosting.GoFeatureFlag パッケージを追加
aspire add communitytoolkit-gofeatureflag

Aspire CLI は対話的です。求められたら適切な結果を選択してください:

Aspire CLI — 出力例
Select an integration to add:
> communitytoolkit-gofeatureflag (CommunityToolkit.Aspire.Hosting.GoFeatureFlag)
> Other results listed as selectable options...

In your app host project, call AddGoFeatureFlag on the builder instance to add a goff container resource:

C# — AppHost.cs
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.

Next, install the Aspire GO Feature Flag client integration in your client-consuming project:

.NET CLI — Add CommunityToolkit.Aspire.GoFeatureFlag package
dotnet add package CommunityToolkit.Aspire.GoFeatureFlag

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.