scanner

package
v0.0.0-...-0490640 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

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
	// contains filtered or unexported fields
}

func New

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

func (*Scanner) AddNodeToDB

func (s *Scanner) AddNodeToDB(ctx context.Context, detectInfo *inspec.OSInfo, job *types.InspecBaseJob, sourceInfo SourceInfo, endTime time.Time) (string, error)

func (*Scanner) CheckForHungJobs

func (s *Scanner) CheckForHungJobs(ctx context.Context) ([]string, error)

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

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)

func (*Scanner) UpdateJobStatus

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

func (*Scanner) UpdateNode

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

func (*Scanner) UpdateParentJobSchedule

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

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)

type SourceInfo

type SourceInfo struct {
	SourceID        string
	SourceRegion    string
	SourceAccountID string
}

Jump to

Keyboard shortcuts

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