Skip to main content
Version: v1.40.0

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 nameMandatoryTypeDefaultDescription
kindstringnoneValue should be file.
This field is mandatory and describes which retriever you are using.
pathstringnonePath 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()
FieldMandatoryDescription
Pathlocation of your file on the file system.