Documentation
¶
Overview ¶
Package packages contains the install/upgrades/uninstall logic for packages
Index ¶
- Variables
- func InstrumentAPMInjector(ctx context.Context, method string) (err error)
- func RunHook(ctx HookContext) (err error)
- func RunPackageCommand(ctx context.Context, packageName string, command string) (err error)
- func UninstrumentAPMInjector(ctx context.Context, method string) (err error)
- type HookContext
- type Hooks
- type PackageCommandHandler
- type PackageType
Constants ¶
This section is empty.
Variables ¶
var ( // AsyncPreRemoveHooks is called before a package is removed from the disk. // It can block the removal of the package files until a condition is met without blocking // the rest of the uninstall or upgrade process. // Today this is only useful for the dotnet tracer on windows and generally *SHOULD BE AVOIDED*. AsyncPreRemoveHooks = map[string]repository.PreRemoveHook{} )
Functions ¶
func InstrumentAPMInjector ¶
InstrumentAPMInjector instruments the APM injector
func RunHook ¶ added in v0.66.0
func RunHook(ctx HookContext) (err error)
RunHook executes a hook for a package
func RunPackageCommand ¶ added in v0.68.0
RunPackageCommand runs a package-specific command
Types ¶
type HookContext ¶ added in v0.66.0
type HookContext struct {
context.Context `json:"-"`
Package string `json:"package"`
PackageType PackageType `json:"package_type"`
PackagePath string `json:"package_path"`
Hook string `json:"hook"`
Upgrade bool `json:"upgrade"`
WindowsArgs []string `json:"windows_args"`
}
HookContext is the context passed to hooks during install/upgrade/uninstall.
func (HookContext) StartSpan ¶ added in v0.66.0
func (c HookContext) StartSpan(operationName string) (*telemetry.Span, HookContext)
StartSpan starts a new span with the given operation name.
type Hooks ¶ added in v0.66.0
type Hooks interface {
PreInstall(ctx context.Context, pkg string, pkgType PackageType, upgrade bool) error
PreRemove(ctx context.Context, pkg string, pkgType PackageType, upgrade bool) error
PostInstall(ctx context.Context, pkg string, pkgType PackageType, upgrade bool, winArgs []string) error
PreStartExperiment(ctx context.Context, pkg string) error
PostStartExperiment(ctx context.Context, pkg string) error
PreStopExperiment(ctx context.Context, pkg string) error
PostStopExperiment(ctx context.Context, pkg string) error
PrePromoteExperiment(ctx context.Context, pkg string) error
PostPromoteExperiment(ctx context.Context, pkg string) error
PostStartConfigExperiment(ctx context.Context, pkg string) error
PreStopConfigExperiment(ctx context.Context, pkg string) error
PostPromoteConfigExperiment(ctx context.Context, pkg string) error
}
Hooks is the interface for the hooks.
func NewHooks ¶ added in v0.66.0
func NewHooks(env *env.Env, packages *repository.Repositories) Hooks
NewHooks creates a new Hooks instance that will execute hooks via the CLI.
type PackageCommandHandler ¶ added in v0.68.0
PackageCommandHandler is a function that handles the execution of a package-specific command.
Implement this function and add it to the packagesCommands map to enable package-specific commands for a given package. Package commands are currently intended to be used internally by package hooks and not exposed to the user. For example, the Agent Windows package hooks must start some background worker processes.
The content of the command string is entirely defined by the individual package. Do NOT include private information in the command string, use environment variables instead.
type PackageType ¶ added in v0.66.0
type PackageType string
PackageType is the type of package.
const ( // PackageTypeOCI is the type for OCI packages. PackageTypeOCI PackageType = "oci" // PackageTypeDEB is the type for DEB packages. PackageTypeDEB PackageType = "deb" // PackageTypeRPM is the type for RPM packages. PackageTypeRPM PackageType = "rpm" )
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package apminject implements the apm injector installer
|
Package apminject implements the apm injector installer |
|
Package embedded provides embedded files for the installer.
|
Package embedded provides embedded files for the installer. |
|
tmpl
command
Package main generates the templates for the installer.
|
Package main generates the templates for the installer. |
|
Package exec provides wrappers to external executables
|
Package exec provides wrappers to external executables |
|
Package fapolicyd offers an interface to set agent's fapolicyd permissions.
|
Package fapolicyd offers an interface to set agent's fapolicyd permissions. |
|
Package file offers filesystem utils geared towards idempotent operations.
|
Package file offers filesystem utils geared towards idempotent operations. |
|
Package integrations contains packaging logic for python integrations
|
Package integrations contains packaging logic for python integrations |
|
Package packagemanager provides an interface over the OS package manager
|
Package packagemanager provides an interface over the OS package manager |
|
Package selinux offers an interface to set agent's SELinux permissions.
|
Package selinux offers an interface to set agent's SELinux permissions. |
|
Package service provides service manager utilities
|
Package service provides service manager utilities |
|
systemd
Package systemd provides a set of functions to manage systemd units
|
Package systemd provides a set of functions to manage systemd units |
|
sysvinit
Package sysvinit provides a set of functions to manage sysvinit services
|
Package sysvinit provides a set of functions to manage sysvinit services |
|
upstart
Package upstart provides a set of functions to manage upstart services
|
Package upstart provides a set of functions to manage upstart services |
|
windows
Package windows provides a set of functions to manage Windows services.
|
Package windows provides a set of functions to manage Windows services. |
|
Package ssi adds methods to check the status of the APM Single Step Instrumentation
|
Package ssi adds methods to check the status of the APM Single Step Instrumentation |
|
Package user offers an interface over user and group management
|
Package user offers an interface over user and group management |
|
windows
Package windowsuser offers an interface over user management on Windows
|
Package windowsuser offers an interface over user management on Windows |