Skip to content

feat: Go feature flag provider #106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Sep 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<modules>
<module>hooks/open-telemetry</module>
<module>providers/flagd</module>
<module>providers/go-feature-flag</module>
</modules>

<scm>
Expand All @@ -45,7 +46,7 @@

<dependencies>
<dependency>
<!-- provided -->
<!-- provided -->
<groupId>dev.openfeature</groupId>
<artifactId>javasdk</artifactId>
<!-- 0.2.0 or greater -->
Expand Down
30 changes: 30 additions & 0 deletions providers/go-feature-flag/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# GO Feature Flag Java Provider

GO Feature Flag provider allows you to connect to your [GO Feature Flag relay proxy](https://gofeatureflag.org) instance.

## How to use this provider?

To initialize your instance please follow this example:

```java
import dev.openfeature.contrib.providers.gofeatureflag;

// ...
new GoFeatureFlagProvider(
GoFeatureFlagProviderOptions
.builder()
.endpoint("https://my-gofeatureflag-instance.org")
.timeout(1000)
.build());
```

You will have a new instance ready to be used with your `open-feature` java SDK.

### Options

| name | mandatory | Description |
|--------------------------|-----------|----------------------------------------------------------------------------------------------------------------|
| **`endpoint`** | `true` | endpoint contains the DNS of your GO Feature Flag relay proxy _(ex: https://mydomain.com/gofeatureflagproxy/)_ |
| **`timeout`** | `false` | timeout in millisecond we are waiting when calling the go-feature-flag relay proxy API. _(default: 10000)_ |
| **`maxIdleConnections`** | `false` | maxIdleConnections is the maximum number of connexions in the connexion pool. _(default: 1000)_ |
| **`keepAliveDuration`** | `false` | keepAliveDuration is the time in millisecond we keep the connexion open. _(default: 7200000 (2 hours))_ |
5 changes: 5 additions & 0 deletions providers/go-feature-flag/lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file is needed to avoid errors throw by findbugs when working with lombok.
lombok.addSuppressWarnings = true
lombok.addLombokGeneratedAnnotation = true
config.stopBubbling = true
lombok.extern.findbugs.addSuppressFBWarnings = true
54 changes: 54 additions & 0 deletions providers/go-feature-flag/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>dev.openfeature.contrib</groupId>
<artifactId>parent</artifactId>
<version>0.0.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<groupId>dev.openfeature.contrib.providers</groupId>
<artifactId>go-feature-flag</artifactId>
<version>0.1.0</version> <!--x-release-please-version -->

<name>go-feature-flag</name>
<description>GO Feature Flag provider for Java</description>
<url>https://gofeatureflag.org</url>

<developers>
<developer>
<id>thomaspoignant</id>
<name>Thomas Poignant</name>
<organization>go-feature-flag</organization>
<url>https://gofeatureflag.org</url>
</developer>
</developers>

<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>2.13.4</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.4</version>
</dependency>

<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.10.0</version>
</dependency>

<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>mockwebserver</artifactId>
<version>4.10.0</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Loading