Skip to main content
Version: v0.28.2

Custom Retriever

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

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.

Get the latest GO Feature Flag updates