config

package
v4.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

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,omitempty"`

	// Metrics Whether to expose metrics at /metrics
	Metrics bool `yaml:"metrics,omitempty"`

	// 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,omitempty"`

	// 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,omitempty"`

	// Security Configuration for securing access to Gatus
	Security *security.Config `yaml:"security,omitempty"`

	// Alerting Configuration for alerting
	Alerting *alerting.Config `yaml:"alerting,omitempty"`

	// Endpoints List of endpoints to monitor
	Endpoints []*core.Endpoint `yaml:"endpoints,omitempty"`

	// 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,omitempty"`

	// Storage is the configuration for how the data is stored
	Storage *storage.Config `yaml:"storage,omitempty"`

	// Web is the web configuration for the application
	Web *web.Config `yaml:"web,omitempty"`

	// UI is the configuration for the UI
	UI *ui.Config `yaml:"ui,omitempty"`

	// Maintenance is the configuration for creating a maintenance window in which no alerts are sent
	Maintenance *maintenance.Config `yaml:"maintenance,omitempty"`

	// Remote is the configuration for remote Gatus instances
	// WARNING: This is in ALPHA and may change or be completely removed in the future
	Remote *remote.Config `yaml:"remote,omitempty"`
	// contains filtered or unexported fields
}

Config is the main configuration structure

func Load

func Load(configFile string) (*Config, error)

Load loads a custom configuration file Note that the misconfiguration of some fields may lead to panics. This is on purpose.

func LoadDefaultConfiguration

func LoadDefaultConfiguration() (*Config, error)

LoadDefaultConfiguration loads the default configuration file

func (*Config) GetEndpointByKey added in v4.1.0

func (config *Config) GetEndpointByKey(key string) *core.Endpoint

func (Config) HasLoadedConfigurationFileBeenModified

func (config Config) HasLoadedConfigurationFileBeenModified() bool

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL