-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathresponse.go
84 lines (69 loc) · 5.76 KB
/
response.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
package elfinder
// source code from https://github.com/Supme/goElFinder/blob/master/types.go
var defaultOptions = options{
Separator: "/",
Archivers: archivers{Create: []string{}, Extract: []string{}},
CopyOverwrite: 1}
type ElfResponse struct {
Api float64 `json:"api,omitempty"` // The version number of the protocol, must be >= 2.1, ATTENTION - return api ONLY for init request!
Cwd FileDir `json:"cwd,omitempty"` // Current Working Directory - information about the current directory. Information about File/Directory
Files []FileDir `json:"files"` // array of objects - files and directories in current directory. If parameter tree == true, then added to the folder of the directory tree to a given depth. The order of files is not important. Note you must include the top-level volume objects here as well (i.e. cwd is repeated here, in addition to other volumes)
NetDrivers []string `json:"netDrivers,omitempty"` // Network protocols list which can be mounted on the fly (using netmount command). Now only ftp supported.
Options options `json:"options,omitempty"`
UplMaxFile string `json:"uplMaxFile,omitempty"` // Allowed upload max number of file per request. For example 20
UplMaxSize string `json:"uplMaxSize,omitempty"` // Allowed upload max size per request. For example "32M"
Tree []FileDir `json:"tree"` // for tree
Dim string `json:"dim,omitempty"` // for images
Added []FileDir `json:"added"` // for upload, mkdir, rename
Warning []string `json:"warning,omitempty"` // for upload
Changed []FileDir `json:"changed,omitempty"` // for mkdir
Hashes map[string]string `json:"hashes,omitempty"` // for mkdir
List []string `json:"list,omitempty"` // for ls
Size int64 `json:"size,omitempty"` // for size
Zipdl map[string]string `json:"zipdl,omitempty"` // zipdl
Name string `json:"_name,omitempty"`
Chunkmerged string `json:"_chunkmerged,omitempty"`
Removed []string `json:"removed,omitempty"` // for remove, rename
Images map[string]string `json:"images,omitempty"` // for tmb
Content string `json:"content,omitempty"` // for get
Url string `json:"url,omitempty"` // for url
Error interface{} `json:"error,omitempty"`
}
type options struct {
Path string `json:"path,omitempty"` // Current folder path
Url string `json:"url,omitempty"` // Current folder URL
TmbUrl string `json:"tmbURL,omitempty"` // Thumbnails folder URL
Separator string `json:"separator,omitempty"` // Path separator for the current volume
Disabled []string `json:"disabled,omitempty"` // List of commands not allowed (disabled) on this volume
Archivers archivers `json:"archivers,omitempty"`
CopyOverwrite int64 `json:"copyOverwrite,omitempty"` // (Number) Whether or not to overwrite files with the same name on the current volume when copy
// ToDo https://github.com/Studio-42/elFinder/wiki/Client-Server-API-2.1#open
}
type archivers struct {
Create []string `json:"create,omitempty"` // List of the mime type of archives which can be created
Extract []string `json:"extract,omitempty"` // List of the mime types that can be extracted / unpacked
Createext map[string]string `json:"createext,omitempty"` // Map list of { MimeType: FileExtention }
}
type FileDir struct {
Name string `json:"name,omitempty"` // name of file/dir. Required
Hash string `json:"hash,omitempty"` // hash of current file/dir path, first symbol must be letter, symbols before _underline_ - volume id, Required.
Phash string `json:"phash,omitempty"` // hash of parent directory. Required except roots dirs.
Mime string `json:"mime,omitempty"` // mime type. Required.
Ts int64 `json:"ts,omitempty"` // file modification time in unix timestamp. Required.
Size int64 `json:"size,omitempty"` // file size in bytes
Dirs byte `json:"dirs,omitempty"` // Only for directories. Marks if directory has child directories inside it. 0 (or not set) - no, 1 - yes. Do not need to calculate amount.
Read byte `json:"read,omitempty"` // is readable
Write byte `json:"write,omitempty"` // is writable
Isroot byte `json:"isroot,omitempty"`
Locked byte `json:"locked,omitempty"` // is file locked. If locked that object cannot be deleted, renamed or moved
Tmb string `json:"tmb,omitempty"` // Only for images. Thumbnail file name, if file do not have thumbnail yet, but it can be generated than it must have value "1"
Alias string `json:"alias,omitempty"` // For symlinks only. Symlink target path.
Thash string `json:"thash,omitempty"` // For symlinks only. Symlink target hash.
Dim string `json:"dim,omitempty"` // For images - file dimensions. Optionally.
Isowner bool `json:"isowner,omitempty"` // has ownership. Optionally.
Cssclr string `json:"cssclr,omitempty"` // CSS class name for holder icon. Optionally. It can include to options.
Volumeid string `json:"volumeid,omitempty"` // Volume id. For directory only. It can include to options.
Netkey string `json:"netkey,omitempty"` // Netmount volume unique key, Required for netmount volume. It can include to options.
Options options `json:"options,omitempty"` // For volume root only. This value is same to cwd.options.
Debug map[string]interface{} `json:"debug,omitempty"` // For volume root only. This value is same to cwd.options.
}