forked from thomaspoignant/go-feature-flag
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage_info.go
39 lines (39 loc) · 1.27 KB
/
package_info.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Package ffclient aids adding instrumentation to have feature flags in your
// app without any backend server.
//
// # Summary
//
// This package and its subpackages contain bits of code to have an easy feature
// flag solution with no complex installation to do on your infrastructure and
// without using 3rd party vendor for this.
//
// The ffclient package provides the entry point - initialization and the basic
// method to get your flags value.
//
// Before using the module you need to initialized it this way:
//
// func main() {
// err := ffclient.Init(ffclient.Config{
// PollingInterval: 3 * time.Second,
// HTTPRetriever: &httpretriever.Retriever{
// URL: "http://example.com/flag-config.yaml",
// },
// })
// defer ffclient.Close()
// ...
//
// This example will load a file from an HTTP endpoint and will refresh the flags every 3 seconds.
//
// Now you can evaluate your flags anywhere in your code.
//
// func main() {
// ...
// user := ffcontext.NewEvaluationContext("user-unique-key")
// hasFlag, _ := ffclient.BoolVariation("test-flag", user, false)
// if hasFlag {
// //flag "test-flag" is true for the user
// } else {
// // flag "test-flag" is false for the user
// }
// ...
package ffclient