Documentation
¶
Overview ¶
Package common defines the Setup structure that allows setup scripts to define packages and configurations to install.
Index ¶
Constants ¶
View Source
const ( // DatadogInstallerPackage is the datadog installer package DatadogInstallerPackage string = "datadog-installer" // DatadogAgentPackage is the datadog agent package DatadogAgentPackage string = "datadog-agent" // DatadogAPMInjectPackage is the datadog apm inject package DatadogAPMInjectPackage string = "datadog-apm-inject" // DatadogAPMLibraryJavaPackage is the datadog apm library java package DatadogAPMLibraryJavaPackage string = "datadog-apm-library-java" // DatadogAPMLibraryPythonPackage is the datadog apm library python package DatadogAPMLibraryPythonPackage string = "datadog-apm-library-python" // DatadogAPMLibraryRubyPackage is the datadog apm library ruby package DatadogAPMLibraryRubyPackage string = "datadog-apm-library-ruby" // DatadogAPMLibraryJSPackage is the datadog apm library js package DatadogAPMLibraryJSPackage string = "datadog-apm-library-js" // DatadogAPMLibraryDotNetPackage is the datadog apm library dotnet package DatadogAPMLibraryDotNetPackage string = "datadog-apm-library-dotnet" // DatadogAPMLibraryPHPPackage is the datadog apm library php package DatadogAPMLibraryPHPPackage string = "datadog-apm-library-php" )
Variables ¶
View Source
var ( // ApmLibraries is a list of all the apm libraries ApmLibraries = []string{ DatadogAPMLibraryJavaPackage, DatadogAPMLibraryPythonPackage, DatadogAPMLibraryRubyPackage, DatadogAPMLibraryJSPackage, DatadogAPMLibraryDotNetPackage, DatadogAPMLibraryPHPPackage, } )
View Source
var ( // ErrNoAPIKey is returned when no API key is provided. ErrNoAPIKey = errors.New("no API key provided") )
View Source
var ExecuteCommandWithTimeout = func(s *Setup, command string, args ...string) (output []byte, err error) { span, _ := telemetry.StartSpanFromContext(s.Ctx, "setup.command") span.SetResourceName(command) defer func() { span.Finish(err) }() ctx, cancel := context.WithTimeout(context.Background(), commandTimeoutDuration) defer cancel() cmd := exec.CommandContext(ctx, command, args...) output, err = cmd.Output() if output != nil { span.SetTag("command_output", string(output)) } if err != nil { span.SetTag("command_error", err.Error()) span.Finish(err) return nil, err } return output, nil }
ExecuteCommandWithTimeout executes a bash command with args and times out if the command has not finished
Functions ¶
This section is empty.
Types ¶
type Output ¶
type Output struct {
// contains filtered or unexported fields
}
Output is a writer for the output. It will support some ANSI escape sequences to format the output.
func (*Output) WriteString ¶
WriteString writes a string to the output.
type Packages ¶
type Packages struct {
// contains filtered or unexported fields
}
Packages is a list of packages to install
func (*Packages) InstallInstaller ¶ added in v0.65.0
func (p *Packages) InstallInstaller()
InstallInstaller marks the installer package to be installed
type Setup ¶
type Setup struct {
Out *Output
Env *env.Env
Ctx context.Context
Span *telemetry.Span
Packages Packages
Config config.Config
DdAgentAdditionalGroups []string
// contains filtered or unexported fields
}
Setup allows setup scripts to define packages and configurations to install.
Click to show internal directories.
Click to hide internal directories.