Files
mrvacommander/pkg/common/types.go
Michael Hohn 25cab583c1 wip: storage using postgres / gorm using partial json
Several approaches of normalizing json were tried and ultimately found
impractical at this point.

Using a hybrid of tables and json is the current approach; this may be
further normalized later.
2024-06-06 13:19:00 -07:00

53 lines
707 B
Go

package common
type AnalyzeJob struct {
MirvaRequestID int
QueryPackId int
QueryLanguage string
ORepo OwnerRepo
}
type OwnerRepo struct {
Owner string
Repo string
}
type AnalyzeResult struct {
RunAnalysisSARIF string
RunAnalysisBQRS string
}
type Status int
const (
StatusInProgress = iota
StatusQueued
StatusError
StatusSuccess
StatusFailed
)
func (s Status) ToExternalString() string {
switch s {
case StatusInProgress:
return "in_progress"
case StatusQueued:
return "queued"
case StatusError:
return "error"
case StatusSuccess:
return "succeeded"
case StatusFailed:
return "failed"
default:
return "unknown"
}
}
type JobSpec struct {
JobID int
OwnerRepo
}