MCPcopy Create free account
hub / github.com/paypal/junodb / Encode

Method Encode

pkg/proto/encode.go:35–46  ·  view source on GitHub ↗
(msg IMessage)

Source from the content-addressed store, hash-verified

33}
34
35func (enc *Encoder) Encode(msg IMessage) (err error) {
36 switch msg.(type) {
37 case *OperationalMessage:
38 err = msg.(*OperationalMessage).Encode(&enc.rawMsg)
39 default:
40 err = ErrNotSupportedMessage
41 }
42 if err == nil {
43 _, err = enc.rawMsg.Write(enc.w)
44 }
45 return
46}
47
48// !!! When making change to getInfoForMetaHeader(), double check encodeMetaFields() to !!!
49// !!! make sure the sequence of the meta fields are the same !!!

Callers 15

testRequestResponseFunction · 0.95
testUDFRequestResponseFunction · 0.95
ReadFromMethod · 0.95
WriteToTomlMethod · 0.95
EncodeMethod · 0.95
EncodeMethod · 0.95
SetMockInfoMethod · 0.95
InitMethod · 0.95
ExecMethod · 0.95
debugConfigHandlerFunction · 0.95
DumpMethod · 0.95
debugConfigHandlerFunction · 0.95

Calls 1

WriteMethod · 0.65

Tested by 5

testRequestResponseFunction · 0.76
testUDFRequestResponseFunction · 0.76
BenchmarkEncodeFunction · 0.36
initFunction · 0.36