go-server-sdk: github.com/launchdarkly/go-server-sdk/ldfilewatch Index | Files

package ldfilewatch

import "github.com/launchdarkly/go-server-sdk/ldfilewatch"

Package ldfilewatch allows the LaunchDarkly client to read feature flag data from a file, with automatic reloading. It should be used in conjunction with the ldfiledata package. The two packages are separate so as to avoid bringing additional dependencies for users who do not need automatic reloading.

Index

Package Files

watched_file_data_source.go

func WatchFiles Uses

func WatchFiles(paths []string, errorLogger ld.Logger, reload func(), closeCh <-chan struct{}) error

WatchFiles sets up a mechanism for the file data source to reload its source files whenever one of them has been modified. Use it as follows:

factory := ldfiledata.NewFileDataSourceFactory(
    ldfiledata.FilePaths("./test-data/my-flags.json"),
    ldfiledata.UseReloader(ldfilewatch.WatchFiles))

Package ldfilewatch imports 6 packages (graph). Updated 2019-10-02. Refresh now. Tools for package owners.