file

package
v0.0.0-...-e997027 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Op   loader.OpType
	Path string
}

type EventHandler

type EventHandler func(event Event) error

type FileLoader

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

func NewFileLoader

func NewFileLoader() *FileLoader

NewFileLoader

func (*FileLoader) Load

func (f *FileLoader) Load(path string) (data []byte, err error)

Load load config data

func (*FileLoader) String

func (f *FileLoader) String() string

String file loader

func (*FileLoader) Watch

func (f *FileLoader) Watch(path string) (ret *loader.WatchResult, err error)

watch path file change and reload the changed file

type FileWatcher

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

func NewFileWatcher

func NewFileWatcher() (fileWatcher *FileWatcher, err error)

func (*FileWatcher) AddWatch

func (w *FileWatcher) AddWatch(path string, fn EventHandler) (err error)

func (*FileWatcher) Close

func (w *FileWatcher) Close()

func (*FileWatcher) RemoveWatch

func (w *FileWatcher) RemoveWatch(path string)

Jump to

Keyboard shortcuts

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