Documentation ¶
Overview ¶
Package job is a service used to interact with Agent Jobs
Index ¶
- func WithJobMemoryRepository() infoJobs.Repository
- type Service
- func (s *Service) Add(agentID uuid.UUID, jobType string, jobArgs []string) (string, error)
- func (s *Service) AddJobChannel(agentID uuid.UUID, job *jobs.Job, jobArgs []string) (results string, err error)
- func (s *Service) Clear(agentID uuid.UUID) error
- func (s *Service) ClearAll() error
- func (s *Service) Get(agentID uuid.UUID) ([]jobs.Job, error)
- func (s *Service) GetAgentActive(agentID uuid.UUID) ([]infoJobs.Info, error)
- func (s *Service) GetAll() []infoJobs.Info
- func (s *Service) GetAllActive() []infoJobs.Info
- func (s *Service) GetTableActive(agentID uuid.UUID) ([][]string, error)
- func (s *Service) GetTableAll() [][]string
- func (s *Service) Handler(agentJobs []jobs.Job) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithJobMemoryRepository ¶
func WithJobMemoryRepository() infoJobs.Repository
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service holds references to repositories to manage Job objects
func NewJobService ¶
func NewJobService() *Service
NewJobService is a factory to create a Job service to be used by other packages or services
func (*Service) AddJobChannel ¶
func (s *Service) AddJobChannel(agentID uuid.UUID, job *jobs.Job, jobArgs []string) (results string, err error)
AddJobChannel adds an already built Agent Job to the agent's job channel to be sent to the agent when it checks in. A server-side job tracking structure is also added to track job status
func (*Service) Clear ¶
Clear removes any jobs in the queue that have been created, but NOT sent to the agent
func (*Service) GetAgentActive ¶
func (*Service) GetAllActive ¶
GetAllActive returns a list of all jobs that are not complete or canceled
func (*Service) GetTableActive ¶
GetTableActive returns a list of rows that contain information about active jobs
func (*Service) GetTableAll ¶
GetTableAll returns all unsent jobs to be displayed as a table