Documentation ¶
Index ¶
- func FindKeyValue(tags []*common.Kv, key string) *common.Kv
- func KeyValueToRawMap(arr []*common.Kv) (json.RawMessage, error)
- func RawMapToKeyValue(rawJSON json.RawMessage) ([]*common.Kv, error)
- 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) 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) ListInitiatedScans(ctx context.Context, startTime *tspb.Timestamp) ([]string, error)
- func (db *DB) UpdateJob(inJob *jobs.Job) error
- type DBTrans
- type JobNode
- type JobProfile
- type JobTag
- type ResultsRow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindKeyValue ¶
FindKeyValue finds a Tag object in the array based on key match
func KeyValueToRawMap ¶
func KeyValueToRawMap(arr []*common.Kv) (json.RawMessage, error)
KeyValueToRawMap helps convert an array of KeyValues in a Map and convert it to json
func RawMapToKeyValue ¶
func RawMapToKeyValue(rawJSON json.RawMessage) ([]*common.Kv, error)
RawMapToKeyValue helps convert an array of KeyValues in a Map and convert it to json
func RemoveKeyValue ¶
RemoveKeyValue removes an item from the array base on key match
Types ¶
type DB ¶
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) ListInitiatedScans ¶
type DBTrans ¶
type DBTrans struct {
*gorp.Transaction
}
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"` }
Click to show internal directories.
Click to hide internal directories.