Documentation ¶
Overview ¶
* dor.go * process op, start, kill, restart, new
* file watcher
Index ¶
- Variables
- func AppendUnWatchRegexps(exps ...string)
- func AppendWatchFiletypes(names ...string)
- func Exit()
- func InitDor(cmdName string, cmdArgs, cmdEnvs []string)
- func NewWatcher() (*fsnotify.Watcher, error)
- func OutputDefaultConf(outpath string) error
- func ParseConfig(fname string)
- func StartWatch(w *fsnotify.Watcher, paths []string, exit chan bool)
- func UnixTimeDuration(t1, t2 int64) time.Duration
- func WalkDirectoryRecursive(dir string, excluedPaths []string, paths *[]string)
- type Config
Constants ¶
This section is empty.
Variables ¶
View Source
var ( WatchFiletypes = []string{".go"} // 遍历文件夹的时候需要忽略的文件夹名字 UnWatchRegExps = []string{} )
Functions ¶
func InitDor ¶
final command will be like: "gowatch run ls -l" cmdArgs format: "", cmdEnv format: "GOOS=linux"
func NewWatcher ¶
func OutputDefaultConf ¶
func ParseConfig ¶
func ParseConfig(fname string)
func WalkDirectoryRecursive ¶
* 递归遍历文件夹,返回所有路径,不包括需要排除的文件夹及子文件夹 * ? 返回的内容里面有重复的路径?
Types ¶
type Config ¶
type Config struct { ExcludedRegexps []string `yaml:"excluded_regexps"` // 需要追加监听的文件后缀名字,默认是'.go', ExternPaths []string `yaml:"extern_paths"` // 额外需要监听的路径 ExcludedPaths []string `yaml:"excluded_paths"` // 不需要监听的目录 Envs []string `yaml:"envs"` // 执行时追加的环境变量 }
func GetInstance ¶
func GetInstance() *Config
Click to show internal directories.
Click to hide internal directories.