config

package
v0.0.0-...-79e566f Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Octopus     *Octopus     `yaml:"octopus"`
	HealthCheck *HealthCheck `yaml:"healthcheck"`
}

Config holds our configuration settings

OCTOMON_OCTOPUS_ADDRESS
OCTOMON_OCTOPUS_APIKEY
OCTOMON_HEALTHCHECK_INTERVAL
OCTOMON_HEALTHCHECK_STUCKTASKS_WARNINGCANCELLINGDURATION

func New

func New() *Config

New starts with a default config that works with a public demo Octopus Deploy server, then overrides settings from a YAML config file and env vars if they exist.

func (*Config) Dump

func (c *Config) Dump() string

Dump returns the Octopus configuration in YAML string form

type HealthCheck

type HealthCheck struct {
	Interval   time.Duration `yaml:"interval" default:"60s"`
	Version    *Version
	StuckTasks *StuckTasks
}

HealthCheck holds health check settings

type Octopus

type Octopus struct {
	Address string `yaml:"address" default:"https://demo.octopus.com"`
	APIKey  string `yaml:"apikey" default:"API-GUEST"`
}

Octopus holds our octopus settings

type StuckTasks

type StuckTasks struct {
	WarningCancellingDuration  time.Duration `yaml:"warning_cancelling_duration" default:"5m"`
	FailureCancellingDuration  time.Duration `yaml:"failure_cancelling_duration" default:"30m"`
	WarningInterruptedDuration time.Duration `yaml:"warning_interrupted_duration" default:"1h"`
	FailureInterruptedDuration time.Duration `yaml:"failure_interrupted_duration" default:"6h"`
}

StuckTasks is the configuration for the stuck tasks health check

type Version

type Version struct {
	Minimum string `yaml:"minimum" default:"0.0.0"`
}

Version is the configuration for the version health check

Jump to

Keyboard shortcuts

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