_internal

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

* dor.go * process op, start, kill, restart, new

* file watcher

Index

Constants

This section is empty.

Variables

View Source
var (
	WatchFiletypes = []string{".go"} // 遍历文件夹的时候需要忽略的文件夹名字
	UnWatchRegExps = []string{}
)

Functions

func AppendUnWatchRegexps

func AppendUnWatchRegexps(exps ...string)

增加不需要监视的正则匹配表达式

func AppendWatchFiletypes

func AppendWatchFiletypes(names ...string)

增加监听的文件类型

func Exit

func Exit()

gowatch exit call this

func InitDor

func InitDor(cmdName string, cmdArgs, cmdEnvs []string)

final command will be like: "gowatch run ls -l" cmdArgs format: "", cmdEnv format: "GOOS=linux"

func NewWatcher

func NewWatcher() (*fsnotify.Watcher, error)

func OutputDefaultConf

func OutputDefaultConf(outpath string) error

func ParseConfig

func ParseConfig(fname string)

func StartWatch

func StartWatch(w *fsnotify.Watcher, paths []string, exit chan bool)

func UnixTimeDuration

func UnixTimeDuration(t1, t2 int64) time.Duration

计算时间戳的间隔

func WalkDirectoryRecursive

func WalkDirectoryRecursive(dir string, excluedPaths []string, paths *[]string)

* 递归遍历文件夹,返回所有路径,不包括需要排除的文件夹及子文件夹 * ? 返回的内容里面有重复的路径?

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

func (*Config) String

func (c *Config) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL