Export the presenter interface so it may be used by external projects

Signed-off-by: Samuel Dacanay <sam.dacanay@anchore.com>
This commit is contained in:
Samuel Dacanay
2021-06-09 10:21:55 -07:00
committed by Sam Dacanay
parent 801e662633
commit 5a2e2eb679
7 changed files with 14 additions and 11 deletions
@@ -3,9 +3,10 @@ package integration
import (
"bytes"
"encoding/json"
exportedPackages "github.com/anchore/syft/syft/presenter/packages"
"testing"
"github.com/anchore/syft/internal/presenter/packages"
internalPackages "github.com/anchore/syft/internal/presenter/packages"
)
func TestPackageOwnershipRelationships(t *testing.T) {
@@ -23,7 +24,7 @@ func TestPackageOwnershipRelationships(t *testing.T) {
t.Run(test.fixture, func(t *testing.T) {
catalog, d, src := catalogFixtureImage(t, test.fixture)
p := packages.Presenter(packages.JSONPresenterOption, packages.PresenterConfig{
p := exportedPackages.Presenter(exportedPackages.JSONPresenterOption, exportedPackages.PresenterConfig{
SourceMetadata: src.Metadata,
Catalog: catalog,
Distro: d,
@@ -38,7 +39,7 @@ func TestPackageOwnershipRelationships(t *testing.T) {
t.Fatalf("unable to present: %+v", err)
}
var doc packages.JSONDocument
var doc internalPackages.JSONDocument
decoder := json.NewDecoder(output)
if err := decoder.Decode(&doc); err != nil {
t.Fatalf("unable to decode json doc: %+v", err)