Skip to content

Commit

Permalink
chore: update sdk readmes
Browse files Browse the repository at this point in the history
Signed-off-by: OpenFeature Bot <[email protected]>
  • Loading branch information
openfeaturebot committed Jul 17, 2024
1 parent 1d26d14 commit ed009a6
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 44 deletions.
2 changes: 1 addition & 1 deletion docs/reference/technologies/client/kotlin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This content has been automatically generated from kotlin-sdk.
Edits should be made here: https://github.com/open-feature/kotlin-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs

Last updated at Thu Jun 13 2024 08:07:56 GMT+0000 (Coordinated Universal Time)
Last updated at Wed Jul 17 2024 08:08:05 GMT+0000 (Coordinated Universal Time)
-->

<p align="center" class="github-badges">
Expand Down
8 changes: 4 additions & 4 deletions docs/reference/technologies/client/swift.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This content has been automatically generated from swift-sdk.
Edits should be made here: https://github.com/open-feature/swift-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs

Last updated at Thu Jun 13 2024 08:07:56 GMT+0000 (Coordinated Universal Time)
Last updated at Wed Jul 17 2024 08:08:05 GMT+0000 (Coordinated Universal Time)
-->

<p align="center" class="github-badges">
Expand All @@ -20,8 +20,8 @@ Last updated at Thu Jun 13 2024 08:07:56 GMT+0000 (Coordinated Universal Time)
</a>


<a href="https://github.com/open-feature/swift-sdk/releases/tag/0.1.0">
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v0.1.0&color=blue&style=for-the-badge" />
<a href="https://github.com/open-feature/swift-sdk/releases/tag/0.2.0">
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v0.2.0&color=blue&style=for-the-badge" />
</a>


Expand Down Expand Up @@ -58,7 +58,7 @@ First, ensure you have your GitHub account added as an option (+ > Add Source Co
If you manage dependencies through SPM, in the dependencies section of Package.swift add:

```swift
.package(url: "[email protected]:open-feature/swift-sdk.git", from: "0.1.0")
.package(url: "[email protected]:open-feature/swift-sdk.git", from: "0.2.0")
```

and in the target dependencies section add:
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/technologies/client/web/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk.
Edits should be made here: https://github.com/open-feature/js-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs

Last updated at Thu Jun 13 2024 08:07:56 GMT+0000 (Coordinated Universal Time)
Last updated at Wed Jul 17 2024 08:08:05 GMT+0000 (Coordinated Universal Time)
-->

<p align="center" class="github-badges">
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/technologies/client/web/react.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk.
Edits should be made here: https://github.com/open-feature/js-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs

Last updated at Thu Jun 13 2024 08:07:56 GMT+0000 (Coordinated Universal Time)
Last updated at Wed Jul 17 2024 08:08:05 GMT+0000 (Coordinated Universal Time)
-->

<p align="center" class="github-badges">
Expand Down
42 changes: 21 additions & 21 deletions docs/reference/technologies/server/dotnet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This content has been automatically generated from dotnet-sdk.
Edits should be made here: https://github.com/open-feature/dotnet-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs

Last updated at Thu Jun 13 2024 08:07:55 GMT+0000 (Coordinated Universal Time)
Last updated at Wed Jul 17 2024 08:08:04 GMT+0000 (Coordinated Universal Time)
-->

[![Specification](https://img.shields.io/static/v1?label=specification&message=v0.7.0&color=yellow&style=for-the-badge)](https://github.com/open-feature/spec/releases/tag/v0.7.0)
Expand Down Expand Up @@ -53,13 +53,13 @@ dotnet add package OpenFeature
public async Task Example()
{
// Register your feature flag provider
await Api.Instance.SetProvider(new InMemoryProvider());
await Api.Instance.SetProviderAsync(new InMemoryProvider());

// Create a new client
FeatureClient client = Api.Instance.GetClient();

// Evaluate your feature flag
bool v2Enabled = await client.GetBooleanValue("v2_enabled", false);
bool v2Enabled = await client.GetBooleanValueAsync("v2_enabled", false);

if ( v2Enabled )
{
Expand Down Expand Up @@ -93,7 +93,7 @@ If the provider you're looking for hasn't been created yet, see the [develop a p
Once you've added a provider as a dependency, it can be registered with OpenFeature like this:

```csharp
await Api.Instance.SetProvider(new MyProvider());
await Api.Instance.SetProviderAsync(new MyProvider());
```

In some situations, it may be beneficial to register multiple providers in the same application.
Expand Down Expand Up @@ -124,7 +124,7 @@ builder = EvaluationContext.Builder();
builder.Set("region", "us-east-1");
EvaluationContext reqCtx = builder.Build();

bool flagValue = await client.GetBooleanValue("some-flag", false, reqCtx);
bool flagValue = await client.GetBooleanValuAsync("some-flag", false, reqCtx);

```

Expand All @@ -145,7 +145,7 @@ var client = Api.Instance.GetClient();
client.AddHooks(new ExampleClientHook());

// add a hook for this evaluation only
var value = await client.GetBooleanValue("boolFlag", false, context, new FlagEvaluationOptions(new ExampleInvocationHook()));
var value = await client.GetBooleanValueAsync("boolFlag", false, context, new FlagEvaluationOptions(new ExampleInvocationHook()));
```

### Logging
Expand All @@ -160,10 +160,10 @@ If a name has no associated provider, the global provider is used.

```csharp
// registering the default provider
await Api.Instance.SetProvider(new LocalProvider());
await Api.Instance.SetProviderAsync(new LocalProvider());

// registering a named provider
await Api.Instance.SetProvider("clientForCache", new CachedProvider());
await Api.Instance.SetProviderAsync("clientForCache", new CachedProvider());

// a client backed by default provider
FeatureClient clientDefault = Api.Instance.GetClient();
Expand Down Expand Up @@ -205,7 +205,7 @@ EventHandlerDelegate callback = EventHandler;
var myClient = Api.Instance.GetClient("my-client");

var provider = new ExampleProvider();
await Api.Instance.SetProvider(myClient.GetMetadata().Name, provider);
await Api.Instance.SetProviderAsync(myClient.GetMetadata().Name, provider);

myClient.AddHandler(ProviderEventTypes.ProviderReady, callback);
```
Expand All @@ -216,7 +216,7 @@ The OpenFeature API provides a close function to perform a cleanup of all regist

```csharp
// Shut down all providers
await Api.Instance.Shutdown();
await Api.Instance.ShutdownAsync();
```

## Extending
Expand All @@ -235,27 +235,27 @@ public class MyProvider : FeatureProvider
return new Metadata("My Provider");
}

public override Task<ResolutionDetails<bool>> ResolveBooleanValue(string flagKey, bool defaultValue, EvaluationContext context = null)
public override Task<ResolutionDetails<bool>> ResolveBooleanValueAsync(string flagKey, bool defaultValue, EvaluationContext? context = null, CancellationToken cancellationToken = default)
{
// resolve a boolean flag value
}

public override Task<ResolutionDetails<double>> ResolveDoubleValue(string flagKey, double defaultValue, EvaluationContext context = null)
public override Task<ResolutionDetails<string>> ResolveStringValueAsync(string flagKey, string defaultValue, EvaluationContext? context = null, CancellationToken cancellationToken = default)
{
// resolve a double flag value
// resolve a string flag value
}

public override Task<ResolutionDetails<int>> ResolveIntegerValue(string flagKey, int defaultValue, EvaluationContext context = null)
public override Task<ResolutionDetails<int>> ResolveIntegerValueAsync(string flagKey, int defaultValue, EvaluationContext context = null)
{
// resolve an int flag value
}

public override Task<ResolutionDetails<string>> ResolveStringValue(string flagKey, string defaultValue, EvaluationContext context = null)
public override Task<ResolutionDetails<double>> ResolveDoubleValueAsync(string flagKey, double defaultValue, EvaluationContext? context = null, CancellationToken cancellationToken = default)
{
// resolve a string flag value
// resolve a double flag value
}

public override Task<ResolutionDetails<Value>> ResolveStructureValue(string flagKey, Value defaultValue, EvaluationContext context = null)
public override Task<ResolutionDetails<Value>> ResolveStructureValueAsync(string flagKey, Value defaultValue, EvaluationContext? context = null, CancellationToken cancellationToken = default)
{
// resolve an object flag value
}
Expand All @@ -272,25 +272,25 @@ To satisfy the interface, all methods (`Before`/`After`/`Finally`/`Error`) need
```csharp
public class MyHook : Hook
{
public Task<EvaluationContext> Before<T>(HookContext<T> context,
public ValueTask<EvaluationContext> BeforeAsync<T>(HookContext<T> context,
IReadOnlyDictionary<string, object> hints = null)
{
// code to run before flag evaluation
}

public virtual Task After<T>(HookContext<T> context, FlagEvaluationDetails<T> details,
public ValueTask AfterAsync<T>(HookContext<T> context, FlagEvaluationDetails<T> details,
IReadOnlyDictionary<string, object> hints = null)
{
// code to run after successful flag evaluation
}

public virtual Task Error<T>(HookContext<T> context, Exception error,
public ValueTask ErrorAsync<T>(HookContext<T> context, Exception error,
IReadOnlyDictionary<string, object> hints = null)
{
// code to run if there's an error during before hooks or during flag evaluation
}

public virtual Task Finally<T>(HookContext<T> context, IReadOnlyDictionary<string, object> hints = null)
public ValueTask FinallyAsync<T>(HookContext<T> context, IReadOnlyDictionary<string, object> hints = null)
{
// code to run after all other stages, regardless of success/failure
}
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/technologies/server/go.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This content has been automatically generated from go-sdk.
Edits should be made here: https://github.com/open-feature/go-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs

Last updated at Thu Jun 13 2024 08:07:55 GMT+0000 (Coordinated Universal Time)
Last updated at Wed Jul 17 2024 08:08:04 GMT+0000 (Coordinated Universal Time)
-->

<p align="center" class="github-badges">
Expand Down
14 changes: 7 additions & 7 deletions docs/reference/technologies/server/java.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This content has been automatically generated from java-sdk.
Edits should be made here: https://github.com/open-feature/java-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs

Last updated at Thu Jun 13 2024 08:07:55 GMT+0000 (Coordinated Universal Time)
Last updated at Wed Jul 17 2024 08:08:04 GMT+0000 (Coordinated Universal Time)
-->

<p align="center" class="github-badges">
Expand All @@ -18,8 +18,8 @@ Last updated at Thu Jun 13 2024 08:07:55 GMT+0000 (Coordinated Universal Time)
</a>


<a href="https://github.com/open-feature/java-sdk/releases/tag/v1.8.0">
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v1.8.0&color=blue&style=for-the-badge" />
<a href="https://github.com/open-feature/java-sdk/releases/tag/v1.9.0">
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v1.9.0&color=blue&style=for-the-badge" />
</a>


Expand Down Expand Up @@ -54,7 +54,7 @@ Note that this library is intended to be used in server-side contexts and has no
<dependency>
<groupId>dev.openfeature</groupId>
<artifactId>sdk</artifactId>
<version>1.8.0</version>
<version>1.9.0</version>
</dependency>
```

Expand All @@ -66,8 +66,8 @@ If you would like snapshot builds, this is the relevant repository information:
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>sonartype</id>
<name>Sonartype Repository</name>
<id>sonatype</id>
<name>Sonatype Repository</name>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
</repositories>
Expand All @@ -77,7 +77,7 @@ If you would like snapshot builds, this is the relevant repository information:

```groovy
dependencies {
implementation 'dev.openfeature:sdk:1.8.0'
implementation 'dev.openfeature:sdk:1.9.0'
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/technologies/server/javascript/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk.
Edits should be made here: https://github.com/open-feature/js-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs

Last updated at Thu Jun 13 2024 08:07:55 GMT+0000 (Coordinated Universal Time)
Last updated at Wed Jul 17 2024 08:08:04 GMT+0000 (Coordinated Universal Time)
-->

<p align="center" class="github-badges">
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/technologies/server/javascript/nestjs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk.
Edits should be made here: https://github.com/open-feature/js-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs

Last updated at Thu Jun 13 2024 08:07:55 GMT+0000 (Coordinated Universal Time)
Last updated at Wed Jul 17 2024 08:08:04 GMT+0000 (Coordinated Universal Time)
-->

<p align="center" class="github-badges">
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/technologies/server/php.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This content has been automatically generated from php-sdk.
Edits should be made here: https://github.com/open-feature/php-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs

Last updated at Thu Jun 13 2024 08:07:56 GMT+0000 (Coordinated Universal Time)
Last updated at Wed Jul 17 2024 08:08:05 GMT+0000 (Coordinated Universal Time)
-->

<p align="center" class="github-badges">
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/technologies/server/python.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This content has been automatically generated from python-sdk.
Edits should be made here: https://github.com/open-feature/python-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs

Last updated at Thu Jun 13 2024 08:07:56 GMT+0000 (Coordinated Universal Time)
Last updated at Wed Jul 17 2024 08:08:04 GMT+0000 (Coordinated Universal Time)
-->

<p align="center" class="github-badges">
Expand Down
8 changes: 4 additions & 4 deletions src/datasets/sdks/sdk-compatibility.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"path": "/docs/reference/technologies/server/java",
"category": "Server",
"release": {
"href": "https://github.com/open-feature/java-sdk/releases/tag/v1.8.0",
"version": "1.8.0",
"href": "https://github.com/open-feature/java-sdk/releases/tag/v1.9.0",
"version": "1.9.0",
"stable": true
},
"spec": {
Expand Down Expand Up @@ -412,8 +412,8 @@
"path": "/docs/reference/technologies/client/swift",
"category": "Client",
"release": {
"href": "https://github.com/open-feature/swift-sdk/releases/tag/0.1.0",
"version": "0.1.0",
"href": "https://github.com/open-feature/swift-sdk/releases/tag/0.2.0",
"version": "0.2.0",
"stable": false
},
"spec": {
Expand Down

0 comments on commit ed009a6

Please sign in to comment.