github.com/anchore/syft@v1.4.2-0.20240516191711-1bec1fc5d397/syft/pkg/cataloger.go (about)

     1  package pkg
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/anchore/syft/syft/artifact"
     7  	"github.com/anchore/syft/syft/file"
     8  )
     9  
    10  // Cataloger describes behavior for an object to participate in parsing container image or file system
    11  // contents for the purpose of discovering Packages. Each concrete implementation should focus on discovering Packages
    12  // for a specific Package Type or ecosystem.
    13  type Cataloger interface {
    14  	// Name returns a string that uniquely describes a cataloger
    15  	Name() string
    16  	// Catalog is given an object to resolve file references and content, this function returns any discovered Packages after analyzing the catalog source.
    17  	Catalog(context.Context, file.Resolver) ([]Package, []artifact.Relationship, error)
    18  }