reload

package
v0.36.1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package reload provides configuration reloading capabilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FireConfigUpdate

func FireConfigUpdate[T any](mgr event.Manager, config *T)

FireConfigUpdate fires the config update event.

func Map

func Map[C1, C2 event.Event](mgr event.Manager, forwarder func(*C1) *C2) func()

Map maps the config update event to another config type.

func Subscribe

func Subscribe[T any](mgr event.Manager, handler func(*ConfigUpdateEvent[T])) func()

Subscribe subscribes the given handler to the config update event.

func Watch

func Watch(ctx context.Context, path string, cb func() error) error

Watch watches the given path for changes and calls the given callback.

Types

type ConfigUpdateEvent

type ConfigUpdateEvent[T any] struct {
	// Config is the new config.
	Config *T
}

ConfigUpdateEvent is fired when the config is reloaded.

Jump to

Keyboard shortcuts

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