Documentation ¶
Index ¶
- Constants
- func FindKeyValue(tags []*common.Kv, key string) *common.Kv
- func RemoveKeyValue(tags []*common.Kv, key string) []*common.Kv
- func Transact(db *DB, txFunc func(*DBTrans) error) error
- type DB
- func (db *DB) AddJob(inJob *jobs.Job) (string, error)
- func (db *DB) DeleteJob(id string) error
- func (db *DB) GetConfigs(ctx context.Context) (*reporting.ComplianceConfigResponse, error)
- func (db *DB) GetJob(id string) (*jobs.Job, error)
- func (db *DB) GetJobName(id string) (string, error)
- func (db *DB) GetJobResultByNodeId(ctx context.Context, in *jobs.GetJobResultByNodeIdRequest) (*jobs.ResultsRow, error)
- func (db *DB) GetJobs(sortField string, insortOrder jobs.Query_OrderType, pageNr int32, ...) ([]*jobs.Job, int64, error)
- func (db *DB) GetTelemetry(ctx context.Context) (Telemetry, error)
- func (db *DB) ListInitiatedScans(ctx context.Context, startTime *tspb.Timestamp) ([]jobWithTime, error)
- func (db *DB) SetConfigs(ctx context.Context, in *reporting.ComplianceConfigRequest) error
- func (db *DB) UpdateJob(inJob *jobs.Job) error
- func (db *DB) UpdateLastTelemetryReported(ctx context.Context, req *stats.UpdateTelemetryReportedRequest) error
- type DBTrans
- func (trans *DBTrans) DeleteTelemetry(ctx context.Context, id string) error
- func (trans *DBTrans) GetTelemetry(ctx context.Context) (Telemetry, error)
- func (trans *DBTrans) StoreTelemetry(ctx context.Context, lastTelemetryReportedAt time.Time) error
- func (trans *DBTrans) UpdateTelemetry(ctx context.Context, lastTelemetryReportedAt time.Time) error
- type Flag
- type JobNode
- type JobProfile
- type JobTag
- type ResultsRow
- type Storage
- type Telemetry
- type UpgradesDB
Constants ¶
const ( DayLatestFlag = "day_latest" ControlIndexFlag = "control_index" CompRunInfoFlag = "comp_run_info" EnhancedReportingEnabledFlag = "enhanced_reporting" )
constants represents the flags
const (
PolicyNameUnreachable = "unreachable_assets"
)
Variables ¶
This section is empty.
Functions ¶
func FindKeyValue ¶
FindKeyValue finds a Tag object in the array based on key match
func RemoveKeyValue ¶
RemoveKeyValue removes an item from the array base on key match
Types ¶
type DB ¶
func (*DB) GetConfigs ¶
func (*DB) GetJobResultByNodeId ¶
func (db *DB) GetJobResultByNodeId(ctx context.Context, in *jobs.GetJobResultByNodeIdRequest) (*jobs.ResultsRow, error)
given a job id and node id, get the result from the results table
func (*DB) GetTelemetry ¶
Get last compliance telemetry reported timestamp
func (*DB) ListInitiatedScans ¶
func (*DB) SetConfigs ¶
func (*DB) UpdateLastTelemetryReported ¶
func (db *DB) UpdateLastTelemetryReported(ctx context.Context, req *stats.UpdateTelemetryReportedRequest) error
UpdateLastTelemetryReported: Upsert the last compliance telemetry reported date in postgres
type DBTrans ¶
type DBTrans struct {
*gorp.Transaction
}
func (*DBTrans) DeleteTelemetry ¶
Delete last compliance telemetry reported timestamp
func (*DBTrans) GetTelemetry ¶
Get last compliance telemetry reported timestamp
func (*DBTrans) StoreTelemetry ¶
store last compliance telemetry reported timestamp
type JobProfile ¶
type ResultsRow ¶
type ResultsRow struct { JobID string `db:"job_id" json:"job_id,omitempty"` NodeID string `db:"node_id" json:"node_id"` ReportID string `db:"report_id" json:"report_id"` Status string `db:"status" json:"status"` Result string `db:"result" json:"result"` StartTime time.Time `db:"start_time" json:"start_time"` EndTime time.Time `db:"end_time" json:"end_time"` }
type UpgradesDB ¶
type UpgradesDB struct {
DB *DB
}
func NewDB ¶
func NewDB(db *DB) *UpgradesDB
func (*UpgradesDB) AddEnhancedReportingFlag ¶
func (u *UpgradesDB) AddEnhancedReportingFlag() error
AddEnhancedReportingFlag adds the enhanced_reporting flag to flags table
func (*UpgradesDB) GetUpgradeFlags ¶
func (u *UpgradesDB) GetUpgradeFlags() (map[string]Flag, error)
GetUpgradeFlags Gets the all the upgrade flags and status from the pg database
func (*UpgradesDB) RemoveEnhancedReportingFlag ¶
func (u *UpgradesDB) RemoveEnhancedReportingFlag() error
RemoveEnhancedReportingFlag delete the enhanced_reporting from flags table
func (*UpgradesDB) UpdateControlFlagTimeStamp ¶
func (u *UpgradesDB) UpdateControlFlagTimeStamp() error
UpdateControlFlagTimeStamp updates the upgrade_time for the control index flag
func (*UpgradesDB) UpdateControlFlagValue ¶
func (u *UpgradesDB) UpdateControlFlagValue(value bool) error
UpdateControlFlagValue updates the upgrade_value for control index flag