Documentation
¶
Overview ¶
Package conf is the configuration of the application
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSONSchema ¶ added in v1.9.0
JSONSchema return the json schema of the configuration
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"`
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 ¶ added in v1.2.0
AllNotifiers return all notifiers
func (*Conf) AllProbers ¶ added in v1.2.0
AllProbers return all probers
func (*Conf) InitAllLogs ¶ added in v1.5.0
func (conf *Conf) InitAllLogs()
InitAllLogs initialize all logs
type HTTPServer ¶ added in v1.4.0
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 ¶ added in v1.5.0
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 ¶ added in v1.5.0
func (l *Log) CheckDefault()
CheckDefault initialize the Log configuration
func (*Log) ConfigureLogger ¶ added in v1.5.0
func (l *Log) ConfigureLogger()
ConfigureLogger configure the logger
type LogLevel ¶
LogLevel is the log level
func (LogLevel) MarshalYAML ¶ added in v1.5.0
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"`
}
Probe is the settings of prober
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 `yaml:"data" json:"data,omitempty" jsonschema:"title=Data File,description=the data file of SLA report, absolute path"`
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 ¶ added in v1.8.0
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 `` /* 134-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 */
}
Settings is the EaseProbe configuration