Documentation ¶
Overview ¶
Package watcher provides a tool for automatically running a custom command or running a custom method when detected file's changing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutoCommand ¶
type AutoCommand struct {
// contains filtered or unexported fields
}
func NewAutoCommand ¶
func NewAutoCommand(exts []string, errHandle func(e error)) *AutoCommand
Param exts provides the file name extensions for file watcher. Param errHandle is used to handle incoming errors.
func (*AutoCommand) RunCommand ¶
func (b *AutoCommand) RunCommand(command string, args ...string)
RunCommand depends on RunFunc, the given command will be run when file watcher detected file changing.
func (*AutoCommand) RunFunc ¶
func (b *AutoCommand) RunFunc(h func())
RunFunc runs the h when detected file changing. This function will wait for interrupt or terminate signal.
func (*AutoCommand) Watch ¶
func (b *AutoCommand) Watch(dir ...string)
Watch provides the directories which need to listen
Click to show internal directories.
Click to hide internal directories.