alrm/check.go

15 lines
238 B
Go
Raw Normal View History

2020-08-20 08:44:56 -08:00
package main
import (
"fmt"
)
func NewCheck(name string, addr string) (AlrmCheck, error) {
switch name {
case "ping":
return &CheckPing{Address: addr}, nil
default:
return nil, fmt.Errorf("unknown check name \"%s\"", name)
}
}