MCPcopy Create free account
hub / github.com/blues/note / GetBody

Method GetBody

lib/wire.go:620–641  ·  view source on GitHub ↗

GetBody gets the body from within the a notehubMessage

()

Source from the content-addressed store, hash-verified

618
619// GetBody gets the body from within the a notehubMessage
620func (msg *notehubMessage) GetBody() (body map[string]interface{}, err error) {
621 body = map[string]interface{}{}
622
623 // If native is available, return it
624 if msg.nf != nil && msg.nf.Body != nil {
625 body = *msg.nf.Body
626 return
627 }
628
629 // If compressed is available, return it
630 if msg.cf != nil && len(msg.cf.Body) != 0 {
631 jdata, err2 := jsonDecompress(msg.cf.Body)
632 if err2 != nil {
633 err = err2
634 } else {
635 err = note.JSONUnmarshal(jdata, &body)
636 }
637 return
638 }
639
640 return
641}
642
643// SetPayload sets the payload within the a notehubMessage data structure
644func (msg *notehubMessage) SetPayload(payload []byte) {

Callers 12

GetNotefileInfoMethod · 0.80
SetNotefileInfoMethod · 0.80
uAddNotefileMethod · 0.80
OpenNotefileMethod · 0.80
CheckpointNotefileMethod · 0.80
DeleteNotefileMethod · 0.80
MergeNoteboxMethod · 0.80
NoteboxNotefileDescMethod · 0.80
hubWebRequestFunction · 0.80
hubSignalFunction · 0.80
hubNotefileAddNoteFunction · 0.80
hubNotefileUpdateNoteFunction · 0.80

Calls 1

jsonDecompressFunction · 0.85

Tested by

no test coverage detected