config

package
v0.78.2 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: AGPL-3.0 Imports: 3 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 holds pipeline-analytics' runtime configuration.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAddrRequired                 = errors.New("addr must not be empty")
	ErrDBPathRequired               = errors.New("db path must not be empty")
	ErrCallbackURLRequired          = errors.New("callback url must not be empty")
	ErrEncryptionKeyInvalid         = errors.New("encryption key must decode to 32 bytes")
	ErrReconcileIntervalNonPositive = errors.New("reconcile interval must be positive")
	ErrDrainPeriodNegative          = errors.New("drain period must not be negative")
	ErrShutdownTimeoutNonPositive   = errors.New("shutdown timeout must be positive")
)

Sentinel validation errors, so a caller can errors.Is against a specific missing field instead of matching on message text.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addr   string
	DBPath string
	// CallbackURL is this server's own public base URL, used to build the
	// webhook callback URL registered on each tracked repo.
	CallbackURL string
	// EncryptionKey is the 32-byte AES-256 key repo tokens are encrypted
	// under at rest.
	EncryptionKey []byte
	// ReconcileInterval is how often reconciliation polling runs against
	// every tracked repo (forge-ingestion/spec.md requires at least
	// hourly).
	ReconcileInterval time.Duration
	// DrainPeriod is how long the server keeps serving after a shutdown
	// signal, with /readyz already answering 503, so a router polling it
	// notices before the listener closes (api.md's /readyz bullet). Zero
	// skips the wait.
	DrainPeriod time.Duration
	// ShutdownTimeout bounds how long in-flight requests get to finish once
	// the drain is over, so a request that never ends can't hold the process
	// open.
	ShutdownTimeout time.Duration
	// LogLevel is the minimum slog level the server logs at.
	LogLevel slog.Level
}

Config is the server's runtime configuration, sourced from flags, the environment, and (optionally) a config file, in that precedence.

func (Config) Validate

func (c Config) Validate() error

Validate reports the first invalid or missing required field, if any.

Jump to

Keyboard shortcuts

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