From f3076c3905dd491de3740605adf1f1ad67fd0d59 Mon Sep 17 00:00:00 2001 From: Alex Goodman Date: Thu, 17 Sep 2020 06:02:51 -0400 Subject: [PATCH] Add docs around the main execution path (#172) * add docs around the main execution path of syft Signed-off-by: Alex Goodman * Update syft/lib.go Co-authored-by: Alfredo Deza Signed-off-by: Alex Goodman * Update syft/lib.go Co-authored-by: Alfredo Deza Signed-off-by: Alex Goodman * wrap line Signed-off-by: Alex Goodman Co-authored-by: Alfredo Deza --- syft/lib.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/syft/lib.go b/syft/lib.go index b74bf3efe..e7ee3e34b 100644 --- a/syft/lib.go +++ b/syft/lib.go @@ -1,5 +1,18 @@ /* A "one-stop-shop" for helper utilities for all major functionality provided by child packages of the syft library. + +Here is what the main execution path for syft does: + + 1. Parse a user image string to get a stereoscope image.Image object + 2. Invoke all catalogers to catalog the image, adding discovered packages to a single catalog object + 3. Invoke a single presenter to show the contents of the catalog + +A Scope object encapsulates the image object to be cataloged and the user options (catalog all layers vs. squashed layer), +providing a way to inspect paths and file content within the image. The Scope object, not the image object, is used +throughout the main execution path. This abstraction allows for decoupling of what is cataloged (a docker image, an OCI +image, a filesystem, etc) and how it is cataloged (the individual catalogers). + +Similar to the cataloging process, Linux distribution identification is also performed based on what is discovered within the image. */ package syft