Documentation
¶
Index ¶
- Constants
- func DoAlert(alert *Alert, check *Check, result *CheckResult, db *sql.DB) error
- func Launch(cfgPath string)
- type Alert
- type AlertFunc
- type Check
- type CheckFunc
- type CheckId
- type CheckResult
- type CheckResults
- type CheckStatus
- type Config
- type Controller
- type ControllerConfig
- type ControllerRequest
- type ControllerResponse
- type DNSConfig
- type DefaultConfig
- type DnsCheckParams
- type HttpCheckParams
- type IcmpCheckParams
- type SmtpConfig
- type SslExpireCheckParams
- type TcpCheckParams
- type TwilioConfig
- type ViewServer
- type ViewServerConfig
- type Worker
- type WorkerConfig
Constants ¶
View Source
const ( StatusOffline CheckStatus = "offline" StatusOnline = "online" StatusFail = "fail" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Check ¶
type Check struct {
Id CheckId
Name string
Type string
Data string
Interval int
Delay int
Status CheckStatus
Lock string
LockTime time.Time
LastWorker string
LastTime time.Time
TurnSet map[string]bool
TurnCount int
LastStatusChange time.Time
}
func (*Check) SetStatusFromString ¶
type CheckResult ¶
type CheckResult struct {
Status CheckStatus `json:"status"`
Message string `json:"message"`
}
func DoCheck ¶
func DoCheck(check *Check) *CheckResult
type CheckResults ¶
type CheckResults map[CheckId]*CheckResult
func (CheckResults) MarshalJSON ¶
func (results CheckResults) MarshalJSON() ([]byte, error)
func (CheckResults) UnmarshalJSON ¶
func (results CheckResults) UnmarshalJSON(bytes []byte) error
type CheckStatus ¶
type CheckStatus string
type Config ¶
type Config struct {
Default DefaultConfig
Controller ControllerConfig
Worker WorkerConfig
Smtp SmtpConfig
DNS DNSConfig
Twilio TwilioConfig
ViewServer ViewServerConfig
}
func LoadConfig ¶
type Controller ¶
type Controller struct {
Addr string
Databases []*sql.DB
Confirmations int
// contains filtered or unexported fields
}
func (*Controller) GetCheck ¶
func (this *Controller) GetCheck(checkId CheckId) *Check
func (*Controller) Start ¶
func (this *Controller) Start()
type ControllerConfig ¶
type ControllerRequest ¶
type ControllerRequest struct {
Results CheckResults `json:"results"`
Count int `json:"count"`
}
func MakeControllerRequest ¶
func MakeControllerRequest() *ControllerRequest
type ControllerResponse ¶
type ControllerResponse struct {
Checks []CheckId `json:"checks"`
}
type DefaultConfig ¶
type DnsCheckParams ¶
type HttpCheckParams ¶
type HttpCheckParams struct {
Url string `json:"url"`
Method string `json:"method"`
Body string `json:"body"`
Headers map[string]string `json:"headers"`
Timeout int `json:"timeout"`
Insecure bool `json:"insecure"`
Username string `json:"username"`
Password string `json:"password"`
ExpectStatus int `json:"expect_status"`
ExpectSubstring string `json:"expect_substring"`
}
type IcmpCheckParams ¶
type SmtpConfig ¶
type SslExpireCheckParams ¶
type TcpCheckParams ¶
type TwilioConfig ¶
type ViewServer ¶
type ViewServer struct {
Addr string
Controllers []string
// contains filtered or unexported fields
}
func (*ViewServer) Start ¶
func (this *ViewServer) Start()
type ViewServerConfig ¶
type Worker ¶
type Worker struct {
ViewAddr string
Controller *Controller
NumThreads int
// contains filtered or unexported fields
}
type WorkerConfig ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.