Esempio n. 1
0
func New(id int, workerQueue chan chan Request) Worker {
	return Worker{
		ID:          id,
		Work:        make(chan Request),
		WorkerQueue: workerQueue,
		QuitChan:    make(chan bool),
		Parser:      parser.New(),
	}
}
Esempio n. 2
0
func New() (Watcher, error) {
	w := Watcher{}
	intervalList, err := intervals.GetAll().List()
	if err != nil {
		return w, err
	}
	w.Intervals = intervalList
	w.Cron = cron.New()
	w.DigParser = digParser.New()
	w.WhoisParser = whoisParser.New()
	return w, nil
}