Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConfigWatcher ¶ added in v0.10.1
type ConfigWatcher struct { FileWatcher FileWatcher // contains filtered or unexported fields }
ConfigWatcher watches kubernetes configurations.
func NewConfigWatcher ¶ added in v0.10.1
func NewConfigWatcher(wc WatcherConfig, options ...ConfigWatcherOption) (*ConfigWatcher, error)
NewConfigWatcher creates an instance of ConfigWatcher.
func (*ConfigWatcher) Add ¶ added in v0.10.1
func (cw *ConfigWatcher) Add(ctx context.Context, names ...string) error
Add adds file names to be watched.
func (*ConfigWatcher) Watch ¶ added in v0.10.1
func (cw *ConfigWatcher) Watch(ctx context.Context)
Watch runs the config watcher loop
type ConfigWatcherOption ¶ added in v0.10.1
type ConfigWatcherOption func(cw *ConfigWatcher)
ConfigWatcherOption is an option for configuration ConfigWatcher.
func ConfigWatcherFileWatcher ¶ added in v0.10.1
func ConfigWatcherFileWatcher(fw FileWatcher) ConfigWatcherOption
ConfigWatcherFileWatcher sets the file watcher for ConfigWatcher.
type DefaultFileWatcher ¶ added in v0.10.1
type DefaultFileWatcher struct {
// contains filtered or unexported fields
}
DefaultFileWatcher wraps fsnotify.Watcher so it can adhere to the FileWatcher API.
func NewDefaultFileWatcher ¶ added in v0.10.1
func NewDefaultFileWatcher() (*DefaultFileWatcher, error)
NewDefaultFileWatcher creates an instance of DefaultFileWatcher.
func (*DefaultFileWatcher) Add ¶ added in v0.10.1
func (d *DefaultFileWatcher) Add(name string) error
Add adds a file name to be watched.
func (DefaultFileWatcher) Errors ¶ added in v0.10.1
func (d DefaultFileWatcher) Errors() chan error
Errors returns a channel of errors.
func (*DefaultFileWatcher) Events ¶ added in v0.10.1
func (d *DefaultFileWatcher) Events() chan fsnotify.Event
Events returns a channel of fsnotify events.
type FileWatcher ¶ added in v0.10.1
type FileWatcher interface { // Add adds a file to watch. Add(name string) error // Events returns a channel with fsnotify events. Events() chan fsnotify.Event // Errors returns errors. Errors() chan error }
FileWatcher watches files.
Click to show internal directories.
Click to hide internal directories.