-
Notifications
You must be signed in to change notification settings - Fork 0
/
config_validator.go
54 lines (46 loc) · 1.69 KB
/
config_validator.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
package types
// ValidatingConfig request body for validating a config.
type ValidatingConfig struct {
Configs []ValidatingConfigEntry `json:"config"`
}
// ValidatingConfigEntry defines a single config to the validated. See `ValidatingConfig`.
type ValidatingConfigEntry struct {
Command string `json:"command"`
Name string `json:"name"`
Optional map[string]string `json:"optional,omitempty"`
ID string `json:"id"`
}
// ValidatedConfig response body after validating an agent config successfully.
type ValidatedConfig struct {
Errors ConfigValidity `json:"errors"`
}
// ConfigValidity details.
type ConfigValidity struct {
Runtime []string `json:"runtime" `
Input map[string][]string `json:"input"`
Output map[string][]string `json:"output"`
Filter map[string][]string `json:"filter"`
}
// ConfigValidityV2Property property details.
type ConfigValidityV2Property struct {
ID string `json:"id"`
Property string `json:"property"`
Text string `json:"text"`
Errors []string `json:"errors"`
}
// ConfigValidityV2Runtime runtime details.
type ConfigValidityV2Runtime struct {
ID string `json:"id"`
Errors []string `json:"errors"`
}
// ConfigValidityV2 details.
type ConfigValidityV2 struct {
Runtime []ConfigValidityV2Runtime `json:"runtime" `
Input map[string][]ConfigValidityV2Property `json:"input"`
Output map[string][]ConfigValidityV2Property `json:"output"`
Filter map[string][]ConfigValidityV2Property `json:"filter"`
}
// ValidatedConfigV2 response body after validating an agent config successfully against the v2 endpoint.
type ValidatedConfigV2 struct {
Errors ConfigValidityV2 `json:"errors"`
}