From 21c83b17257be5c3015a92b9965550dceb3e9cdf Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sat, 12 May 2018 21:59:38 +0200 Subject: [PATCH] archiver: Add high-level documentation --- internal/archiver/archiver.go | 3 ++- internal/archiver/doc.go | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 internal/archiver/doc.go diff --git a/internal/archiver/archiver.go b/internal/archiver/archiver.go index 50f49f0f9..29cf8d332 100644 --- a/internal/archiver/archiver.go +++ b/internal/archiver/archiver.go @@ -293,7 +293,8 @@ func (fn *FutureNode) wait(ctx context.Context) { } // Save saves a target (file or directory) to the repo. If the item is -// excluded,this function returns a nil node and error. +// excluded,this function returns a nil node and error, with excluded set to +// true. // // Errors and completion is needs to be handled by the caller. // diff --git a/internal/archiver/doc.go b/internal/archiver/doc.go new file mode 100644 index 000000000..928145aa2 --- /dev/null +++ b/internal/archiver/doc.go @@ -0,0 +1,12 @@ +// Package archiver contains the code which reads files, splits them into +// chunks and saves the data to the repository. +// +// An Archiver has a number of worker goroutines handling saving the different +// data structures to the repository, the details are implemented by the +// FileSaver, BlobSaver, and TreeSaver types. +// +// The main goroutine (the one calling Snapshot()) traverses the directory tree +// and delegates all work to these worker pools. They return a type +// (FutureFile, FutureBlob, and FutureTree) which can be resolved later, by +// calling Wait() on it. +package archiver