shared

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ControllerFromCmd

func ControllerFromCmd(cmd *cobra.Command) (*controller.Exec, error)

ControllerFromCmd instantiates a controller.Exec configured with the shared persistent flags (run path, containerd socket) used by the parent command.

func LoggerFromCmd

func LoggerFromCmd(cmd *cobra.Command) (*slog.Logger, error)

LoggerFromCmd extracts the slog logger from the Cobra command context.

func PrintCreationOutcome

func PrintCreationOutcome(cmd *cobra.Command, label string, existsPost bool, created bool)

PrintCreationOutcome prints a human-friendly status line for a created resource.

func RequireNameArg

func RequireNameArg(cmd *cobra.Command, args []string, resource string) (string, error)

RequireNameArg ensures the first positional argument exists and returns it.

func RequireNameArgOrDefault

func RequireNameArgOrDefault(cmd *cobra.Command, args []string, resource string, fallback string) (string, error)

RequireNameArgOrDefault wraps RequireNameArg but falls back to the provided default value if no positional argument is supplied or if the argument is empty/whitespace.

Types

This section is empty.

Jump to

Keyboard shortcuts

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