55 lines
1.2 KiB
Go
55 lines
1.2 KiB
Go
package checker
|
|
|
|
import (
|
|
"time"
|
|
|
|
sdk "git.happydns.org/checker-sdk-go/checker"
|
|
)
|
|
|
|
// Version is reported in CheckerDefinition.Version. Overridden at build time
|
|
// by main / plugin.
|
|
var Version = "built-in"
|
|
|
|
func (p *xmppProvider) Definition() *sdk.CheckerDefinition {
|
|
return &sdk.CheckerDefinition{
|
|
ID: "xmpp",
|
|
Name: "XMPP Server",
|
|
Version: Version,
|
|
Availability: sdk.CheckerAvailability{
|
|
ApplyToService: true,
|
|
LimitToServices: []string{"abstract.XMPP"},
|
|
},
|
|
HasHTMLReport: true,
|
|
ObservationKeys: []sdk.ObservationKey{ObservationKeyXMPP},
|
|
Options: sdk.CheckerOptionsDocumentation{
|
|
RunOpts: []sdk.CheckerOptionDocumentation{
|
|
{
|
|
Id: "domain",
|
|
Type: "string",
|
|
Label: "Domain",
|
|
AutoFill: sdk.AutoFillDomainName,
|
|
Required: true,
|
|
},
|
|
{
|
|
Id: "mode",
|
|
Type: "string",
|
|
Label: "Mode",
|
|
Default: string(ModeBoth),
|
|
Choices: validModes,
|
|
},
|
|
{
|
|
Id: "timeout",
|
|
Type: "number",
|
|
Label: "Per-endpoint timeout (seconds)",
|
|
Default: 10,
|
|
},
|
|
},
|
|
},
|
|
Rules: Rules(),
|
|
Interval: &sdk.CheckIntervalSpec{
|
|
Min: 5 * time.Minute,
|
|
Max: 7 * 24 * time.Hour,
|
|
Default: 6 * time.Hour,
|
|
},
|
|
}
|
|
}
|