You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Please refer to the Readme.md on how to use this type.
52
52
publicfinalclassTUSClient{
53
53
54
+
// MARK: - Public Properties
55
+
54
56
/// The number of uploads that the TUSClient will try to complete.
55
57
publicvarremainingUploads:Int{
56
58
uploads.count
57
59
}
60
+
publicletsessionIdentifier:String
61
+
public weak vardelegate:TUSClientDelegate?
58
62
59
-
staticletchunkSize:Int=500*1024
63
+
// MARK: - Private Properties
60
64
61
65
/// How often to try an upload if it fails. A retryCount of 2 means 3 total uploads max. (1 initial upload, and on repeated failure, 2 more retries.)
62
66
privateletretryCount=2
63
67
64
-
publicletsessionIdentifier:String
65
68
privateletfiles:Files
66
69
privatevardidStopAndCancel=false
67
70
privateletserverURL:URL
68
71
privateletscheduler=Scheduler()
69
72
privateletapi:TUSAPI
73
+
privateletchunkSize:Int
70
74
/// Keep track of uploads and their id's
71
75
privatevaruploads=[UUID: UploadMetadata]()
72
-
public weak vardelegate:TUSClientDelegate?
73
76
74
77
#if os(iOS)
75
78
@available(iOS 13.0,*)
@@ -85,12 +88,14 @@ public final class TUSClient {
85
88
/// - storageDirectory: A directory to store local files for uploading and continuing uploads. Leave nil to use the documents dir. Pass a relative path (e.g. "TUS" or "/TUS" or "/Uploads/TUS") for a relative directory inside the documents directory.
86
89
/// You can also pass an absolute path, e.g. "file://uploads/TUS"
87
90
/// - session: A URLSession you'd like to use. Will default to `URLSession.shared`.
91
+
/// - chunkSize: The amount of bytes the data to upload will be chunked by. Defaults to 512 kB.
88
92
/// - Throws: File related errors when it can't make a directory at the designated path.
/// Decide which task to create based on metaData.
501
506
/// - Parameter metaData: The `UploadMetadata` for which to create a `Task`.
502
507
/// - Returns: The task that has to be performed for the relevant metaData. Will return nil if metaData's file is already uploaded / finished. (no task needed).
0 commit comments