CommunityToolkit.Aspire.GoFeatureFlag 9.1.1-beta.169

Prefix Reserved
This is a prerelease version of CommunityToolkit.Aspire.GoFeatureFlag.
dotnet add package CommunityToolkit.Aspire.GoFeatureFlag --version 9.1.1-beta.169                
NuGet\Install-Package CommunityToolkit.Aspire.GoFeatureFlag -Version 9.1.1-beta.169                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CommunityToolkit.Aspire.GoFeatureFlag" Version="9.1.1-beta.169" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CommunityToolkit.Aspire.GoFeatureFlag --version 9.1.1-beta.169                
#r "nuget: CommunityToolkit.Aspire.GoFeatureFlag, 9.1.1-beta.169"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install CommunityToolkit.Aspire.GoFeatureFlag as a Cake Addin
#addin nuget:?package=CommunityToolkit.Aspire.GoFeatureFlag&version=9.1.1-beta.169&prerelease

// Install CommunityToolkit.Aspire.GoFeatureFlag as a Cake Tool
#tool nuget:?package=CommunityToolkit.Aspire.GoFeatureFlag&version=9.1.1-beta.169&prerelease                

CommunityToolkit.Aspire.GoFeatureFlag

Registers a GoFeatureFlagProvider in the DI container for connecting to a GO Feature Flag instance.

Getting started

Install the package

Install the .NET Aspire GO Feature Flag Client library with NuGet:

dotnet add package CommunityToolkit.Aspire.GoFeatureFlag

Usage example

In the Program.cs file of your 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("goff");

Configuration

The .NET Aspire GO Feature Flag Client integration provides multiple options to configure the server connection based on the requirements and conventions of your project.

Use a connection string

When using a connection string from the ConnectionStrings configuration section, you can provide the name of the connection string when calling builder.AddGoFeatureFlagClient():

builder.AddGoFeatureFlagClient("goff");

And then the connection string will be retrieved from the ConnectionStrings configuration section:

{
    "ConnectionStrings": {
        "goff": "Endpoint=http://localhost:19530/"
    }
}

Use configuration providers

The .NET Aspire GO Feature Flag Client integration supports Microsoft.Extensions.Configuration. It loads the GoFeatureFlagClientSettings from configuration by using the Aspire:GoFeatureFlag:Client key. Example appsettings.json that configures some of the options:

{
    "Aspire": {
        "GoFeatureFlag": {
            "Client": {
                "Endpoint": "http://localhost:19530/",
                "MasterKey": "123456!@#$%"
            }
        }
    }
}

Use inline delegates

Also you can pass the Action<GoFeatureFlagClientSettings> configureSettings delegate to set up some or all the options inline, for example to set the API key from code:

builder.AddGoFeatureFlagClient("goff", settings => settings.ProviderOptions.ApiKey = "123456!@#$%");

AppHost extensions

In your AppHost project, install the CommunityToolkit.Aspire.Hosting.GoFeatureFlag library with NuGet:

dotnet add package CommunityToolkit.Aspire.Hosting.GoFeatureFlag

Then, in the Program.cs file of AppHost, register a GO Feature Flag instance and consume the connection using the following methods:

var goff = builder.AddGoFeatureFlag("goff");

var myService = builder.AddProject<Projects.MyService>()
                       .WithReference(goff);

The WithReference method configures a connection in the MyService project named goff. In the Program.cs file of MyService, the GO Feature Flag connection can be consumed using:

builder.AddGoFeatureFlagClient("goff");

Then, in your service, inject GoFeatureFlagProvider and use it to interact with the GO Feature Flag API:

public class MyService(GoFeatureFlagProvider goFeatureFlagProvider)
{
    // ...
}

Additional documentation

Feedback & contributing

https://github.com/CommunityToolkit/Aspire

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
9.1.1-beta.169 30 2/6/2025
9.1.1-beta.168 29 2/5/2025