Documentation
¶
Overview ¶
Package gaper implements a supervisor restarts a go project when it crashes or a watched file changes
Index ¶
Constants ¶
View Source
const OSWindows = "windows"
OSWindows is used to check if current OS is a Windows
Variables ¶
View Source
var ( NoRestartOnError = "error" NoRestartOnSuccess = "success" NoRestartOnExit = "exit" )
No restart types
View Source
var DefaultBuildPath = "."
DefaultBuildPath is the default build and watched path
View Source
var DefaultExtensions = []string{"go", "yml"}
DefaultExtensions is the default watched extension
View Source
var DefaultPoolInterval = 500
DefaultPoolInterval is the time in ms used by the watcher to wait between scans
Functions ¶
Types ¶
type Builder ¶
Builder is a interface for the build process
type Config ¶
type Config struct {
BinName string
BuildPath string
BuildArgs []string
BuildArgsMerged string
ProgramArgs []string
ProgramArgsMerged string
WatchItems []string
IgnoreItems []string
PollInterval int
Extensions []string
NoRestartOn string
DisableDefaultIgnore bool
WorkingDirectory string
}
Config contains all settings supported by gaper
type Runner ¶
type Runner interface {
Run() (*exec.Cmd, error)
Kill() error
Errors() chan error
Exited() bool
IsRunning() bool
ExitStatus(err error) int
}
Runner is a interface for the run process
type Watcher ¶
Watcher is a interface for the watch process
func NewWatcher ¶
func NewWatcher(cfg WatcherConfig) (Watcher, error)
NewWatcher creates a new watcher
Source Files
¶
- builder.go
- gaper.go
- runner.go
- watcher.go
Click to show internal directories.
Click to hide internal directories.