commands

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (

	//  If set, the value of this variable will be written to the log file as one of the first log messages.
	DCP_LOGGING_CONTEXT = "DCP_LOGGING_CONTEXT"
)

Variables

View Source
var (
	Version        = defaultVersion
	CommitHash     = ""
	BuildTimestamp = ""
)

Functions

func AddMonitorFlags

func AddMonitorFlags(cmd *cobra.Command)

func ErrorExit

func ErrorExit(log *logger.Logger, err error, exitCode int)

func GetMonitorContextFromFlags

func GetMonitorContextFromFlags(ctx context.Context, logger logr.Logger) (context.Context, context.CancelFunc)

Returns a context (derived from the passed parent context) that will be cancelled when the process specified by the monitor flags (--monitor and --monitor-identity-time) exits . If the flags are not present at startup, the returned context is just a regular cancellable context with no additional semantics. If an error occurs (e.g. the process cannot be found, or the monitor flag values are invalid), the context is still returned, but it will be cancelled immediately.

func LogVersion

func LogVersion(log logr.Logger, programStartMsg string) func(_ *cobra.Command, _ []string)

func MonitorPid

func MonitorPid(
	ctx context.Context,
	pid process.Pid_t,
	expectedProcessStartTime time.Time,
	pollInterval uint8,
	logger logr.Logger,
) (context.Context, context.CancelFunc, error)

Starts monitoring a process with a given PID and (optional) start time. Returns a context that will be cancelled when the monitored process exits, or if the returned cancellation function is called. The returned context (and the cancellation function) is valid even if an error occurs (e.g. the process cannot be found), but it will be already cancelled in that case.

func NewVersionCommand

func NewVersionCommand(log logr.Logger) (*cobra.Command, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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