command

package
v0.0.0-...-e70f483 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 71 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package command implements the top-level `process-agent` binary, including its subcommands.

Index

Constants

View Source
const LoggerName pkglogsetup.LoggerName = "PROCESS"
View Source
const UseWinParams = false

UseWinParams is set to true when ran on Windows

Variables

View Source
var DaemonLogParams = log.ForDaemon(string(LoggerName), "process_config.log_file", pkgconfigsetup.DefaultProcessAgentLogFile)

DaemonLogParams are the log params should be given to the `core.BundleParams` for when the process agent is running as a daemon

View Source
var OneShotLogParams = log.ForOneShot(string(LoggerName), "info", true)

OneShotLogParams are the log params that are given to commands

Functions

func FixDeprecatedFlags

func FixDeprecatedFlags(args []string, w io.Writer) []string

FixDeprecatedFlags transforms args so that they are conforming to the new CLI structure: - replace non-posix flags posix flags - replace deprecated flags with their command equivalents - display warnings when deprecated flags are encountered

func GetCoreBundleParamsForOneShot

func GetCoreBundleParamsForOneShot(globalParams *GlobalParams) core.BundleParams

func MakeCommand

func MakeCommand(subcommandFactories []SubcommandFactory, winParams bool, rootCmdRun func(globalParams *GlobalParams)) *cobra.Command

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

func RootCmdRun

func RootCmdRun(globalParams *GlobalParams)

RootCmdRun is the main function to run the process agent

func SetHostMountEnv

func SetHostMountEnv(logger log.Component)

SetHostMountEnv sets HOST_PROC and HOST_SYS mounts if applicable in containerized environments

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

	// ExtraConfFilePath represents the paths to additional configuration files.
	ExtraConfFilePath []string

	// SysProbeConfFilePath holds the path to the folder containing the system-probe
	// configuration file, to allow overrides from the command line
	SysProbeConfFilePath string

	// FleetPoliciesDirPath holds the path to the folder containing the fleet policies
	FleetPoliciesDirPath string

	// PidFilePath specifies the path to the pid file
	PidFilePath string

	// WinParams provides windows specific options
	WinParams WinParams

	// NoColor is a flag to disable color output
	NoColor bool
}

GlobalParams contains the values of agent-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.

type SubcommandFactory

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

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

type WinParams

type WinParams struct {
	// StartService handles starting the service
	StartService bool

	// StopService handles stopping the service
	StopService bool

	// Foreground handles running the service in the foreground
	Foreground bool
}

WinParams specifies Windows-specific CLI params

Jump to

Keyboard shortcuts

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