cfha/engine/check.go

25 lines
477 B
Go
Raw Permalink Normal View History

2015-08-23 03:20:58 +00:00
package engine
import (
"log"
"fmt"
2015-08-23 03:20:58 +00:00
"time"
"../core"
"../checks"
)
func createCheck(engine *core.Engine, host core.TargetConfig) *core.GenericCheck {
log.Print("createCheck called")
log.Print(fmt.Sprintf("creating a `%s`", host.Type))
2015-08-23 03:20:58 +00:00
config := core.CheckCreateConfig{
engine,
time.Duration(int64(host.Interval)) * time.Second,
2015-08-23 03:20:58 +00:00
host,
}
switch host.Type {
case "http", "https":
return checks.NewHttpChecker(config)
2015-08-23 03:20:58 +00:00
}
return nil
2015-08-23 03:20:58 +00:00
}