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

Method SetNotefiles

lib/wire.go:542–560  ·  view source on GitHub ↗

SetNotefiles sets the notefile list within the a notehubMessage data structure

(notefiles map[string]*Notefile)

Source from the content-addressed store, hash-verified

540
541// SetNotefiles sets the notefile list within the a notehubMessage data structure
542func (msg *notehubMessage) SetNotefiles(notefiles map[string]*Notefile) error {
543 // Set native form
544 if msg.nf == nil {
545 msg.nf = &nf{}
546 }
547 msg.nf.Notefiles = &notefiles
548
549 // Set compressed form
550 JSON, err := note.JSONMarshal(notefiles)
551 if err != nil {
552 return err
553 }
554 if msg.cf == nil {
555 msg.cf = &cf{}
556 }
557 msg.cf.Notefiles, err = jsonCompress(JSON)
558
559 return err
560}
561
562// GetNotefiles gets the multi-notefile structure from within the a notehubMessage
563func (msg *notehubMessage) GetNotefiles() (notefiles map[string]*Notefile, err error) {

Callers

nothing calls this directly

Calls 1

jsonCompressFunction · 0.85

Tested by

no test coverage detected