Skip to content
Docs Try Aspire

GoFeatureFlagBuilderExtensions Methods

Class Methods 4 members
Provides extension methods for adding GO Feature Flag resources to the application model.
AddGoFeatureFlag(IDistributedApplicationBuilder, string, string?, int?) Section titled AddGoFeatureFlag(IDistributedApplicationBuilder, string, string?, int?) extension IResourceBuilder<GoFeatureFlagResource>
Adds an GO Feature Flag container resource to the application model. The default image is and the tag is .
public static class GoFeatureFlagBuilderExtensions
{
public static IResourceBuilder<GoFeatureFlagResource> AddGoFeatureFlag(
this IDistributedApplicationBuilder builder,
string name,
string? pathToConfigFile = null,
int? port = null)
{
// ...
}
}
builder IDistributedApplicationBuilder The Hosting.IDistributedApplicationBuilder.
name string The name of the resource. This name will be used as the connection string name when referenced in a dependency.
pathToConfigFile string? optional The path set to find the configuration file (https://gofeatureflag.org/docs/relay-proxy/configure-relay-proxy#configuration-file).
port int? optional The host port to bind the underlying container to.
IResourceBuilder<GoFeatureFlagResource> A reference to the ApplicationModel.IResourceBuilder`1.
Add an GO Feature Flag container to the application model and reference it in a .NET project.
var builder = DistributedApplication.CreateBuilder(args);
var goff = builder.AddGoFeatureFlag("goff");
var api = builder.AddProject<Projects.Api>("api")
.WithReference(goff);
builder.Build().Run();
WithDataVolume(IResourceBuilder<GoFeatureFlagResource>, string?) Section titled WithDataVolume(IResourceBuilder<GoFeatureFlagResource>, string?) extension IResourceBuilder<GoFeatureFlagResource>
Adds a named volume for the data folder to a GO Feature flag container resource.
public static class GoFeatureFlagBuilderExtensions
{
public static IResourceBuilder<GoFeatureFlagResource> WithDataVolume(
this IResourceBuilder<GoFeatureFlagResource> builder,
string? name = null)
{
// ...
}
}
builder IResourceBuilder<GoFeatureFlagResource> The resource builder.
name string? optional The name of the volume. Defaults to an auto-generated name based on the application and resource names.
IResourceBuilder<GoFeatureFlagResource> The ApplicationModel.IResourceBuilder`1.
Add a GO Feature flag container to the application model and reference it in a .NET project. Additionally, in this example a data volume is added to the container to allow data to be persisted across container restarts.
var builder = DistributedApplication.CreateBuilder(args);
var goff = builder.AddGoFeatureFlag("goff")
.WithDataVolume();
var api = builder.AddProject<Projects.Api>("api")
.WithReference(goff);
builder.Build().Run();
WithGoffBindMount(IResourceBuilder<GoFeatureFlagResource>, string) Section titled WithGoffBindMount(IResourceBuilder<GoFeatureFlagResource>, string) extension IResourceBuilder<GoFeatureFlagResource>
Adds a bind mount for the goff configuration folder to a GO Feature flag container resource.
public static class GoFeatureFlagBuilderExtensions
{
public static IResourceBuilder<GoFeatureFlagResource> WithGoffBindMount(
this IResourceBuilder<GoFeatureFlagResource> builder,
string source)
{
// ...
}
}
builder IResourceBuilder<GoFeatureFlagResource> The resource builder.
source string The source directory on the host to mount into the container.
IResourceBuilder<GoFeatureFlagResource> The ApplicationModel.IResourceBuilder`1.
Add a GO Feature flag container to the application model and reference it in a .NET project. Additionally, in this example a bind mount is added to the container to allow reading goff configuration.
var builder = DistributedApplication.CreateBuilder(args);
var goff = builder.AddGoFeatureFlag("goff")
.WithGoffBindMount("./goff");
var api = builder.AddProject<Projects.Api>("api")
.WithReference(goff);
builder.Build().Run();
WithLogLevel(IResourceBuilder<GoFeatureFlagResource>, LogLevel) Section titled WithLogLevel(IResourceBuilder<GoFeatureFlagResource>, LogLevel) extension IResourceBuilder<GoFeatureFlagResource>
Configures logging level for the GO Feature Flag container resource.
public static class GoFeatureFlagBuilderExtensions
{
public static IResourceBuilder<GoFeatureFlagResource> WithLogLevel(
this IResourceBuilder<GoFeatureFlagResource> builder,
LogLevel logLevel)
{
// ...
}
}
builder IResourceBuilder<GoFeatureFlagResource> The resource builder.
logLevel LogLevel The log level to set.
IResourceBuilder<GoFeatureFlagResource> The ApplicationModel.IResourceBuilder`1.
The only supported Logging.LogLevel by GO Feature Flag are LogLevel.Error, LogLevel.Warning, LogLevel.Information and LogLevel.Debug.