Documentation ¶
Overview ¶
Watcher is a command line tool inspired by fresh (https://github.com/pilu/fresh) and used for watching .go file changes, and restarting the app in case of an update/delete/add operation. After you installed it, you can run your apps with their default parameters as: watcher -c config -p 7000 -h localhost
Package watcher watches all file changes via fsnotify package and sends update events to builder
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrPathNotSet = errors.New("gopath not set")
GoPath not set error
Functions ¶
Types ¶
type Params ¶
type Params struct { // Package parameters Package []string // Go-Watcher parameters System map[string]string }
func NewParams ¶
func NewParams() *Params
NewParams creates a new instance of Params and returns the pointer
func PrepareArgs ¶
PrepareArgs filters the system parameters from package parameters and returns Params instance
func (*Params) CloneRun ¶
func (p *Params) CloneRun()
CloneRun copies run parameter value to watch parameter in-case watch parameter does not exist
func (*Params) GetPackage ¶
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner listens change events and depending on that kills the obsolete process, and runs the new one
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher watches the file change events from fsnotify and sends update messages. It is also used as a fsnotify.Watcher wrapper
func MustRegisterWatcher ¶
MustRegisterWatcher creates a new Watcher and starts listening given folders