Skip to content

Instantly share code, notes, and snippets.

View thomaspoignant's full-sized avatar

Thomas Poignant thomaspoignant

View GitHub Profile
const { OpenFeature } = require("@openfeature/server-sdk");
const {
GoFeatureFlagProvider,
} = require("@openfeature/go-feature-flag-provider");
(async () => {
try {
// Initialize the GO Feature Flag provider
const goFeatureFlagProvider = new GoFeatureFlagProvider({
endpoint: "http://localhost:1031/", // DNS of your instance of relay proxy

Contributor Month

I am Thomas Poignant, living in Paris France and I am writing about my OpenSource journey.

I am currently Head Of Engineering in Leboncoin (one of the largest classified ad marketplace in Europe), and I work in the software engineering field for more than 16 years.

I started with OpenSource like many of us by using it, but I always had in mind that I wanted to contribute back to the awesome ecosystem that OpenSource provide. And when I moved to more leadership position in my day job, putting me away of the code more and more, it was obvious for me that I will be involved more into OpenSource.

I started with a small library called scim-patch, and now I spend most of my time around feature flags, I am building GO Feature Flag a feature flag platform that works with all your favorite languages and is integrating easily in any company tech. You can start using feature flags super fast with G

package datastruct
import (
"fmt"
"sync"
)
const minOffset = int64(-1)
type eventStoreImpl[T any] struct {
#!/usr/bin/env node
import * as fs from "fs";
import {writeFile} from "fs/promises";
import {configuration} from "../config/config";
const tarToZip = require('tar-to-zip');
const downloadGoffFromGitHubRelease = async (tag: string, destinationPath: string, repoSlug: string, templatedFileName: string): Promise<string> => {
const version = tag.replace('v', '');
const fileName = templatedFileName.replace('{version}', version);
package main
import (
"context"
"fmt"
"github.com/google/go-github/v63/github"
"os"
"strings"
)
listen: 1031
pollingInterval: 1000
startWithRetrieverError: false
retriever:
kind: http
url: https://raw.githubusercontent.com/thomaspoignant/go-feature-flag/main/examples/retriever_file/flags.goff.yaml
exporter:
kind: log
enableSwagger: true
@thomaspoignant
thomaspoignant / of-goff-example.py
Created February 21, 2024 17:55
GO Feature Flag + OpenFeature example
import time
from gofeatureflag_python_provider.provider import GoFeatureFlagProvider
from gofeatureflag_python_provider.options import GoFeatureFlagOptions
from openfeature import api
from openfeature.evaluation_context import EvaluationContext
from gofeatureflag_python_provider.provider_status import ProviderStatus
retriever:
kind: github # type of retriever we are using
repositorySlug: thomaspoignant/demo-goff # repository we are retrieving
path: flags.yaml # location of the file in the repository
pollingInterval: 5000 # Time in milliseconds we wait before trying to check for changes
basePath: /
definitions:
model.FlagEval:
properties:
value: {}
type: object
model.HealthResponse:
properties:
initialized:
description: Set to true if the HTTP server is started
# sort the stages
out_degree_map = {v: d for v, d in g.out_degree() if d > 0}
zero_out_degree = [v for v, d in g.out_degree() if d == 0]
while zero_out_degree:
yield zero_out_degree
new_zero_out_degree = []
for v in zero_out_degree:
for child, _ in g.in_edges(v):
out_degree_map[child] -= 1
if not out_degree_map[child]: