reload

package
v0.42.2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: Apache-2.0 Imports: 6 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, prevConfig *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

Types

type ConfigUpdateEvent

type ConfigUpdateEvent[T any] struct {
	// Config is the new config.
	Config *T
	// PrevConfig is the previous config.
	PrevConfig *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