Documentation ¶
Overview ¶
Package conf is the configuration of the application
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsConfigModified ¶
IsConfigModified checks if the configuration file is modified
func JSONSchema ¶
JSONSchema return the json schema of the configuration
func MergeConstLabels ¶
MergeConstLabels merge const labels from all probers. Prometheus requires all metric of the same name have the same set of labels in a collector
func ResetPreviousYAMLFile ¶
func ResetPreviousYAMLFile()
ResetPreviousYAMLFile resets the previousYAMLFile
Types ¶
type Conf ¶
type Conf struct { Version string `yaml:"version" json:"version,omitempty" jsonschema:"title=Version,description=Version of the EaseProbe configuration"` HTTP []http.HTTP `yaml:"http" json:"http,omitempty" jsonschema:"title=HTTP Probe,description=HTTP Probe Configuration"` TCP []tcp.TCP `yaml:"tcp" json:"tcp,omitempty" jsonschema:"title=TCP Probe,description=TCP Probe Configuration"` Shell []shell.Shell `yaml:"shell" json:"shell,omitempty" jsonschema:"title=Shell Probe,description=Shell Probe Configuration"` Client []client.Client `yaml:"client" json:"client,omitempty" jsonschema:"title=Native Client Probe,description=Native Client Probe Configuration"` SSH ssh.SSH `yaml:"ssh" json:"ssh,omitempty" jsonschema:"title=SSH Probe,description=SSH Probe Configuration"` TLS []tls.TLS `yaml:"tls" json:"tls,omitempty" jsonschema:"title=TLS Probe,description=TLS Probe Configuration"` Host host.Host `yaml:"host" json:"host,omitempty" jsonschema:"title=Host Probe,description=Host Probe Configuration"` Ping []ping.Ping `yaml:"ping" json:"ping,omitempty" jsonschema:"title=Ping Probe,description=Ping Probe Configuration"` WebSocket []websocket.WebSocket `yaml:"websocket" json:"websocket,omitempty" jsonschema:"title=WebSocket Probe,description=WebSocket Probe Configuration"` Notify notify.Config `yaml:"notify" json:"notify,omitempty" jsonschema:"title=Notification,description=Notification Configuration"` Settings Settings `yaml:"settings" json:"settings,omitempty" jsonschema:"title=Global Settings,description=EaseProbe Global configuration"` }
Conf is Probe configuration
func (*Conf) AllNotifiers ¶
AllNotifiers return all notifiers
func (*Conf) AllProbers ¶
AllProbers return all probers
type HTTPServer ¶
type HTTPServer struct { IP string `` /* 138-byte string literal not displayed */ Port string `yaml:"port" json:"port" jsonschema:"type=integer,title=Web Server Port,description=port of the http server,default=8181"` AutoRefreshTime time.Duration `` /* 148-byte string literal not displayed */ AccessLog Log `yaml:"log" json:"log,omitempty" jsonschema:"title=Access Log,description=access log of the http server"` }
HTTPServer is the settings of http server
type Log ¶
type Log struct { Level LogLevel `` /* 162-byte string literal not displayed */ File string `yaml:"file" json:"file,omitempty" jsonschema:"title=Log File,description=the file to save the log"` SelfRotate bool `` /* 129-byte string literal not displayed */ MaxSize int `` /* 170-byte string literal not displayed */ MaxAge int `` /* 165-byte string literal not displayed */ MaxBackups int `` /* 193-byte string literal not displayed */ Compress bool `yaml:"compress" json:"compress,omitempty" jsonschema:"title=Compress,description=whether to compress the rotated log file"` Writer io.Writer `yaml:"-" json:"-"` Logger *log.Logger `yaml:"-" json:"-"` IsStdout bool `yaml:"-" json:"-"` }
Log is the log settings
func (*Log) CheckDefault ¶
func (l *Log) CheckDefault()
CheckDefault initialize the Log configuration
type LogLevel ¶
LogLevel is the log level
func (LogLevel) MarshalYAML ¶
MarshalYAML is marshal the format
func (*LogLevel) UnmarshalYAML ¶
UnmarshalYAML is unmarshal the debug level
type Notify ¶
type Notify struct { Retry global.Retry `yaml:"retry" json:"retry,omitempty" jsonschema:"title=retry,description=the retry settings"` Dry bool `` /* 155-byte string literal not displayed */ }
Notify is the settings of notification
type Probe ¶
type Probe struct { Interval time.Duration `` /* 148-byte string literal not displayed */ Timeout time.Duration `` /* 145-byte string literal not displayed */ global.StatusChangeThresholdSettings `yaml:",inline" json:",inline"` global.NotificationStrategySettings `yaml:"alert" json:"alert" jsonschema:"title=Alert,description=the alert settings"` }
Probe is the settings of prober
type Prometheus ¶
type Prometheus struct { Mode PrometheusMode `` /* 153-byte string literal not displayed */ Addr string `` /* 171-byte string literal not displayed */ PushInterval string `` /* 174-byte string literal not displayed */ }
Prometheus is the settings of prometheus
type PrometheusMode ¶
type PrometheusMode string
PrometheusMode mode enum
const ( PrometheusModePull PrometheusMode = "pull" PrometheusModePush PrometheusMode = "push" )
PrometheusMode
type SLAReport ¶
type SLAReport struct { Schedule Schedule `` /* 182-byte string literal not displayed */ Time string `` /* 144-byte string literal not displayed */ //Debug bool `yaml:"debug" json:"debug,omitempty" jsonschema:"title=Debug,description=if true the SLA report will be printed to stdout,default=false"` DataFile string `` /* 153-byte string literal not displayed */ Backups int `yaml:"backups" json:"backups,omitempty" jsonschema:"title=Backups,description=the number of backups of SLA report,default=5"` Channels []string `yaml:"channels" json:"channels,omitempty" jsonschema:"title=Channels,description=the channels of SLA report"` }
SLAReport is the settings for SLA report
type Schedule ¶
type Schedule int
Schedule is the schedule.
func (Schedule) MarshalYAML ¶
MarshalYAML marshal the configuration to yaml
func (*Schedule) UnmarshalYAML ¶
UnmarshalYAML is unmarshal the debug level
type Settings ¶
type Settings struct { Name string `` /* 132-byte string literal not displayed */ IconURL string `yaml:"icon" json:"icon,omitempty" jsonschema:"title=Icon URL,description=The URL of the icon of the EaseProbe instance"` PIDFile string `` /* 140-byte string literal not displayed */ Log Log `yaml:"log" json:"log,omitempty" jsonschema:"title=EaseProbe Log,description=The log settings of the EaseProbe instance"` TimeFormat string `` /* 164-byte string literal not displayed */ TimeZone string `` /* 178-byte string literal not displayed */ Probe Probe `` /* 133-byte string literal not displayed */ Notify Notify `` /* 137-byte string literal not displayed */ SLAReport SLAReport `` /* 132-byte string literal not displayed */ HTTPServer HTTPServer `` /* 136-byte string literal not displayed */ Prometheus Prometheus `` /* 146-byte string literal not displayed */ }
Settings is the EaseProbe configuration