app

package
v0.10.0-dev.15 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package app is subflux's composition root: the one boot path, the supervision of every long-running component, and the drain.

Index

Constants

This section is empty.

Variables

View Source
var DefaultPaths = Paths{Config: "/config/config.yaml", Health: health.DefaultPath}

DefaultPaths are the container layout.

Functions

func Run

func Run(ctx context.Context, cfg Config) error

Run boots and serves until ctx ends or a component returns, then drains. It returns a boot failure (the TCP bind included), the component's return that began the drain ("<name> exited" when it returned nil), or a drain overrun; nil when ctx's end began the drain. cmd/subflux exits 1 on any error.

Types

type Config

type Config struct {
	Registries settings.Registries
	// Listener, when set, replaces binding the HTTP port (tests).
	Listener net.Listener
	// LogOutput is where the process logs; nil is stderr.
	LogOutput io.Writer
	// Routes, when set, adds routes to the mux before serving (tests).
	Routes func(*http.ServeMux)
	// Settings, when set, receives the settings service once it is built, so
	// a test can save through it.
	Settings func(*settings.Service)
	Paths    Paths
}

Config is what Run boots from. Every field but Paths is optional.

type Paths

type Paths struct {
	Config string
	// Health is the liveness marker the health subcommand stats.
	Health string
}

Paths are the files the process reads and writes.

Jump to

Keyboard shortcuts

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