examples/

directory
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT

Directories

Path Synopsis
Command grouped sets a custom help group title for the lifecycle subcommands via WithGroup.
Command grouped sets a custom help group title for the lifecycle subcommands via WithGroup.
Command hello is the smallest daemonize example: wrap a worker, stream its startup via a readiness channel, and get start/stop/status.
Command hello is the smallest daemonize example: wrap a worker, stream its startup via a readiness channel, and get start/stop/status.
Command named overrides the state-file base name with WithName, so the pid and log files are ".../<cache>/.serve/widget.{pid,log}" instead of being derived from the command path.
Command named overrides the state-file base name with WithName, so the pid and log files are ".../<cache>/.serve/widget.{pid,log}" instead of being derived from the command path.
Command pid-cleanup is a degenerate worker: it never closes the readiness channel, sleeps for 5s, prints "hello world", and returns.
Command pid-cleanup is a degenerate worker: it never closes the readiness channel, sleeps for 5s, prints "hello world", and returns.
Command reload adds the "reload" subcommand, wired to SIGHUP.
Command reload adds the "reload" subcommand, wired to SIGHUP.
Command shutdown-error demonstrates a wrapped command that starts fine but errors during shutdown.
Command shutdown-error demonstrates a wrapped command that starts fine but errors during shutdown.
Command shutdown-timeout demonstrates WithStopTimeout: the worker stalls inside its shutdown handler past the configured timeout, so stop escalates to SIGKILL instead of waiting for a graceful exit that never comes.
Command shutdown-timeout demonstrates WithStopTimeout: the worker stalls inside its shutdown handler past the configured timeout, so stop escalates to SIGKILL instead of waiting for a graceful exit that never comes.
Command slow-shutdown demonstrates a wrapped command with a slow, graceful shutdown.
Command slow-shutdown demonstrates a wrapped command with a slow, graceful shutdown.
Command slow-start demonstrates a wrapped command with a slow startup.
Command slow-start demonstrates a wrapped command with a slow startup.
Command start-error demonstrates a wrapped command that fails during startup (before signaling readiness).
Command start-error demonstrates a wrapped command that fails during startup (before signaling readiness).
Command subcommand shows daemonize mounted under a larger cobra tree: the app has its own init/create/delete subcommands, and "subcommand run" is the daemonized entry point (so "subcommand run start", "subcommand run stop", "subcommand run serve", ...
Command subcommand shows daemonize mounted under a larger cobra tree: the app has its own init/create/delete subcommands, and "subcommand run" is the daemonized entry point (so "subcommand run start", "subcommand run stop", "subcommand run serve", ...
Command ungrouped passes WithGroup(nil) so the lifecycle subcommands are not grouped — they appear under cobra's default "Additional Commands:".
Command ungrouped passes WithGroup(nil) so the lifecycle subcommands are not grouped — they appear under cobra's default "Additional Commands:".
Command with-args shows that flags and positional args are forwarded verbatim to the wrapped command.
Command with-args shows that flags and positional args are forwarded verbatim to the wrapped command.

Jump to

Keyboard shortcuts

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