File
Overviewβ
Fetch the configuration from a local file. This retriever is useful when you want to load the configuration from a file in your file system.Configure the relay proxyβ
To configure your relay proxy to use the File System retriever, you need to add the following configuration to your relay proxy configuration file:
goff-proxy.yaml
# ...
retrievers:
- kind: file
path: /goff/my-flags.yaml
# ...
Field name | Mandatory | Type | Default | Description |
---|---|---|---|---|
kind | string | none | Value should be file .This field is mandatory and describes which retriever you are using. | |
path | string | none | Path to the file in your local computer (ex: /goff/my-flags.yaml ). |
Configure the GO Moduleβ
To configure your GO module to use the File System retriever, you need to add the following
configuration to your ffclient.Config{}
object:
example.go
import "github.com/thomaspoignant/go-feature-flag/retriever/file"
// ...
err := ffclient.Init(ffclient.Config{
PollingInterval: 3 * time.Second,
Retriever: &fileretriever.Retriever{
Path: "/goff/my-flags.yaml",
},
})
defer ffclient.Close()
Field | Mandatory | Description |
---|---|---|
Path | location of your file on the file system. |