Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ExitOnChangeReactor = TerminateOnChangeReactor(func() { os.Exit(0) })
ExitOnChangeReactor provides reactor function that causes the process to exit when the change is detected. DEPRECATED: Using this function cause process to exit immediately without proper shutdown (context close/etc.)
Use the TerminateOnChangeReactor() instead.
Functions ¶
This section is empty.
Types ¶
type ActionType ¶
type ActionType int
ActionType define a type of action observed on the file
const ( // FileModified means the file content was modified. FileModified ActionType = iota // FileCreated means the file was just created. FileCreated // FileDeleted means the file was deleted. FileDeleted )
func (ActionType) String ¶
func (t ActionType) String(filename string) string
String returns human readable form of action taken on a file.
type Observer ¶
type ReactorFn ¶
type ReactorFn func(file string, action ActionType) error
ReactorFn define a reaction function called when an observed file is modified.
func TerminateOnChangeReactor ¶
func TerminateOnChangeReactor(terminateFn func()) ReactorFn
Click to show internal directories.
Click to hide internal directories.