job

package
v2.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package job is a service to consume, process, and return Agent jobs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	Agent         uuid.UUID
	AgentService  *agent.Service
	ClientService *client.Service
}

Service is the structure used to interact with job objects

func NewJobService

func NewJobService(agentID uuid.UUID) *Service

NewJobService is the factory to create a new service for handling Jobs

func (*Service) AddResult

func (s *Service) AddResult(agent uuid.UUID, stdOut, stdErr string)

AddResult creates a Job Results structure and places it in the outgoing channel

func (*Service) Check

func (s *Service) Check() (returnJobs []jobs.Job)

Check does not block and returns any jobs ready to be returned to the Merlin server

func (*Service) Control

func (s *Service) Control(job jobs.Job)

Control handles jobs that have the CONTROL type used to configure the Agent or the network communication client

func (*Service) Get

func (s *Service) Get() []jobs.Job

Get blocks waiting for a job from the out channel

func (*Service) Handle

func (s *Service) Handle(Jobs []jobs.Job)

Handle takes a list of jobs and places them into a job channel if they are a valid type, so they can be executed

Jump to

Keyboard shortcuts

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