mirror of
https://github.com/anchore/syft
synced 2024-11-12 23:27:20 +00:00
3da679066e
* [wip] initial syft api examples Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * smooth over some rough edges in the API Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * embed example file Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * address review comments Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * change name of builder function Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> --------- Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
15 lines
673 B
Markdown
15 lines
673 B
Markdown
# Syft API Examples
|
|
|
|
This directory contains examples of how to use the Syft API.
|
|
|
|
- `create_simple_sbom`: Create a simple SBOM from scratch
|
|
- `create_custom_sbom`: Create an SBOM using as much custom configuration as possible, including a custom cataloger implementation
|
|
- `decode_sbom`: Take an existing SBOM file (of arbitrary format) and decode it into a Syft SBOM object
|
|
- `source_detection`: Shows how to detect what to catalog automatically from a user string (e.g. container image vs directory)
|
|
- `source_from_image`: Construct a source from a only a container image
|
|
|
|
You can run any of these examples from this directory with:
|
|
|
|
```bash
|
|
go run ./DIRECTORY_NAME
|
|
```
|