Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alist-org
GitHub Repository: alist-org/alist
Path: blob/main/internal/model/archive.go
1560 views
1
package model
2
3
import "time"
4
5
type ObjTree interface {
6
Obj
7
GetChildren() []ObjTree
8
}
9
10
type ObjectTree struct {
11
Object
12
Children []ObjTree
13
}
14
15
func (t *ObjectTree) GetChildren() []ObjTree {
16
return t.Children
17
}
18
19
type ArchiveMeta interface {
20
GetComment() string
21
// IsEncrypted means if the content of the archive requires a password to access
22
// GetArchiveMeta should return errs.WrongArchivePassword if the meta-info is also encrypted,
23
// and the provided password is empty.
24
IsEncrypted() bool
25
// GetTree directly returns the full folder structure
26
// returns nil if the folder structure should be acquired by calling driver.ArchiveReader.ListArchive
27
GetTree() []ObjTree
28
}
29
30
type ArchiveMetaInfo struct {
31
Comment string
32
Encrypted bool
33
Tree []ObjTree
34
}
35
36
func (m *ArchiveMetaInfo) GetComment() string {
37
return m.Comment
38
}
39
40
func (m *ArchiveMetaInfo) IsEncrypted() bool {
41
return m.Encrypted
42
}
43
44
func (m *ArchiveMetaInfo) GetTree() []ObjTree {
45
return m.Tree
46
}
47
48
type ArchiveMetaProvider struct {
49
ArchiveMeta
50
*Sort
51
DriverProviding bool
52
Expiration *time.Duration
53
}
54
55