github.com/noqcks/syft@v0.0.0-20230920222752-a9e2c4e288e5/syft/pkg/cataloger/rust/cataloger.go (about)

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