-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathstructs.go
113 lines (82 loc) · 2.4 KB
/
structs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
package mtpx
import (
"github.com/ganeshrvel/go-mtpfs/mtp"
"os"
"time"
)
type allowedSecondExtMap map[string]string
type Init struct {
DebugMode bool
}
type StorageData struct {
Sid uint32
Info mtp.StorageInfo
}
type FileInfo struct {
Size int64
IsDir bool
ModTime time.Time
Name string
FullPath string
ParentPath string
Extension string
ParentId uint32
ObjectId uint32
Info *mtp.ObjectInfo
}
type WalkCb func(objectId uint32, fi *FileInfo, err error) error
type TransferSizeInfo struct {
// total size to transfer
// note: the value will be 0 if pre-processing was not allowed
Total int64
// total size transferred
Sent int64
// progress in percentage
Progress float32
}
type ProgressInfo struct {
FileInfo *FileInfo
// transfer starting time
StartTime time.Time
// most recent transfer time
LatestSentTime time.Time
// transfer rate (in MB/s)
Speed float64
// total files to transfer
// note: the value will be 0 if pre-processing was not allowed
TotalFiles int64
// total directories to transfer
// note: the value will be 0 if pre-processing was not allowed
TotalDirectories int64
// total files transferred
FilesSent int64
// total file transfer progress in percentage
FilesSentProgress float32
// size information of the current file which is being transferred
ActiveFileSize *TransferSizeInfo
// total size information of the files for the transfer session
BulkFileSize *TransferSizeInfo
Status TransferStatus
}
type SizeProgressCb func(total, sent int64, objectId uint32, err error) error
type LocalWalkCb func(fi *os.FileInfo, fullPath string, err error) error
type ProgressCb func(fi *ProgressInfo, err error) error
type LocalPreprocessCb func(fi *os.FileInfo, fullPath string, err error) error
type MtpPreprocessCb func(fi *FileInfo, err error) error
type FileProp struct {
ObjectId uint32
FullPath string
}
type processDownloadFilesProps struct {
destinationFileParentPath, destinationFilePath, sourceParentPath string
bulkFilesSent, bulkSizeSent, totalFiles, totalSize int64
}
type downloadFilesObjectCache map[string]downloadFilesObjectCacheContainer
type downloadFilesObjectCacheContainer struct {
fileInfo *FileInfo
destinationFileParentPath, destinationFilePath, sourceParentPath string
}
type FileExistsContainer struct {
Exists bool
FileInfo *FileInfo
}