github.com/lineaje-labs/syft@v0.98.1-0.20231227153149-9e393f60ff1b/syft/pkg/cataloger/rust/cataloger.go (about)

     1  /*
     2  Package rust provides a concrete Cataloger implementation relating to packages within the Rust language ecosystem.
     3  */
     4  package rust
     5  
     6  import (
     7  	"github.com/anchore/syft/syft/pkg"
     8  	"github.com/anchore/syft/syft/pkg/cataloger/generic"
     9  	"github.com/lineaje-labs/syft/internal"
    10  )
    11  
    12  // NewCargoLockCataloger returns a new Rust Cargo lock file cataloger object.
    13  func NewCargoLockCataloger() pkg.Cataloger {
    14  	return generic.NewCataloger("rust-cargo-lock-cataloger").
    15  		WithParserByGlobs(parseCargoLock, "**/Cargo.lock")
    16  }
    17  
    18  // NewAuditBinaryCataloger returns a new Rust auditable binary cataloger object that can detect dependencies
    19  // in binaries produced with https://github.com/Shnatsel/rust-audit
    20  func NewAuditBinaryCataloger() pkg.Cataloger {
    21  	return generic.NewCataloger("cargo-auditable-binary-cataloger").
    22  		WithParserByMimeTypes(parseAuditBinary, internal.ExecutableMIMETypeSet.List()...)
    23  }