Skip to content

Commit f793722

Browse files
feat: Go feature flag provider (#106)
GO Feature Flag provider init Signed-off-by: Thomas Poignant <[email protected]>
1 parent bc8e3ce commit f793722

23 files changed

+956
-1
lines changed

pom.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
<modules>
3030
<module>hooks/open-telemetry</module>
3131
<module>providers/flagd</module>
32+
<module>providers/go-feature-flag</module>
3233
</modules>
3334

3435
<scm>
@@ -45,7 +46,7 @@
4546

4647
<dependencies>
4748
<dependency>
48-
<!-- provided -->
49+
<!-- provided -->
4950
<groupId>dev.openfeature</groupId>
5051
<artifactId>javasdk</artifactId>
5152
<!-- 0.2.0 or greater -->

providers/go-feature-flag/README.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# GO Feature Flag Java Provider
2+
3+
GO Feature Flag provider allows you to connect to your [GO Feature Flag relay proxy](https://gofeatureflag.org) instance.
4+
5+
## How to use this provider?
6+
7+
To initialize your instance please follow this example:
8+
9+
```java
10+
import dev.openfeature.contrib.providers.gofeatureflag;
11+
12+
// ...
13+
new GoFeatureFlagProvider(
14+
GoFeatureFlagProviderOptions
15+
.builder()
16+
.endpoint("https://my-gofeatureflag-instance.org")
17+
.timeout(1000)
18+
.build());
19+
```
20+
21+
You will have a new instance ready to be used with your `open-feature` java SDK.
22+
23+
### Options
24+
25+
| name | mandatory | Description |
26+
|--------------------------|-----------|----------------------------------------------------------------------------------------------------------------|
27+
| **`endpoint`** | `true` | endpoint contains the DNS of your GO Feature Flag relay proxy _(ex: https://mydomain.com/gofeatureflagproxy/)_ |
28+
| **`timeout`** | `false` | timeout in millisecond we are waiting when calling the go-feature-flag relay proxy API. _(default: 10000)_ |
29+
| **`maxIdleConnections`** | `false` | maxIdleConnections is the maximum number of connexions in the connexion pool. _(default: 1000)_ |
30+
| **`keepAliveDuration`** | `false` | keepAliveDuration is the time in millisecond we keep the connexion open. _(default: 7200000 (2 hours))_ |
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# This file is needed to avoid errors throw by findbugs when working with lombok.
2+
lombok.addSuppressWarnings = true
3+
lombok.addLombokGeneratedAnnotation = true
4+
config.stopBubbling = true
5+
lombok.extern.findbugs.addSuppressFBWarnings = true

providers/go-feature-flag/pom.xml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<parent>
6+
<groupId>dev.openfeature.contrib</groupId>
7+
<artifactId>parent</artifactId>
8+
<version>0.0.2</version>
9+
<relativePath>../../pom.xml</relativePath>
10+
</parent>
11+
<groupId>dev.openfeature.contrib.providers</groupId>
12+
<artifactId>go-feature-flag</artifactId>
13+
<version>0.1.0</version> <!--x-release-please-version -->
14+
15+
<name>go-feature-flag</name>
16+
<description>GO Feature Flag provider for Java</description>
17+
<url>https://gofeatureflag.org</url>
18+
19+
<developers>
20+
<developer>
21+
<id>thomaspoignant</id>
22+
<name>Thomas Poignant</name>
23+
<organization>go-feature-flag</organization>
24+
<url>https://gofeatureflag.org</url>
25+
</developer>
26+
</developers>
27+
28+
<dependencies>
29+
<dependency>
30+
<groupId>com.fasterxml.jackson.datatype</groupId>
31+
<artifactId>jackson-datatype-jsr310</artifactId>
32+
<version>2.13.4</version>
33+
</dependency>
34+
35+
<dependency>
36+
<groupId>com.fasterxml.jackson.core</groupId>
37+
<artifactId>jackson-databind</artifactId>
38+
<version>2.13.4</version>
39+
</dependency>
40+
41+
<dependency>
42+
<groupId>com.squareup.okhttp3</groupId>
43+
<artifactId>okhttp</artifactId>
44+
<version>4.10.0</version>
45+
</dependency>
46+
47+
<dependency>
48+
<groupId>com.squareup.okhttp3</groupId>
49+
<artifactId>mockwebserver</artifactId>
50+
<version>4.10.0</version>
51+
<scope>test</scope>
52+
</dependency>
53+
</dependencies>
54+
</project>

0 commit comments

Comments
 (0)