This repository has been archived by the owner on Oct 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## [8.1.0] - 2024-03-06 ### Added: - Added the ability to set wrapper information independent of HTTP configuration. This change is intended primarily for use by LaunchDarkly in the development of wrapper SDKs. --------- Co-authored-by: Eli Bishop <[email protected]> Co-authored-by: Ben Woskow <[email protected]> Co-authored-by: LaunchDarklyCI <[email protected]> Co-authored-by: LaunchDarklyCI <[email protected]> Co-authored-by: Ember Stevens <[email protected]> Co-authored-by: ember-stevens <[email protected]> Co-authored-by: LaunchDarklyReleaseBot <[email protected]> Co-authored-by: Ryan Lamb <[email protected]> Co-authored-by: Louis Chan <[email protected]> Co-authored-by: ld-repository-standards[bot] <113625520+ld-repository-standards[bot]@users.noreply.github.com> Co-authored-by: Kane Parkinson <[email protected]>
- Loading branch information
1 parent
9cf1678
commit ed9c699
Showing
14 changed files
with
253 additions
and
31 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 |
---|---|---|
|
@@ -28,6 +28,8 @@ local.properties | |
# PDT-specific | ||
.buildpath | ||
|
||
global.json | ||
|
||
|
||
################# | ||
## Visual Studio | ||
|
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
54 changes: 54 additions & 0 deletions
54
src/LaunchDarkly.ServerSdk/Integrations/WrapperInfoBuilder.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,54 @@ | ||
using LaunchDarkly.Sdk.Server.Interfaces; | ||
|
||
namespace LaunchDarkly.Sdk.Server.Integrations | ||
{ | ||
/// <summary> | ||
/// Contains methods for configuring wrapper information. | ||
/// <para> | ||
/// If the WrapperBuilder is used, then it will replace the wrapper information from the HttpConfigurationBuilder. | ||
/// </para> | ||
/// <para> | ||
/// Additionally, any wrapper SDK may overwrite any application developer provided wrapper information. | ||
/// </para> | ||
/// </summary> | ||
/// <remarks> | ||
/// This builder is primarily intended for use by LaunchDarkly in developing wrapper SDKs. | ||
/// </remarks> | ||
public sealed class WrapperInfoBuilder | ||
{ | ||
private string _name; | ||
private string _version; | ||
|
||
/// <summary> | ||
/// Set the name of the wrapper. | ||
/// </summary> | ||
/// <param name="value">the name of the wrapper</param> | ||
/// <returns>the builder</returns> | ||
public WrapperInfoBuilder Name(string value) | ||
{ | ||
_name = value; | ||
return this; | ||
} | ||
|
||
/// <summary> | ||
/// Set the version of the wrapper. | ||
/// </summary> | ||
/// <param name="value">the version of the wrapper</param> | ||
/// <returns>the builder</returns> | ||
public WrapperInfoBuilder Version(string value) | ||
{ | ||
_version = value; | ||
return this; | ||
} | ||
|
||
/// <summary> | ||
/// Called internally by the SDK to create a configuration instance. Applications do not need | ||
/// to call this method. | ||
/// </summary> | ||
/// <returns>the wrapper information</returns> | ||
public WrapperInfo Build() | ||
{ | ||
return new WrapperInfo(_name, _version); | ||
} | ||
} | ||
} |
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 LaunchDarkly.Sdk.Server.Interfaces | ||
{ | ||
/// <summary> | ||
/// Contains wrapper SDK information. | ||
/// </summary> | ||
/// <remarks> | ||
/// This class's properties are not public, since they are only read by the SDK. | ||
/// </remarks> | ||
/// <seealso cref="LaunchDarkly.Sdk.Server.Integrations.WrapperInfoBuilder"/> | ||
public sealed class WrapperInfo | ||
{ | ||
internal string Name { get; } | ||
internal string Version { get; } | ||
|
||
internal WrapperInfo( | ||
string name, | ||
string version | ||
) | ||
{ | ||
Name = name; | ||
Version = version; | ||
} | ||
} | ||
} |
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
Oops, something went wrong.