From acf2e8daee8138a8881d2628361a630af8aa966c Mon Sep 17 00:00:00 2001 From: Marius Date: Sat, 12 Mar 2016 22:28:24 +0100 Subject: [PATCH] Improve documentation for complete uploads notifications --- config.go | 6 +++--- unrouted_handler.go | 11 +++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/config.go b/config.go index 00edf7b..98ab97a 100644 --- a/config.go +++ b/config.go @@ -25,13 +25,13 @@ type Config struct { // absolute URL containing a scheme, e.g. "http://tus.io" BasePath string isAbs bool - // Initiate the CompleteUploads channel in the Handler struct in order to - // be notified about complete uploads + // NotifyCompleteUploads indicates whether sending notifications about + // completed uploads using the CompleteUploads channel should be enabled. NotifyCompleteUploads bool // NotifyTerminatedUploads indicates whether sending notifications about // terminated uploads using the TerminatedUploads channel should be enabled. NotifyTerminatedUploads bool - // Logger the logger to use internally + // Logger is the logger to use internally, mostly for printing requests. Logger *log.Logger // Respect the X-Forwarded-Host, X-Forwarded-Proto and Forwarded headers // potentially set by proxies when generating an absolute URL in the diff --git a/unrouted_handler.go b/unrouted_handler.go index 55e211d..da60c55 100644 --- a/unrouted_handler.go +++ b/unrouted_handler.go @@ -62,12 +62,15 @@ type UnroutedHandler struct { logger *log.Logger extensions string - // For each finished upload the corresponding info object will be sent using - // this unbuffered channel. The NotifyCompleteUploads property in the Config - // struct must be set to true in order to work. + // CompleteUploads is used to send notifications whenever an upload is + // completed by a user. The FileInfo will contain information about this + // upload after it is completed. Sending to this channel will only + // happen if the NotifyCompleteUploads field is set to true in the Config + // structure. Notifications will also be sent for completions using the + // Concatenation extension. CompleteUploads chan FileInfo // TerminatedUploads is used to send notifications whenever an upload is - // terminated by a user. The FileInfo will contain information about This + // terminated by a user. The FileInfo will contain information about this // upload gathered before the termination. Sending to this channel will only // happen if the NotifyTerminatedUploads field is set to true in the Config // structure.