15 lines
238 B
Go
15 lines
238 B
Go
|
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)
|
||
|
}
|
||
|
}
|