Documentation ¶
Overview ¶
Package rizla contains the source code of the rizla project
Index ¶
- Variables
- func Add(proj ...*Project)
- func DefaultGoMatcher(fullname string) bool
- func DefaultOnReload(p *Project) func(string)
- func DefaultOnReloaded(p *Project) func(string)
- func DefaultWatcher(abs string) bool
- func Len() int
- func RemoveAll()
- func Run(sources ...string)
- func Stop()
- type MatcherFunc
- type Printer
- type Project
Constants ¶
This section is empty.
Variables ¶
var DefaultDisableProgramRerunOutput = false
DefaultDisableProgramRerunOutput a long name but, it disables the output of the program's 'messages' after the first successfully run for each of the projects the project iteral can be override this value. set to true to disable the program's output when reloads
var ( // Out The Printer output for watcher errors // set this by rizla.NewPrinter(*os.File) Out = NewPrinter(os.Stdout) )
Functions ¶
func DefaultGoMatcher ¶
DefaultGoMatcher is the default Matcher for the Project iteral
func DefaultOnReload ¶
DefaultOnReload fired when file has changed and reload going to happens
func DefaultOnReloaded ¶
DefaultOnReloaded fired when reload has been finished
func DefaultWatcher ¶
DefaultWatcher is the default Watcher for the Project iteral allows all subdirs except .git, node_modules and vendor
func RemoveAll ¶
func RemoveAll()
RemoveAll clears the current projects, doesn't stop them if running
Types ¶
type MatcherFunc ¶
MatcherFunc returns whether the file should be watched for the reload
type Printer ¶
Printer the printer for a rizla instance
type Project ¶
type Project struct { // optional Name for the project Name string // MainFile is the absolute path of the go project's main file source. MainFile string Args []string // The Output destination (sent by rizla and your program) Out *Printer // The Err Output destination (sent on rizla errors and your program's errors) Err *Printer // Watcher accepts subdirectories by the watcher // executes before the watcher starts, // if return true, then this (absolute) subdirectory is watched by watcher // the default accepts all subdirectories but ignores the ".git", "node_modules" and "vendor" Watcher MatcherFunc Matcher MatcherFunc // AllowReloadAfter skip reload on file changes that made too fast from the last reload // minimum allowed duration is 3 seconds. AllowReloadAfter time.Duration // OnReload fires when when file has been changed and rizla is going to reload the project // the parameter is the changed file name OnReload func(string) // OnReloaded fires when rizla finish with the reload // the parameter is the changed file name OnReloaded func(string) // DisableRuntimeDir set to true to disable adding subdirectories into the watcher, when a folder created at runtime // set to true to disable the program's output when reloads // defaults to false DisableRuntimeDir bool // DisableProgramRerunOutput a long name but, it disables the output of the program's 'messages' after the first successfully run // defaults to false DisableProgramRerunOutput bool // contains filtered or unexported fields }
Project the struct which contains the necessary fields to watch and reload(rerun) a go project
func NewProject ¶
NewProject returns a simple project iteral which doesn't needs argument parameters and has the default file matcher ( which is valid if you want to reload only on .Go files).
You can change all of its fields before the .Run function.