Documentation ¶
Index ¶
- Constants
- Variables
- func ParseSmtpAuth(cfg ConfigSmtp) smtp.Auth
- func RunWeb(config ConfigWeb, instance *PingoInstance) error
- func TargetTimeserie(length int, ticker timeserie.Ticker) *timeserie.Timeserie
- type Alerts
- type ByName
- type Config
- type ConfigSmtp
- type ConfigTarget
- type ConfigWeb
- type HttpProbe
- type IndexData
- type IndexDataTarget
- type Instance
- type PingoInstance
- type Probe
- type ProbeError
- type TargetEntry
- type TargetState
- type TargetStatus
- type Webhook
Constants ¶
View Source
const DEFAULT_CONFIG_FILE_CONTENT = `` /* 320-byte string literal not displayed */
View Source
const TPL_INDEX = `` /* 1487-byte string literal not displayed */
View Source
const TPL_STYLE_CSS = `` /* 1799-byte string literal not displayed */
View Source
const TypeHttp = "http"
View Source
const TypeHttps = "https"
View Source
const TypeTcp = "tcp"
View Source
const TypeTls = "tls"
Variables ¶
View Source
var ( ErrUnreachable = &ProbeError{message: "unreachble host"} ErrUnknown = &ProbeError{message: "unknown"} ErrNotImplemented = &ProbeError{message: "not implemented"} )
Functions ¶
func ParseSmtpAuth ¶
func ParseSmtpAuth(cfg ConfigSmtp) smtp.Auth
func RunWeb ¶
func RunWeb(config ConfigWeb, instance *PingoInstance) error
Types ¶
type ByName ¶
type ByName []IndexDataTarget
ByAge implements sort.Interface for []Person based on the Age field.
type Config ¶
type Config struct { Web ConfigWeb Smtp ConfigSmtp Targets map[string]ConfigTarget Alerts Alerts }
func LoadOrInitFile ¶
type ConfigSmtp ¶
type ConfigTarget ¶
type IndexData ¶
type IndexData struct { Now string Targets []IndexDataTarget }
type IndexDataTarget ¶
type PingoInstance ¶
type PingoInstance struct {
Targets map[string]*TargetEntry
}
func NewPingoInstance ¶
func NewPingoInstance(config Config) (*PingoInstance, error)
func (*PingoInstance) LogState ¶
func (this *PingoInstance) LogState()
func (*PingoInstance) Run ¶
func (this *PingoInstance) Run() error
func (*PingoInstance) State ¶
func (this *PingoInstance) State() map[string]TargetState
type Probe ¶
type Probe interface {
Test() *ProbeError
}
func MakeProbe ¶
func MakeProbe(target ConfigTarget) (res Probe, err error)
type ProbeError ¶
type ProbeError struct {
// contains filtered or unexported fields
}
func (*ProbeError) Error ¶
func (err *ProbeError) Error() string
type TargetEntry ¶
type TargetEntry struct { Probe Probe State TargetState PollingInterval time.Duration }
type TargetState ¶
type TargetState struct { Config ConfigTarget LastCheck time.Time LastChange time.Time Status TargetStatus Reason string Timeseries map[string]*timeserie.Timeserie }
type TargetStatus ¶
type TargetStatus int
const ( TargetStatusUnknown TargetStatus = 0 TargetStatusOk TargetStatus = 1 TargetStatusError TargetStatus = 2 )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.