syft/imgbom/presenter/presenter.go
Alfredo Deza 72f9091493 presenter: allow a text presenter option
Signed-off-by: Alfredo Deza <adeza@anchore.com>
2020-06-19 15:46:31 -04:00

26 lines
498 B
Go

package presenter
import (
"io"
"github.com/anchore/imgbom/imgbom/pkg"
"github.com/anchore/imgbom/imgbom/presenter/json"
"github.com/anchore/imgbom/imgbom/presenter/text"
"github.com/anchore/stereoscope/pkg/image"
)
type Presenter interface {
Present(io.Writer, *image.Image, *pkg.Catalog) error
}
func GetPresenter(option Option) Presenter {
switch option {
case JSONPresenter:
return json.NewPresenter()
case TextPresenter:
return text.NewPresenter()
default:
return nil
}
}