-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into askpt/243-feature-implement-transaction-context
- Loading branch information
Showing
38 changed files
with
1,535 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
".": "2.0.0" | ||
".": "2.1.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/OpenFeature.DependencyInjection/Diagnostics/FeatureCodes.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
namespace OpenFeature.DependencyInjection.Diagnostics; | ||
|
||
/// <summary> | ||
/// Contains identifiers for experimental features and diagnostics in the OpenFeature framework. | ||
/// </summary> | ||
/// <remarks> | ||
/// <c>Experimental</c> - This class includes identifiers that allow developers to track and conditionally enable | ||
/// experimental features. Each identifier follows a structured code format to indicate the feature domain, | ||
/// maturity level, and unique identifier. Note that experimental features are subject to change or removal | ||
/// in future releases. | ||
/// <para> | ||
/// <strong>Basic Information</strong><br/> | ||
/// These identifiers conform to OpenFeature’s Diagnostics Specifications, allowing developers to recognize | ||
/// and manage experimental features effectively. | ||
/// </para> | ||
/// </remarks> | ||
/// <example> | ||
/// <code> | ||
/// Code Structure: | ||
/// - "OF" - Represents the OpenFeature library. | ||
/// - "DI" - Indicates the Dependency Injection domain. | ||
/// - "001" - Unique identifier for a specific feature. | ||
/// </code> | ||
/// </example> | ||
internal static class FeatureCodes | ||
{ | ||
/// <summary> | ||
/// Identifier for the experimental Dependency Injection features within the OpenFeature framework. | ||
/// </summary> | ||
/// <remarks> | ||
/// <c>OFDI001</c> identifier marks experimental features in the Dependency Injection (DI) domain. | ||
/// | ||
/// Usage: | ||
/// Developers can use this identifier to conditionally enable or test experimental DI features. | ||
/// It is part of the OpenFeature diagnostics system to help track experimental functionality. | ||
/// </remarks> | ||
public const string NewDi = "OFDI001"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System.Diagnostics; | ||
using System.Runtime.CompilerServices; | ||
|
||
namespace OpenFeature.DependencyInjection; | ||
|
||
[DebuggerStepThrough] | ||
internal static class Guard | ||
{ | ||
public static void ThrowIfNull(object? argument, [CallerArgumentExpression(nameof(argument))] string? paramName = null) | ||
{ | ||
if (argument is null) | ||
throw new ArgumentNullException(paramName); | ||
} | ||
|
||
public static void ThrowIfNullOrWhiteSpace(string? argument, [CallerArgumentExpression(nameof(argument))] string? paramName = null) | ||
{ | ||
if (string.IsNullOrWhiteSpace(argument)) | ||
throw new ArgumentNullException(paramName); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/OpenFeature.DependencyInjection/IFeatureLifecycleManager.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
namespace OpenFeature.DependencyInjection; | ||
|
||
/// <summary> | ||
/// Defines the contract for managing the lifecycle of a feature api. | ||
/// </summary> | ||
public interface IFeatureLifecycleManager | ||
{ | ||
/// <summary> | ||
/// Ensures that the feature provider is properly initialized and ready to be used. | ||
/// This method should handle all necessary checks, configuration, and setup required to prepare the feature provider. | ||
/// </summary> | ||
/// <param name="cancellationToken">Propagates notification that operations should be canceled.</param> | ||
/// <returns>A Task representing the asynchronous operation of initializing the feature provider.</returns> | ||
/// <exception cref="InvalidOperationException">Thrown when the feature provider is not registered or is in an invalid state.</exception> | ||
ValueTask EnsureInitializedAsync(CancellationToken cancellationToken = default); | ||
|
||
/// <summary> | ||
/// Gracefully shuts down the feature api, ensuring all resources are properly disposed of and any persistent state is saved. | ||
/// This method should handle all necessary cleanup and shutdown operations for the feature provider. | ||
/// </summary> | ||
/// <param name="cancellationToken">Propagates notification that operations should be canceled.</param> | ||
/// <returns>A Task representing the asynchronous operation of shutting down the feature provider.</returns> | ||
ValueTask ShutdownAsync(CancellationToken cancellationToken = default); | ||
} |
Oops, something went wrong.