Skip to content

File

The File Retriever will read a local file to get your flags.

Tip

Using a file to store your flags is not recommend, except if it is in a shared folder for all your services.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
import  "github.com/thomaspoignant/go-feature-flag/retriever/file"
// ...

err := ffclient.Init(ffclient.Config{
    PollingInterval: 3 * time.Second,
    Retriever: &fileretriever.Retriever{
        Path: "file-example.yaml",
    },
})
defer ffclient.Close()

Configuration fields

To configure your File retriever:

Field Description
Path location of your file on the file system.