filewatcher

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileWatcher

type FileWatcher struct {
	// contains filtered or unexported fields
}

FileWatcher watches files for changes. When the file changes, it runs the specified handler function.

func New

func New(fp string, callback Handler) (*FileWatcher, error)

New returns a new FileWatcher watching the given file path.

func (*FileWatcher) Start

func (cw *FileWatcher) Start(ctx context.Context) error

Start starts the watch on the certificate and key files.

func (*FileWatcher) Watch

func (cw *FileWatcher) Watch()

Watch reads events from the watcher's channel and reacts to changes.

type Handler

type Handler func(fp string) error

Jump to

Keyboard shortcuts

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