Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aos
GitHub Repository: aos/grafana-agent
Path: blob/main/pkg/river/encoding/fields.go
4095 views
1
package encoding
2
3
// field represents a value in river.
4
type field struct {
5
Name string `json:"name,omitempty"`
6
Type string `json:"type,omitempty"`
7
Value interface{} `json:"value,omitempty"`
8
}
9
10
// valueField represents a value in river.
11
type valueField struct {
12
Type string `json:"type,omitempty"`
13
Value interface{} `json:"value,omitempty"`
14
}
15
16
func (vf *valueField) hasValue() bool {
17
if vf == nil {
18
return false
19
}
20
return vf.Value != nil
21
}
22
23
// keyField represents a map backed field.
24
type keyField struct {
25
field `json:",omitempty"`
26
Key string `json:"key,omitempty"`
27
}
28
29