github.com/anchore/syft@v1.4.2-0.20240516191711-1bec1fc5d397/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/internal/mimetype" 8 "github.com/anchore/syft/syft/pkg" 9 "github.com/anchore/syft/syft/pkg/cataloger/generic" 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, mimetype.ExecutableMIMETypeSet.List()...) 23 }