| 96 | } |
| 97 | |
| 98 | func (doc *BomSWDocument) AppendComponents(fn func(*BomSWComponent)) { |
| 99 | c := BomSWComponent{ |
| 100 | Author: map[string]string{ |
| 101 | "name": "NONE", |
| 102 | }, |
| 103 | Provider: map[string]string{ |
| 104 | "shortName": "NONE", |
| 105 | "fullName": "NONE", |
| 106 | }, |
| 107 | HashValue: []swChecksumValue{}, |
| 108 | License: []string{}, |
| 109 | } |
| 110 | if fn != nil { |
| 111 | fn(&c) |
| 112 | } |
| 113 | if c.Timestamp == "" { |
| 114 | c.Timestamp = time.Now().Format("2006-01-02T15:04:05MST") |
| 115 | } |
| 116 | doc.Software.Components = append(doc.Software.Components, c) |
| 117 | } |
| 118 | |
| 119 | func (doc *BomSWDocument) AppendDependencies(parentId string, childrenIds []string) { |
| 120 | if doc.Software.Dependencies == nil { |