Improve documentation for complete uploads notifications

This commit is contained in:
Marius 2016-03-12 22:28:24 +01:00
parent 3ee1c61d80
commit acf2e8daee
2 changed files with 10 additions and 7 deletions

View File

@ -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

View File

@ -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.