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" // absolute URL containing a scheme, e.g. "http://tus.io"
BasePath string BasePath string
isAbs bool isAbs bool
// Initiate the CompleteUploads channel in the Handler struct in order to // NotifyCompleteUploads indicates whether sending notifications about
// be notified about complete uploads // completed uploads using the CompleteUploads channel should be enabled.
NotifyCompleteUploads bool NotifyCompleteUploads bool
// NotifyTerminatedUploads indicates whether sending notifications about // NotifyTerminatedUploads indicates whether sending notifications about
// terminated uploads using the TerminatedUploads channel should be enabled. // terminated uploads using the TerminatedUploads channel should be enabled.
NotifyTerminatedUploads bool NotifyTerminatedUploads bool
// Logger the logger to use internally // Logger is the logger to use internally, mostly for printing requests.
Logger *log.Logger Logger *log.Logger
// Respect the X-Forwarded-Host, X-Forwarded-Proto and Forwarded headers // Respect the X-Forwarded-Host, X-Forwarded-Proto and Forwarded headers
// potentially set by proxies when generating an absolute URL in the // potentially set by proxies when generating an absolute URL in the

View File

@ -62,12 +62,15 @@ type UnroutedHandler struct {
logger *log.Logger logger *log.Logger
extensions string extensions string
// For each finished upload the corresponding info object will be sent using // CompleteUploads is used to send notifications whenever an upload is
// this unbuffered channel. The NotifyCompleteUploads property in the Config // completed by a user. The FileInfo will contain information about this
// struct must be set to true in order to work. // 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 CompleteUploads chan FileInfo
// TerminatedUploads is used to send notifications whenever an upload is // 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 // upload gathered before the termination. Sending to this channel will only
// happen if the NotifyTerminatedUploads field is set to true in the Config // happen if the NotifyTerminatedUploads field is set to true in the Config
// structure. // structure.