Пример #1
0
func GetCheck(checkType m.CheckType, settings map[string]interface{}) (RaintankProbeCheck, error) {
	switch checkType {
	case m.PING_CHECK:
		return checks.NewRaintankPingProbe(settings)
	case m.DNS_CHECK:
		return checks.NewRaintankDnsProbe(settings)
	case m.HTTP_CHECK:
		return checks.NewRaintankHTTPProbe(settings)
	case m.HTTPS_CHECK:
		return checks.NewRaintankHTTPSProbe(settings)
	default:
		return nil, fmt.Errorf("unknown check type %s ", checkType)
	}

}
Пример #2
0
func GetCheck(checkType string, body []byte) (RaintankProbeCheck, error) {
	switch checkType {
	case "ping":
		return checks.NewRaintankPingProbe(body)
	case "dns":
		return checks.NewRaintankDnsProbe(body)
	case "http":
		return checks.NewRaintankHTTPProbe(body)
	case "https":
		return checks.NewRaintankHTTPSProbe(body)
	default:
		return nil, fmt.Errorf("unknown check type. " + checkType)
	}

}