scanner

package
v0.0.0-...-4b711b1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: Apache-2.0 Imports: 16 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scanner

type Scanner struct {
	DB                      *pgdb.DB
	FireJailExecProfilePath string
	// contains filtered or unexported fields
}

func New

func New(managerClient manager.NodeManagerServiceClient, nodesClient nodes.NodesServiceClient, db *pgdb.DB, fireJailExecProfilePath string) *Scanner

func (*Scanner) CreateChildJob

func (s *Scanner) CreateChildJob(job *jobs.Job) (*jobs.Job, error)

func (*Scanner) GetDueJobs

func (s *Scanner) GetDueJobs(nowTime time.Time) ([]*jobs.Job, error)

func (*Scanner) GetNodeUUID

func (s *Scanner) GetNodeUUID(ctx context.Context, sourceID string, region string, acctID string) (string, error)

func (*Scanner) IsJobDeleted

func (s *Scanner) IsJobDeleted(jobID string) (bool, error)

func (*Scanner) UpdateJobNodeCount

func (s *Scanner) UpdateJobNodeCount(jobID string, nodeCount int) error

func (*Scanner) UpdateJobStatus

func (s *Scanner) UpdateJobStatus(job_id string, newStatus string, startTime *time.Time, endTime *time.Time) error

func (*Scanner) UpdateNode

func (s *Scanner) UpdateNode(ctx context.Context, job *types.InspecJob, detectInfo *inspec.OSInfo) error

func (*Scanner) UpdateParentJobSchedule

func (s *Scanner) UpdateParentJobSchedule(jobId string, jobCount int32, recurrence string, lastScheduledTime *timestamp.Timestamp) error

UpdateParentJobSchedule updates recurrent(parent) jobs fields: status: "new" -> "scheduled" -> "completed" if no more runs are required based on the recurrent fields and job count job_count: how many child jobs have been created for this recurrent job scheduled_time: when is the next run due

func (*Scanner) UpdateResult

func (s *Scanner) UpdateResult(ctx context.Context, job *types.InspecJob, output []byte, inspecErr *inspec.Error, reportID string) error

Jump to

Keyboard shortcuts

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