config

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTolerance added in v0.6.0

func GetTolerance(schedule ScheduleConfig) time.Duration

func WithinTolerance added in v0.6.0

func WithinTolerance(now, scheduleTime time.Time, schedule ScheduleConfig) error

Types

type Alert

type Alert struct {
	HealthChecksIO *HealthChecksIO `yaml:"healthchecksio"`
	PagerDuty      *PagerDuty      `yaml:"pagerduty"`
	Slack          *Slack          `yaml:"slack"`

	Mock *MockAlerter `yaml:"mock"`
}

type Check

type Check struct {
	ID          string `yaml:"id"`
	Name        string `yaml:"name"`
	Description string `yaml:"description"`

	Schedule ScheduleConfig `yaml:"schedule"`

	Alert Alert `yaml:"alert"`
}

type Config

type Config struct {
	Checks []Check `yaml:"checks"`

	Alert  Alert        `yaml:"alert"`
	Server ServerConfig `yaml:"server"`
}

func Load

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

type EveryConfig

type EveryConfig struct {
	Interval time.Duration `yaml:"interval"`

	Start string `yaml:"start"`
	End   string `yaml:"end"`
}

type HealthChecksIO added in v0.8.0

type HealthChecksIO struct {
	ApiKey string `yaml:"apiKey"`
}

func ReadHealthChecksIOFromEnv added in v0.8.0

func ReadHealthChecksIOFromEnv() *HealthChecksIO

type MockAlerter added in v0.8.1

type MockAlerter struct{}

type PagerDuty

type PagerDuty struct {
	ApiKey           string `yaml:"apiKey"`
	EscalationPolicy string `yaml:"escalationPolicy"`

	// From is an email address of a valid user associated with the account making the request
	From string `yaml:"from"`

	RoutingKey string `yaml:"routingKey"`

	Urgency string `yaml:"urgency"`
}

func ReadPagerDutyFromEnv

func ReadPagerDutyFromEnv() *PagerDuty

type PartialDay

type PartialDay struct {
	Timezone  string   `yaml:"timezone"`
	Times     []string `yaml:"times"`
	Tolerance string   `yaml:"tolerance"`
}

func (PartialDay) GetTimes

func (t PartialDay) GetTimes() ([]time.Time, error)

type ScheduleConfig

type ScheduleConfig struct {
	Every       *EveryConfig `yaml:"every"`
	Weekdays    *PartialDay  `yaml:"weekdays"`
	BankingDays *PartialDay  `yaml:"bankingDays"`
}

type ServerConfig added in v0.2.1

type ServerConfig struct {
	BindAddress string `yaml:"bindAddress"`
}

type Slack added in v0.6.0

type Slack struct {
	ApiToken  string
	ChannelID string

	Username string
	ImageURI string
}

func ReadSlackFromEnv added in v0.6.0

func ReadSlackFromEnv() *Slack

Jump to

Keyboard shortcuts

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