Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultConfigurationFilePath is the default path that will be used to search for the configuration file // if a custom path isn't configured through the GATUS_CONFIG_FILE environment variable DefaultConfigurationFilePath = "config/config.yaml" // DefaultFallbackConfigurationFilePath is the default fallback path that will be used to search for the // configuration file if DefaultConfigurationFilePath didn't work DefaultFallbackConfigurationFilePath = "config/config.yml" )
Variables ¶
View Source
var ( // ErrNoEndpointInConfig is an error returned when a configuration file has no endpoints configured ErrNoEndpointInConfig = errors.New("configuration file should contain at least 1 endpoint") // ErrConfigFileNotFound is an error returned when the configuration file could not be found ErrConfigFileNotFound = errors.New("configuration file not found") // ErrInvalidSecurityConfig is an error returned when the security configuration is invalid ErrInvalidSecurityConfig = errors.New("invalid security configuration") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Debug Whether to enable debug logs Debug bool `yaml:"debug"` // Metrics Whether to expose metrics at /metrics Metrics bool `yaml:"metrics"` // SkipInvalidConfigUpdate Whether to make the application ignore invalid configuration // if the configuration file is updated while the application is running SkipInvalidConfigUpdate bool `yaml:"skip-invalid-config-update"` // DisableMonitoringLock Whether to disable the monitoring lock // The monitoring lock is what prevents multiple endpoints from being processed at the same time. // Disabling this may lead to inaccurate response times DisableMonitoringLock bool `yaml:"disable-monitoring-lock"` // Security Configuration for securing access to Gatus Security *security.Config `yaml:"security"` // Alerting Configuration for alerting Alerting *alerting.Config `yaml:"alerting"` // Endpoints List of endpoints to monitor Endpoints []*core.Endpoint `yaml:"endpoints"` // Services List of endpoints to monitor // // XXX: Remove this in v5.0.0 // XXX: This is not a typo -- not v4.0.0, but v5.0.0 -- I want to give enough time for people to migrate // // Deprecated in favor of Endpoints Services []*core.Endpoint `yaml:"services"` // Storage is the configuration for how the data is stored Storage *storage.Config `yaml:"storage"` // Web is the web configuration for the application Web *web.Config `yaml:"web"` // UI is the configuration for the UI UI *ui.Config `yaml:"ui"` // Maintenance is the configuration for creating a maintenance window in which no alerts are sent Maintenance *maintenance.Config `yaml:"maintenance"` // contains filtered or unexported fields }
Config is the main configuration structure
func Load ¶
Load loads a custom configuration file Note that the misconfiguration of some fields may lead to panics. This is on purpose.
func LoadDefaultConfiguration ¶
LoadDefaultConfiguration loads the default configuration file
func (Config) HasLoadedConfigurationFileBeenModified ¶
HasLoadedConfigurationFileBeenModified returns whether the file that the configuration has been loaded from has been modified since it was last read
func (*Config) UpdateLastFileModTime ¶
func (config *Config) UpdateLastFileModTime()
UpdateLastFileModTime refreshes Config.lastFileModTime
Click to show internal directories.
Click to hide internal directories.