watcher

package
v0.0.0-...-75b1e24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package watcher contains components that are used for configuration reloading of kelon.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeType

type ChangeType int

Type of changes that can occur during Watch()

const (
	// Passed to Watch() on initial load
	ChangeAll ChangeType = 0
	// Passed to Watch() if any file with ending '.rego' changed
	ChangeRego ChangeType = 1
	// Passed to Watch() if any file with ending .yml or .yaml changed
	ChangeConf ChangeType = 2
	// Passed to Watch() if any file with unknown file ending changed
	ChangeUnknown ChangeType = 3
)

type ConfigWatcher

type ConfigWatcher interface {

	// Watches for configuration changes and calls the passed callback procedure every
	// time the config changes.
	Watch(callback func(ChangeType, *configs.ExternalConfig, error))
}

ConfigWatcher is the interface that manages configuration reloading.

Therefore a callback procedure is provided, which is always called if any configuration changes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL