wip: Move all references to github.com/hohn/ghes-mirva-server
This commit is contained in:
committed by
=Michael Hohn
parent
4269bacf2a
commit
2ab596bf1d
52
pkg/common/types.go
Normal file
52
pkg/common/types.go
Normal file
@@ -0,0 +1,52 @@
|
||||
package common
|
||||
|
||||
type AnalyzeJob struct {
|
||||
MirvaRequestID int
|
||||
|
||||
QueryPackId int
|
||||
QueryLanguage string
|
||||
|
||||
ORL 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 {
|
||||
ID int
|
||||
OwnerRepo
|
||||
}
|
||||
Reference in New Issue
Block a user