-
Notifications
You must be signed in to change notification settings - Fork 0
/
domain.go
64 lines (53 loc) · 1.71 KB
/
domain.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
package main
import (
"context"
"github.com/jupiterone/jupiterone-client-go/jupiterone"
)
type CriticalityPackage struct {
ID string `json:"_id"`
AssetName string `json:"assetName"`
Class interface{} `json:"assetClass"`
Dependencies int `json:"dependencies"`
AgeInDays int `json:"ageInDays"`
CriticalityScore int `json:"criticalityScore"`
}
type Config struct {
JupiterOneConfig jupiterone.Config
JupiterOneClient *jupiterone.Client
}
type QueryDataReturnClause struct {
ID string `json:"asset._id"`
DisplayName string `json:"asset.displayName"`
Class interface{} `json:"asset._class"`
CreatedOn string `json:"asset._createdOn"`
Dependencies int `json:"deps"`
}
type GetCriticalityOutputResult struct {
AssetName string `json:"assetName"`
Class interface{} `json:"assetClass"`
Dependencies int `json:"dependencies"`
AgeInDays int `json:"ageInDays"`
CriticalityScore int `json:"criticalityScore"`
}
type GetCriticalityEntityPayload struct {
ID string `json:"_id"`
CriticalityScore int `json:"criticalityScore"`
}
type GetCriticalityOutput struct {
Results []GetCriticalityOutputResult `json:"results"`
}
type Weights struct {
AgeInDays int `json:"ageInDays"`
Dependencies int `json:"dependencies"`
}
type GetCriticalityRequestBody struct {
Assets []string `json:"assets"`
Weights *Weights `json:"weights,omitempty"`
}
type GetCriticalityForAssetsOptions struct {
Context context.Context
Config Config
AssetName string
ResultsChannel chan []CriticalityPackage
Weights Weights
}