github.com/cockroachdb/cockroachdb-parser@v0.23.3-0.20240213214944-911057d40c9a/pkg/util/log/logpb/json_encode_generated.go (about) 1 // Code generated by gen.go. DO NOT EDIT. 2 3 package logpb 4 5 import ( 6 "strconv" 7 8 "github.com/cockroachdb/cockroachdb-parser/pkg/util/jsonbytes" 9 "github.com/cockroachdb/redact" 10 "github.com/gogo/protobuf/jsonpb" 11 ) 12 13 var _ = jsonpb.Marshaler{} 14 15 // AppendJSONFields implements the EventPayload interface. 16 func (m *CommonEventDetails) AppendJSONFields(printComma bool, b redact.RedactableBytes) (bool, redact.RedactableBytes) { 17 18 if m.Timestamp != 0 { 19 if printComma { 20 b = append(b, ',') 21 } 22 printComma = true 23 b = append(b, "\"Timestamp\":"...) 24 b = strconv.AppendInt(b, int64(m.Timestamp), 10) 25 } 26 27 if m.EventType != "" { 28 if printComma { 29 b = append(b, ',') 30 } 31 printComma = true 32 b = append(b, "\"EventType\":\""...) 33 b = redact.RedactableBytes(jsonbytes.EncodeString([]byte(b), string(m.EventType))) 34 b = append(b, '"') 35 } 36 37 return printComma, b 38 }