-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
64 lines (52 loc) · 1.68 KB
/
types.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 performance
// Code generated by cdproto-gen. DO NOT EDIT.
import (
"errors"
"github.com/mailru/easyjson"
"github.com/mailru/easyjson/jlexer"
"github.com/mailru/easyjson/jwriter"
)
// Metric run-time execution metric.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Performance#type-Metric
type Metric struct {
Name string `json:"name"` // Metric name.
Value float64 `json:"value"` // Metric value.
}
// EnableTimeDomain time domain to use for collecting and reporting duration
// metrics.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Performance#method-enable
type EnableTimeDomain string
// String returns the EnableTimeDomain as string value.
func (t EnableTimeDomain) String() string {
return string(t)
}
// EnableTimeDomain values.
const (
EnableTimeDomainTimeTicks EnableTimeDomain = "timeTicks"
EnableTimeDomainThreadTicks EnableTimeDomain = "threadTicks"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t EnableTimeDomain) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t EnableTimeDomain) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *EnableTimeDomain) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch EnableTimeDomain(in.String()) {
case EnableTimeDomainTimeTicks:
*t = EnableTimeDomainTimeTicks
case EnableTimeDomainThreadTicks:
*t = EnableTimeDomainThreadTicks
default:
in.AddError(errors.New("unknown EnableTimeDomain value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *EnableTimeDomain) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}