Skip to content

Custom Retriever

To create a custom retriever you must have a struct that implements the Retriever interface.

1
2
3
type Retriever interface {
    Retrieve(ctx context.Context) ([]byte, error)
}

The Retrieve function is supposed to load the file and to return a []byte of your flag configuration file.

If you want to specify the format of the file, you can use the ffclient.Config.FileFormat option to specify if it is a YAML, JSON or TOML file.

You can check existing Retriever (file, s3, ...) to have an idea on how to do build your own.