command

package
v0.0.0-...-be33ac1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package command contains utilities for creating system-probe commands

Index

Constants

View Source
const LoggerName = "SYS-PROBE"

LoggerName defines the logger name

Variables

This section is empty.

Functions

func MakeCommand

func MakeCommand(subcommandFactories []SubcommandFactory) *cobra.Command

MakeCommand makes the top-level Cobra command for this app.

func SetDefaultCommandIfNonePresent

func SetDefaultCommandIfNonePresent(rootCmd *cobra.Command)

SetDefaultCommandIfNonePresent sets the "run" subcommand as root command to support the legacy (without any command) invocation.

Types

type GlobalParams

type GlobalParams struct {
	// ConfFilePath holds the path to the folder containing the configuration
	// file, to allow overrides from the command line
	ConfFilePath string

	// FleetPoliciesDirPath holds the path to the folder containing the fleet policies
	FleetPoliciesDirPath string
	// contains filtered or unexported fields
}

GlobalParams contains the values of system-probe global Cobra flags.

A pointer to this type is passed to SubcommandFactory's, but its contents are not valid until Cobra calls the subcommand's Run or RunE function.

func (GlobalParams) DatadogConfFilePath

func (g GlobalParams) DatadogConfFilePath() string

DatadogConfFilePath uses a fallback from datadogConfFilePath to ConfFilePath if not specified

type SubcommandFactory

type SubcommandFactory func(globalParams *GlobalParams) []*cobra.Command

SubcommandFactory is a callable that will return a slice of subcommands.

Jump to

Keyboard shortcuts

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