watcher

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 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

ChangeType represent the type of changes that can occur during Watch()

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

type ConfigWatcher

type ConfigWatcher interface {

	// Watch will monitor 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