app

package
v0.0.124 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: GPL-3.0 Imports: 41 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 app wires the server process: it builds every store, service and handler from the configuration (one builder per subsystem), refuses to boot while a dependency production needs is missing, runs the background workers and the HTTP server, and shuts everything down in order. cmd/server is only the process entry point around it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HealthCheck

func HealthCheck() int

HealthCheck is the `ex healthcheck` subcommand: a single GET against the local /healthz endpoint, returning a process exit code — 0 when the server reports healthy (HTTP 200), 1 otherwise. It is the binary's built-in answer to a Docker HEALTHCHECK on the distroless runtime, which has no shell or wget to probe the endpoint itself.

func SetupLogging

func SetupLogging(cfg *config.Config, w io.Writer)

SetupLogging installs the process logger: structured JSON on w everywhere except local dev, so the deployment's log pipeline can parse level/msg/fields instead of scraping text lines. Dev keeps slog's default human-readable output untouched.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App is one wired server process.

func New

func New(ctx context.Context, cfg *config.Config, frontend fs.FS) (*App, error)

New builds the whole process from cfg. frontend is the embedded build output (its "dist" directory holds the SPA). Any failure — including a dependency left unwired — aborts the boot with an error naming it.

func (*App) Run

func (a *App) Run(quit <-chan os.Signal) error

Run starts the background workers and serves HTTP until a signal arrives on quit, then shuts down in order and returns. It returns early with the error when the server cannot listen or stops serving.

Jump to

Keyboard shortcuts

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