-
Notifications
You must be signed in to change notification settings - Fork 1
/
evidences.go
65 lines (54 loc) · 1.84 KB
/
evidences.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package models
import (
"time"
"github.com/flanksource/duty/types"
"github.com/google/uuid"
)
type Evidence struct {
ID uuid.UUID `json:"id"`
HypothesisID uuid.UUID `json:"hypothesis_id"`
ConfigID *uuid.UUID `json:"config_id"`
ConfigChangeID *uuid.UUID `json:"config_change_id"`
ConfigAnalysisID *uuid.UUID `json:"config_analysis_id"`
ComponentID *uuid.UUID `json:"component_id"`
CheckID *uuid.UUID `json:"check_id"`
Description string `json:"description"`
DefinitionOfDone bool `json:"definition_of_done"`
Done bool `json:"done"`
Factor bool `json:"factor"`
Mitigator bool `json:"mitigator"`
CreatedBy uuid.UUID `json:"created_by"`
Type string `json:"type"`
Script string `json:"script"`
ScriptResult string `json:"script_result"`
Evidence types.JSONMap `json:"evidence"`
Properties types.JSONMap `json:"properties"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func (i Evidence) AsMap(removeFields ...string) map[string]any {
return asMap(i, removeFields...)
}
type EvidenceConfig struct {
ID uuid.UUID `json:"id"`
Lines []string `json:"lines"`
SelectedLines types.JSONStringMap `json:"selected_lines"`
}
type EvidenceConfigAnalysis struct {
ID uuid.UUID `json:"id"`
}
type EvidenceConfigChange struct {
ID uuid.UUID `json:"id"`
}
type EvidenceComponent struct {
}
type EvidenceLogs struct {
Lines []LogLine `json:"lines"`
}
type EvidenceCanaryCheck struct {
}
type LogLine struct {
Timestamp time.Time `json:"timestamp"`
Message string `json:"message"`
Labels types.JSONStringMap `json:"labels"`
}