25 lines
875 B
Go
25 lines
875 B
Go
package work
|
|
|
|
type ConsequenceAssessment struct {
|
|
ID string
|
|
TargetRefs []string
|
|
Impact int64
|
|
Reversibility int64
|
|
Uncertainty int64
|
|
Scope int64
|
|
Recoverability int64
|
|
CostOfError int64
|
|
ExpectedConsequences []string
|
|
MitigationOptions []string
|
|
RequiresDryRun bool
|
|
RequiresBackup bool
|
|
RecommendedConfirmation string
|
|
OwnerAccepted bool
|
|
EvidenceRefs []EvidenceRef
|
|
RecordedAtUnixMillis int64
|
|
}
|
|
|
|
func (a ConsequenceAssessment) Valid() bool {
|
|
return a.ID != "" && len(a.TargetRefs) > 0 && a.Impact >= 0 && a.Impact <= 1000 && a.Reversibility >= 0 && a.Reversibility <= 1000 && a.Uncertainty >= 0 && a.Uncertainty <= 1000 && a.Recoverability >= 0 && a.Recoverability <= 1000 && a.RecordedAtUnixMillis > 0
|
|
}
|