-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6d22209
commit 85bb407
Showing
2 changed files
with
45 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
# Feature Flags Package | ||
|
||
A Go package for managing feature flags using Flagsmith as the provider. | ||
|
||
## Prerequisites | ||
|
||
Before using this package, ensure you have set the following environment variable: | ||
|
||
```bash | ||
export FLAGSMITH_SERVER_SIDE_ENVIRONMENT_KEY=your-api-key | ||
``` | ||
|
||
## Usage Example | ||
|
||
Here's a basic example of how to use the feature flags package: | ||
|
||
```go | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
|
||
"github.com/rudderlabs/rudder-go-kit/featureflags" | ||
) | ||
|
||
func main() { | ||
// Set default traits (optional) | ||
featureflags.SetDefaultTraits(map[string]string{ | ||
"exampleTrait": "exampleTraitValue", | ||
}) | ||
|
||
// Check if a feature is enabled | ||
isEnabled, err := featureflags.IsFeatureEnabled("testWs", "testFeature") | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
fmt.Println(isEnabled) | ||
} | ||
``` | ||
|
||
For more detailed examples and implementation details, refer to the example directory. |
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