Documentation ¶
Overview ¶
Package filelocker provide an upload locker based on the local file system.
It provides an exclusive upload locking mechanism using lock files which are stored on disk. Each of them stores the PID of the process which acquired the lock. This allows locks to be automatically freed when a process is unable to release it on its own because the process is not alive anymore. For more information, consult the documentation for handler.LockerDataStore interface, which is implemented by FileLocker.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileLocker ¶
type FileLocker struct { // Relative or absolute path to store files in. FileStore does not check // whether the path exists, use os.MkdirAll in this case on your own. Path string }
FileLocker See the tus.DataStore interface for documentation about the different methods.
func New ¶
func New(path string) FileLocker
New creates a new file based storage backend. The directory specified will be used as the only storage entry. This method does not check whether the path exists, use os.MkdirAll to ensure. In addition, a locking mechanism is provided.
func (FileLocker) UseIn ¶
func (locker FileLocker) UseIn(composer *tus.StoreComposer)
UseIn adds this locker to the passed composer.