github.com/anchore/syft@v1.4.2-0.20240516191711-1bec1fc5d397/examples/README.md (about)

     1  # Syft API Examples
     2  
     3  This directory contains examples of how to use the Syft API.
     4  
     5  - `create_simple_sbom`: Create a simple SBOM from scratch
     6  - `create_custom_sbom`: Create an SBOM using as much custom configuration as possible, including a custom cataloger implementation
     7  - `decode_sbom`: Take an existing SBOM file (of arbitrary format) and decode it into a Syft SBOM object
     8  - `source_detection`: Shows how to detect what to catalog automatically from a user string (e.g. container image vs directory)
     9  - `source_from_image`: Construct a source from a only a container image
    10  
    11  You can run any of these examples from this directory with:
    12  
    13  ```bash
    14  go run ./DIRECTORY_NAME
    15  ```