Commit Graph

12 Commits

Author SHA1 Message Date
Marius b6a28421af Extract concatenation into own interface 2016-01-20 15:33:17 +01:00
Marius c9207d8c5f Extract GetReader into own interface 2016-01-19 22:32:15 +01:00
Marius b6d67debee Merge branch 'master' into s3
Conflicts:
	datastore.go
2015-12-27 00:48:06 +01:00
Marius 4af7434c10 Move terminating method in own interface
In addition, the DELETE handler is only provided if the TerminaterDataStore
interface is implemented.
2015-12-27 00:44:02 +01:00
Marius f6a5530df8 Integrate LockingStore into UnroutedHandler
The reason behind this drastic move was that sometimes a lock needs to
persist across multiple calls to a DataStore. For example, when a PATCH
request is received, following behaviour is wanted:
	* Obtain lock (LockUpload)
	* Get offset, size etc (GetInfo)
	* Write data (WriteChunk)
	* Release lock (UnlockUpload)
However, before this change, the lock would be release and then obtained again
after the GetInfo and before the WriteChunk call. This resulted in an
inefficient resource usage and even a possible race condition.

The effects of this change was:
* FileLocker is now directly integrated into FileStore and not sperarated
* LockingStore and the entire package has been removed
* MemoryLocker has been moved into its very own package
2015-12-26 21:23:09 +01:00
Marius 49d7c2ff78 Separate locking into data store implementation
The goal is to allow different locking mechanism to be used for different
storages. For example, in-memory for very few uploads, a file locker in
conjunction with the FileStore or an external service, such as ZooKeeper.
2015-12-09 20:25:08 +01:00
Marius ad5e486ba0 Merge master 2015-12-08 22:08:54 +01:00
Max Brosnahan e6f8969399 Handle failure to extract id from url 2015-12-08 09:37:34 +13:00
Max Brosnahan f27c9fd439 Remove dependency on pat for id extraction 2015-12-08 09:10:49 +13:00
Max Brosnahan 218cdfd022 Rename TusMiddleware function to Middleware 2015-12-08 09:10:02 +13:00
Max Brosnahan 12037a8e1d Tweak documentation 2015-12-08 09:09:47 +13:00
Max Brosnahan b36b5ac3bb Extract basic handlers into unrouted struct 2015-12-02 22:19:10 +00:00