aboutsummaryrefslogtreecommitdiff
path: root/examples/README.md
diff options
context:
space:
mode:
authorSteve Winslow <swinslow@gmail.com>2018-10-24 17:46:56 -0400
committerGitHub <noreply@github.com>2018-10-24 17:46:56 -0400
commit941fa33ea499c1f9092818a264a38600efe1acce (patch)
tree27f7bbf471ef74dbde5a01003862d80aa198bcc9 /examples/README.md
parentd4c19259c711d59d26040295112d6d2fd618faa1 (diff)
downloadspdx-tools-941fa33ea499c1f9092818a264a38600efe1acce.tar.gz
Added examples (#29)
Closes #27 Signed-off-by: Steve Winslow <swinslow@gmail.com>
Diffstat (limited to 'examples/README.md')
-rw-r--r--examples/README.md44
1 files changed, 44 insertions, 0 deletions
diff --git a/examples/README.md b/examples/README.md
new file mode 100644
index 0000000..64e41f2
--- /dev/null
+++ b/examples/README.md
@@ -0,0 +1,44 @@
+SPDX-License-Identifier: CC-BY-4.0
+
+# spdx-go Examples
+
+The `examples/` directory contains examples for how to use the various spdx-go sub-packages.
+
+## 1-load/
+
+*tvloader*, *spdx*
+
+This example demonstrates loading an SPDX tag-value file from disk into memory,
+and printing some of its contents to standard output.
+
+## 2-load-save/
+
+*tvloader*, *tvsaver*
+
+This example demonstrates loading an SPDX tag-value file from disk into memory,
+and re-saving it to a different file on disk.
+
+## 3-build/
+
+*builder*, *tvsaver*
+
+This example demonstrates building an 'empty' SPDX document in memory that
+corresponds to a given directory's contents, including all files with their
+hashes and the package's verification code, and saving the document to disk.
+
+## 4-search/
+
+*idsearcher*, *tvsaver*
+
+This example demonstrates building an SPDX document for a directory's contents
+(implicitly using *builder*); searching through that directory for [SPDX
+short-form IDs](https://spdx.org/ids/); filling those IDs into the document's
+Package and File license fields; and saving the resulting document to disk.
+
+## 5-report/
+
+*reporter*, *tvloader*
+
+This example demonstrates loading an SPDX tag-value file from disk into memory,
+generating a basic report listing counts of the concluded licenses for its
+files, and printing the report to standard output.