fswatcher

package
v1.4.15 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Reconcile added in v1.4.12

func Reconcile(ctx context.Context, fullFilePath string, onChange, onClose, onSync func(), resyncInterval *time.Duration) error

Reconcile behaves the same as Watch, except it allows for running the onSync func on a provided interval. The default re-sync internal is 1m.

func Watch

func Watch(ctx context.Context, fullFilePath string, onChange, onClose func()) error

Listens for changes to the specified file. Note this: - Only ends if the context is closed - Listens at the directory level, for cross OS compatibility - Only fires if the config file has changed, and can be read - Only fires if the data in the file is different to the last notification - Does not reload the config - that's the caller's responsibility

Types

This section is empty.

Jump to

Keyboard shortcuts

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