wiring

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package wiring is the application's configurator layer — the outermost ring of the hexagonal architecture. It constructs the Factory and wires all dependencies (driven adapters, IOStreams, build metadata) into it. The assembled Factory is returned to the caller via NewCore; the configurator does not build CLI commands, execute them, or classify errors — those executable-specific concerns belong to the binary entry point (e.g., cmd/np/main.go).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppNameFromArgs

func AppNameFromArgs(args []string) string

AppNameFromArgs derives the application name from the executable path in args (typically os.Args). It strips the directory component and, on Windows, the .exe extension, so the name matches the binary filename regardless of how it was invoked. Falls back to "app" if args is empty, which indicates an abnormal process launch.

func NewCore

func NewCore(appName string) *cmdutil.Factory

NewCore assembles the application's dependency graph and returns the wired Factory. This is the configurator's only job — it constructs infrastructure (IOStreams, Store, BuildInfo) but does not build CLI commands, execute them, or classify errors. Those responsibilities belong to the executable entry point (e.g., cmd/np/main.go).

The appName parameter identifies the binary (typically derived from os.Args[0] via AppNameFromArgs). The version is injected at build time via ldflags into the package-level variable and used automatically.

Types

This section is empty.

Jump to

Keyboard shortcuts

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