Documentation ¶
Overview ¶
Package agent runs tasks on differents runtime environments, such as hosts and containers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent manages the data necessary to run tasks in a runtime environment.
func New ¶
New creates a new Agent with some Options and a client.Communicator. Call the Agent's Start method to begin listening for tasks to run. Users should call Close when the agent is finished.
func (*Agent) GetSender ¶
func (a *Agent) GetSender(ctx context.Context, output globals.LogOutputType, prefix string, taskID string, taskExecution int) (send.Sender, error)
GetSender configures the agent's local logging, which can go to Splunk, a file, or stdout.
func (*Agent) SetDefaultLogger ¶
func (*Agent) SetHomeDirectory ¶
func (a *Agent) SetHomeDirectory()
SetHomeDirectory sets the agent's home directory to the user's home directory if it is not already set.
type Options ¶
type Options struct { // Mode determines which mode the agent will run in. Mode globals.Mode // HostID and HostSecret only apply in host mode. HostID string HostSecret string // PodID and PodSecret only apply in pod mode. PodID string PodSecret string StatusPort int LogPrefix string LogOutput globals.LogOutputType WorkingDirectory string HeartbeatInterval time.Duration Cleanup bool SetupData apimodels.AgentSetupData CloudProvider string TraceCollectorEndpoint string // SendTaskLogsToGlobalSender indicates whether task logs should also be // sent to the global agent file log. SendTaskLogsToGlobalSender bool HomeDirectory string }
Options contains startup options for an Agent.
type StatsCollector ¶
type StatsCollector struct { Cmds []string // indicates the sampling frequency Interval time.Duration // contains filtered or unexported fields }
StatsCollector samples machine statistics and logs them back to the API server at regular intervals.
func NewSimpleStatsCollector ¶
func NewSimpleStatsCollector(logger client.LoggerProducer, jpm jasper.Manager, interval time.Duration, cmds ...string) *StatsCollector
NewSimpleStatsCollector creates a StatsCollector that runs the given commands at the given interval and sends the results to the given logger.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package command defines the behavior of commands invoked by project configuration files.
|
Package command defines the behavior of commands invoked by project configuration files. |
taskoutput
Task Output Directory
|
Task Output Directory |
Package util provides utility methods for the agent.
|
Package util provides utility methods for the agent. |