ui

package
v3.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// StaticFolder is the path to the location of the static folder from the root path of the project
	// The only reason this is exposed is to allow running tests from a different path than the root path of the project
	StaticFolder = "./web/static"

	ErrButtonValidationFailed = errors.New("invalid button configuration: missing required name or link")
)

Functions

This section is empty.

Types

type Button added in v3.8.0

type Button struct {
	Name string `yaml:"name,omitempty"` // Name is the text to display on the button
	Link string `yaml:"link,omitempty"` // Link to open when the button is clicked.
}

Button is the configuration for a button on the UI

func (*Button) Validate added in v3.8.0

func (btn *Button) Validate() error

Validate validates the button configuration

type Config

type Config struct {
	Title   string   `yaml:"title,omitempty"`   // Title of the page
	Header  string   `yaml:"header,omitempty"`  // Header is the text at the top of the page
	Link    string   `yaml:"link,omitempty"`    // Link to open when clicking on the logo
	Buttons []Button `yaml:"buttons,omitempty"` // Buttons to display below the header
}

Config is the configuration for the UI of Gatus

func GetDefaultConfig

func GetDefaultConfig() *Config

GetDefaultConfig returns a Config struct with the default values

func (*Config) ValidateAndSetDefaults

func (cfg *Config) ValidateAndSetDefaults() error

ValidateAndSetDefaults validates the UI configuration and sets the default values if necessary.

Jump to

Keyboard shortcuts

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