Documentation ¶
Overview ¶
Package watcher is used for watching files and directories for automatic recompilation and restart of app on change when in development mode.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Type ¶
type Type struct {
// contains filtered or unexported fields
}
Type is a watcher type that allows registering new pattern - actions pairs.
func (*Type) Listen ¶
Listen gets a pattern and a function. The function will be executed when files matching the pattern will be modified.
func (*Type) ListenFile ¶
ListenFile is equivalent of Listen but for files. If file is added using ListenFile and the same file is within a pattern of Listen, only the first one will trigger restarts. I.e. we have the following calls:
w.Listen("./", fn1) w.ListenFile("./goal.yml", fn2)
If "goal.yml" file is modified fn2 will be triggered. fn1 may be triggered by changes in any file inside "./" directory except "goal.yml".
func (*Type) NotifyOnUpdate ¶
NotifyOnUpdate starts the function every time a file change event is received. Start it as a goroutine.