MCPcopy Create free account
hub / github.com/francoispqt/gojay / MarshalJSONObject

Method MarshalJSONObject

gojay/codegen/test/pooled_struct/encoding.go:175–192  ·  view source on GitHub ↗

MarshalJSONObject implements MarshalerJSONObject

(enc *gojay.Encoder)

Source from the content-addressed store, hash-verified

173
174// MarshalJSONObject implements MarshalerJSONObject
175func (m *Message) MarshalJSONObject(enc *gojay.Encoder) {
176 enc.IntKey("Id", m.Id)
177 enc.StringKey("Name", m.Name)
178 enc.Float64Key("Price", m.Price)
179 var intsSlice = Ints(m.Ints)
180 enc.ArrayKey("Ints", intsSlice)
181 var floatsSlice = Float64s(m.Floats)
182 enc.ArrayKey("Floats", floatsSlice)
183 enc.ObjectKey("SubMessageX", m.SubMessageX)
184 var messagesXSlice = SubMessagesPtr(m.MessagesX)
185 enc.ArrayKey("MessagesX", messagesXSlice)
186 enc.ObjectKey("SubMessageY", &m.SubMessageY)
187 var messagesYSlice = SubMessages(m.MessagesY)
188 enc.ArrayKey("MessagesY", messagesYSlice)
189 enc.BoolKey("IsTrue", *m.IsTrue)
190 var payloadSlice = gojay.EmbeddedJSON(m.Payload)
191 enc.AddEmbeddedJSONKey("Payload", &payloadSlice)
192}
193
194// IsNil checks if instance is nil
195func (m *Message) IsNil() bool {

Callers

nothing calls this directly

Calls 12

EmbeddedJSONTypeAlias · 0.92
IntKeyMethod · 0.80
StringKeyMethod · 0.80
Float64KeyMethod · 0.80
ArrayKeyMethod · 0.80
ObjectKeyMethod · 0.80
BoolKeyMethod · 0.80
AddEmbeddedJSONKeyMethod · 0.80
IntsTypeAlias · 0.70
Float64sTypeAlias · 0.70
SubMessagesPtrTypeAlias · 0.70
SubMessagesTypeAlias · 0.70

Tested by

no test coverage detected