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

Method SetBody

lib/wire.go:599–617  ·  view source on GitHub ↗

SetBody sets the body within the a notehubMessage data structure

(body map[string]interface{})

Source from the content-addressed store, hash-verified

597
598// SetBody sets the body within the a notehubMessage data structure
599func (msg *notehubMessage) SetBody(body map[string]interface{}) error {
600 // Set native form
601 if msg.nf == nil {
602 msg.nf = &nf{}
603 }
604 msg.nf.Body = &body
605
606 // Set compressed form
607 JSON, err := note.JSONMarshal(body)
608 if err != nil {
609 return err
610 }
611 if msg.cf == nil {
612 msg.cf = &cf{}
613 }
614 msg.cf.Body, err = jsonCompress(JSON)
615
616 return err
617}
618
619// GetBody gets the body from within the a notehubMessage
620func (msg *notehubMessage) GetBody() (body map[string]interface{}, err error) {

Callers 4

SetNotefileInfoMethod · 0.80
uAddNotefileMethod · 0.80
MergeNoteboxMethod · 0.80
hubNotefileUpdateNoteFunction · 0.80

Calls 1

jsonCompressFunction · 0.85

Tested by

no test coverage detected