root

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

Package root constructs the root command that assembles all subcommands and defines cross-cutting behavior in the Before hook (signal handling and schema version gating). Every command that opens the database is checked against the minimum required schema version before proceeding; np admin upgrade and np admin doctor are exempt so they can operate on pre-migration databases.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRootCmd

func NewRootCmd(f *cmdutil.Factory) *cli.Command

NewRootCmd constructs the root command with all subcommands registered. The Factory is passed to each subcommand constructor, allowing them to extract only the dependencies they need. The Before hook runs before every subcommand and enriches the context with cross-cutting concerns (signal handling and schema version gating); the After hook tears down infrastructure started in Before.

Types

This section is empty.

Jump to

Keyboard shortcuts

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