config

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MinAuthTokenLength is the minimum accepted bearer token length.
	MinAuthTokenLength = 32
	// MaxAuthTokenLength is the maximum accepted bearer token length.
	MaxAuthTokenLength = 4096
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AppData

type AppData struct {
	Version    string
	SiteRoot   string
	CheckInURL string
	StatusURL  string
}

AppData contains application links exposed to notification templates.

func NewAppData

func NewAppData(version, siteRoot, routePrefix, checkInPath string) AppData

NewAppData builds template app data from normalized application settings.

type CheckInConfig

type CheckInConfig struct {
	Name          string
	Path          string
	ExpectedEvery time.Duration
	AlertingDelay time.Duration
	StartActive   bool
	AllowGET      bool
}

CheckInConfig contains the check-in schedule and endpoint configuration.

type Config

type Config struct {
	ListenAddr       *net.TCPAddr
	RoutePrefix      string
	SiteRoot         string
	ResponseDetails  bool
	AuthToken        string
	Debug            bool
	LogFormat        logging.LogFormat
	CheckIn          CheckInConfig
	Notifications    Notifications
	OverriddenValues map[string]any
}

Config contains the fully normalized runtime configuration.

type EmailConfig

type EmailConfig struct {
	Name              string
	Host              string
	Port              int
	User              string
	Pass              string
	SMTPTLSSkipVerify bool
	SendResolved      bool
	From              string
	To                []string
	Headers           map[string]string
	TitleTemplate     string
	Template          string
	CustomData        map[string]string
}

EmailConfig contains one configured email notification target.

type Notifications

type Notifications struct {
	App      AppData
	Webhooks []WebhookConfig
	Emails   []EmailConfig
}

Notifications contains all configured notification targets.

type WebhookConfig

type WebhookConfig struct {
	Name              string
	URL               string
	Method            string
	Headers           map[string]string
	Timeout           time.Duration
	TLSSkipVerify     bool
	SendResolved      bool
	TitleTemplate     string
	Template          string
	CustomData        map[string]string
	LogResponse       WebhookLogResponse
	ResponseBodyLimit int
}

WebhookConfig contains one configured webhook notification target.

type WebhookLogResponse

type WebhookLogResponse string

WebhookLogResponse controls how much of a webhook response is logged on success.

const (
	// WebhookLogResponseSummary logs only status, status code, duration, and truncation state.
	WebhookLogResponseSummary WebhookLogResponse = "summary"
	// WebhookLogResponseBody logs status fields and response body, but not response headers.
	WebhookLogResponseBody WebhookLogResponse = "body"
	// WebhookLogResponseFull logs status fields, response body, and response headers.
	WebhookLogResponseFull WebhookLogResponse = "full"
	// WebhookLogResponseNone suppresses successful webhook response logs.
	WebhookLogResponseNone WebhookLogResponse = "none"
)

Jump to

Keyboard shortcuts

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