agents

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2019 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Agents = make(map[uuid.UUID]*agent)

Agents contains all of the instantiated agent object that are accessed by other modules

Functions

func AddJob added in v0.6.0

func AddJob(agentID uuid.UUID, jobType string, jobArgs []string) (string, error)

AddJob creates a job and adds it to the specified agent's channel and returns the Job ID or an error

func GetAgentFieldValue added in v0.7.0

func GetAgentFieldValue(agentID uuid.UUID, field string) (string, error)

GetAgentFieldValue returns a string value for the field value belonging to the specefied Agent

func GetAgentList

func GetAgentList() func(string) []string

GetAgentList returns a list of agents that exist and is used for command line tab completion

func GetAgentStatus added in v0.6.0

func GetAgentStatus(agentID uuid.UUID) string

GetAgentStatus evaluates the agent's last check in time and max wait time to determine if it is active, delayed, or dead

func GetMessageForJob added in v0.6.0

func GetMessageForJob(agentID uuid.UUID, job Job) (messages.Base, error)

GetMessageForJob returns a Message Base structure for the provided job type

func InitialCheckIn

func InitialCheckIn(j messages.Base)

InitialCheckIn is run on the first communication with an agent and is used to instantiate an agent object

func Log

func Log(agentID uuid.UUID, logMessage string)

Log is used to write log messages to the agent's log file

func RemoveAgent added in v0.6.0

func RemoveAgent(agentID uuid.UUID) error

RemoveAgent deletes the agent object from Agents map by its ID

func ShowInfo

func ShowInfo(agentID uuid.UUID)

ShowInfo lists all of the agent's structure value in a table

func StatusCheckIn

func StatusCheckIn(j messages.Base) (messages.Base, error)

StatusCheckIn is the function that is run when an agent sends a message back to server, checking in for additional instructions

func UpdateInfo added in v0.6.0

func UpdateInfo(j messages.Base, p messages.AgentInfo)

UpdateInfo is used to update an agent's information with the passed in message data

Types

type Job added in v0.6.0

type Job struct {
	ID      string
	Type    string
	Status  string // Valid Statuses are created, sent, returned //TODO this might not be needed
	Args    []string
	Created time.Time
}

Job is a structure for holding data for single task assigned to a single agent

Jump to

Keyboard shortcuts

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