package resolution import ( mcat "git.novox.be/novox/mesh-sdk/go/catalogue" ) // DataItems is every data item the resolution's modules declare, placed on its node with the rendering given: the text // the node-backup holder is handed, read. A module left out of the node's declaration keeps its items, as its data is // still on the node (ADR 0262); an item that cannot be placed is said in unplaced and left out. func DataItems(r mcat.Resolution, with mcat.Rendering) (items map[string][]mcat.PlacedDataItem, unplaced []string, err error) { left := LeftOut(r, with.Settings, with.Adopted) for module, why := range with.NotPlaced { if _, already := left[module]; !already { left[module] = why } } modules := make([]mcat.Manifest, 0, len(r.Modules)) for _, m := range r.Modules { if _, isLeft := left[m.Module]; isLeft { m = backupView(m) } modules = append(modules, m) } text, unplaced, err := seatContributions(modules, mcat.Manifest{}, mcat.BackupSeat+":"+mcat.BackupKindData, with, machineFacts(r, with.Names, with.MeshRange), r.Capabilities) if err != nil { return nil, unplaced, err } items, err = mcat.ParseDataItems(text) return items, unplaced, err }