MCPcopy Create free account
hub / github.com/XmirrorSecurity/OpenSCA-cli / AppendComponents

Method AppendComponents

opensca/model/bomsw.go:98–117  ·  view source on GitHub ↗
(fn func(*BomSWComponent))

Source from the content-addressed store, hash-verified

96}
97
98func (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
119func (doc *BomSWDocument) AppendDependencies(parentId string, childrenIds []string) {
120 if doc.Software.Dependencies == nil {

Callers 1

bomSWDocFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected