-
Notifications
You must be signed in to change notification settings - Fork 219
Expand file tree
/
Copy pathaudit_easyjson.go
More file actions
86 lines (81 loc) · 1.68 KB
/
audit_easyjson.go
File metadata and controls
86 lines (81 loc) · 1.68 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
package audit
import (
json "encoding/json"
easyjson "github.com/mailru/easyjson"
jlexer "github.com/mailru/easyjson/jlexer"
jwriter "github.com/mailru/easyjson/jwriter"
)
// suppress unused package warning
var (
_ *json.RawMessage
_ *jlexer.Lexer
_ *jwriter.Writer
_ easyjson.Marshaler
)
func easyjsonF2c44427EncodeAudit1(out *jwriter.Writer, in event) {
out.RawByte('{')
first := true
_ = first
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"start\":")
out.Raw((in.Start).MarshalJSON())
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"end\":")
out.Raw((in.End).MarshalJSON())
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"cost\":")
out.Int64(int64(in.Cost))
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"user\":")
out.String(string(in.User))
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"user_host\":")
out.String(string(in.UserHost))
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"thread_id\":")
out.Uint32(uint32(in.ThreadID))
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"command_type\":")
out.String(string(in.CommandType))
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"argument\":")
out.String(string(in.Argument))
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"query_rows\":")
out.Uint64(uint64(in.QueryRows))
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v event) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonF2c44427EncodeAudit1(&w, v)
return w.Buffer.BuildBytes(), w.Error
}