-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
api.go
36 lines (30 loc) · 869 Bytes
/
api.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
package api
import "encoding/xml"
type MetricContext string
type MetricType string
const (
MetricContextHost MetricContext = "host"
MetricContextVM MetricContext = "vm"
)
const (
MetricTypeReal64 MetricType = "real64"
MetricTypeReal32 MetricType = "real32"
MetricTypeInt64 MetricType = "int64"
MetricTypeInt32 MetricType = "int32"
MetricTypeUInt64 MetricType = "uint64"
MetricTypeUInt32 MetricType = "uint32"
MetricTypeString MetricType = "string"
)
type Metrics struct {
XMLName xml.Name `xml:"metrics"`
Text string `xml:",chardata"`
Metrics []Metric `xml:"metric"`
}
type Metric struct {
Text string `xml:",chardata"`
Type MetricType `xml:"type,attr"`
Context MetricContext `xml:"context,attr"`
Name string `xml:"name"`
Value string `xml:"value"`
Unit string `xml:"unit,attr,omitempty"`
}