agentclient

package
v0.58.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package agentclient provides an interface to run Agent commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent interface {
	// Version runs version command returns the runtime Agent version
	Version(commandArgs ...AgentArgsOption) string

	// Hostname runs hostname command and returns the runtime Agent hostname
	Hostname(commandArgs ...AgentArgsOption) string

	// Check runs check command and returns the runtime Agent check
	Check(commandArgs ...AgentArgsOption) string

	// Check runs check command and returns the runtime Agent check or an error
	CheckWithError(commandArgs ...AgentArgsOption) (string, error)

	// Config runs config command and returns the runtime agent config
	Config(commandArgs ...AgentArgsOption) string

	// ConfigWithError runs config command and returns the runtime agent config or an error
	ConfigWithError(commandArgs ...AgentArgsOption) (string, error)

	// Diagnose runs diagnose command and returns its output
	Diagnose(commandArgs ...AgentArgsOption) string

	// Flare runs flare command and returns the output. You should use the FakeIntake client to fetch the flare archive
	Flare(commandArgs ...AgentArgsOption) string

	// Health runs health command and returns the runtime agent health
	Health() (string, error)

	// ConfigCheck runs configcheck command and returns the runtime agent configcheck
	ConfigCheck(commandArgs ...AgentArgsOption) string

	// Integration run integration command and returns the output
	Integration(commandArgs ...AgentArgsOption) string

	// IntegrationWithError run integration command and returns the output
	IntegrationWithError(commandArgs ...AgentArgsOption) (string, error)

	// RemoteConfig runs the remote-config command and returns the output
	RemoteConfig(commandArgs ...AgentArgsOption) string

	// Secret runs the secret command
	Secret(commandArgs ...AgentArgsOption) string

	// IsReady runs status command and returns true if the command returns a zero exit code.
	// This function should rarely be used.
	IsReady() bool

	// Status runs status command and returns a Status struct
	Status(commandArgs ...AgentArgsOption) *Status

	// StatusWithError runs status command and returns a Status struct and error
	StatusWithError(commandArgs ...AgentArgsOption) (*Status, error)
}

Agent is an interface to run Agent command.

type AgentArgs

type AgentArgs struct {
	Args []string
}

AgentArgs contains the arguments for the Agent commands. Its value is populated using the functional options pattern.

type AgentArgsOption

type AgentArgsOption = func(*AgentArgs) error

AgentArgsOption is an optional function parameter type for Agent arguments

func WithArgs

func WithArgs(args []string) AgentArgsOption

WithArgs sets the Agent arguments

type Status

type Status struct {
	Content string
}

Status contains the Agent status content

Jump to

Keyboard shortcuts

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