Documentation ¶
Overview ¶
Package file provides a file loader for config.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader provides reads configuration from the local filesystem.
func (*Loader) Load ¶
Load returns the current content of the file. The file is expected to exist and be readable, else an error is returned.
func (*Loader) NewWatcher ¶
NewWatcher returns a channel of update events the loader. The watcher must be enabled using the WithWatch construction option. The watcher will send nil events when the loader has changed. If a terminal error occurs it is sent to the update channel which is then closed. The watcher will exit when the done is closed or a terminal error occurs.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is a construction option for a Blob.
type WatcherOption ¶
type WatcherOption struct { }
WatcherOption enables a watcher on the file.
func WithWatcher ¶
func WithWatcher() WatcherOption
WithWatcher is an Option that enables watching of the file. This is an option to ensure it can only set at construction time, so the watcher is a singleton and is created before the file is initially loaded. Note that watched files must be closed to terminate the watch.