config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package config loads server configuration from WORKLY_* environment variables. Command-line flags override these values in cmd/workly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Port          int
	DatabaseURL   string
	APIKey        string
	SigningSecret string
	// PreviousSigningSecret also signs deliveries during a secret rotation.
	PreviousSigningSecret string
	LogLevel              slog.Level
	LogFormat             string // "json" or "text"
	AutoMigrate           bool
	AutoCreateQueues      bool
	MaxPayloadBytes       int64
	// MaxInFlight caps concurrent task deliveries across all queues.
	MaxInFlight int
	// Retention is how long finished tasks are kept. 0 keeps them forever.
	Retention time.Duration
	// RunRetention is how long finished schedule runs are kept. It
	// defaults to Retention. 0 keeps them forever.
	RunRetention time.Duration
	// MetricsPort, if set, serves /metrics on its own port without
	// authentication instead of on Port.
	MetricsPort int
	// ShutdownTimeout is how long in-flight requests and deliveries get to
	// finish on shutdown.
	ShutdownTimeout time.Duration
	// MCP sets which tools /mcp serves: read-only (the default), full or off.
	MCP mcp.Mode
	// PublicURL is where people open Workly; alerts link to it.
	PublicURL string
	// SMTPURL, if set, sends alert emails through this server, from
	// SMTPFrom.
	SMTPURL  string
	SMTPFrom string
}

func Default

func Default() Config

func Load

func Load(getenv func(string) string) (Config, error)

Load returns Default() overridden by any WORKLY_* variables found via getenv.

func (Config) Validate

func (c Config) Validate() error

Jump to

Keyboard shortcuts

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