go-core

module
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: Apache-2.0

README

go-core

Core SDK for Standards Lab's Go Elemental standard: layered configuration, process lifecycle, and logging.

github.com/standards-lab/go-core is a single Go module with the process-level packages every program in the standard builds on.

Standard

go-core is the Core SDK of Go Elemental, the minimal-dependency Go standard, and its design is documented on the standard's go-core page. It enhances the standard's dependency line: where Go Elemental admits packages as idiomatic and stable as the standard library, this repository depends on the standard library alone.

Packages

  • config — loads configuration in layers: a base file, an environment overlay, and secrets.
  • lifecycle — starts subsystems concurrently, tracks and reports readiness as subsystem status changes, and shuts down within a timeout.
  • logging — builds an *slog.Logger from a configuration that config loads.
  • process — the parts of a binary's main sequence that run before the program's own infrastructure exists: the signal-derived root context, pre-logger failure reporting, and the exit-code convention.
  • process/processtest — the integration toolkit: builds a program once per suite run, runs it as a subprocess, waits on what a client observes, interrupts it and reads its exit code, and relays a backing service's connection so a test can sever it.

Development

Tasks run through mise:

mise run test

License

Apache License 2.0.

Directories

Path Synopsis
Package config loads layered JSON configuration and defines the contract a configuration type implements to take part in that load.
Package config loads layered JSON configuration and defines the contract a configuration type implements to take part in that load.
Package lifecycle hosts process startup, readiness, and graceful shutdown.
Package lifecycle hosts process startup, readiness, and graceful shutdown.
Package logging constructs the *slog.Logger a process writes through, from a configuration that takes part in the layered load.
Package logging constructs the *slog.Logger a process writes through, from a configuration that takes part in the layered load.
Package process holds the parts of a binary's main sequence that run before the program's own infrastructure exists: reporting a failure or a usage error when there is no logger yet, the signal-derived root context, and the exit-code convention the reporters return.
Package process holds the parts of a binary's main sequence that run before the program's own infrastructure exists: reporting a failure or a usage error when there is no logger yet, the signal-derived root context, and the exit-code convention the reporters return.
processtest
Package processtest is the integration toolkit for a program built on the process package: it runs the program as the binary and drives it only through the seams a terminal or an orchestrator uses, so nothing in the runtime exists for the tests' sake.
Package processtest is the integration toolkit for a program built on the process package: it runs the program as the binary and drives it only through the seams a terminal or an orchestrator uses, so nothing in the runtime exists for the tests' sake.
processtest/internal/testprog command
Command testprog is the program the processtest package's own tests run: it answers on a loopback address, waits for the interrupt, and exits with the code its environment names, so the runner is proved against a real subprocess without a service behind it.
Command testprog is the program the processtest package's own tests run: it answers on a loopback address, waits for the interrupt, and exits with the code its environment names, so the runner is proved against a real subprocess without a service behind it.

Jump to

Keyboard shortcuts

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