mirror of
https://github.com/anchore/syft.git
synced 2026-11-01 23:16:30 +01:00
Add support for multiple output files in different formats (#732)
This commit is contained in:
@@ -50,10 +50,3 @@ func (f Format) Validate(reader io.Reader) error {
|
||||
|
||||
return f.validator(reader)
|
||||
}
|
||||
|
||||
func (f Format) Presenter(s sbom.SBOM) *Presenter {
|
||||
if f.encoder == nil {
|
||||
return nil
|
||||
}
|
||||
return NewPresenter(f.encoder, s)
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
package format
|
||||
|
||||
import (
|
||||
"io"
|
||||
|
||||
"github.com/anchore/syft/syft/sbom"
|
||||
)
|
||||
|
||||
type Presenter struct {
|
||||
sbom sbom.SBOM
|
||||
encoder Encoder
|
||||
}
|
||||
|
||||
func NewPresenter(encoder Encoder, s sbom.SBOM) *Presenter {
|
||||
return &Presenter{
|
||||
sbom: s,
|
||||
encoder: encoder,
|
||||
}
|
||||
}
|
||||
|
||||
func (pres *Presenter) Present(output io.Writer) error {
|
||||
return pres.encoder(output, pres.sbom)
|
||||
}
|
||||
Reference in New Issue
Block a user