-
Notifications
You must be signed in to change notification settings - Fork 45
/
interfaces.go
45 lines (38 loc) · 1.18 KB
/
interfaces.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
package filetree
import (
"github.com/anchore/stereoscope/pkg/file"
"github.com/anchore/stereoscope/pkg/filetree/filenode"
"github.com/anchore/stereoscope/pkg/tree"
)
type ReadWriter interface {
Reader
Writer
}
type Reader interface {
AllFiles(types ...file.Type) []file.Reference
TreeReader() tree.Reader
PathReader
Walker
Copier
}
type PathReader interface {
File(path file.Path, options ...LinkResolutionOption) (bool, *file.Resolution, error)
FilesByGlob(query string, options ...LinkResolutionOption) ([]file.Resolution, error)
AllRealPaths() []file.Path
ListPaths(dir file.Path) ([]file.Path, error)
HasPath(path file.Path, options ...LinkResolutionOption) bool
}
type Copier interface {
Copy() (ReadWriter, error)
}
type Walker interface {
Walk(fn func(path file.Path, f filenode.FileNode) error, conditions *WalkConditions) error
}
type Writer interface {
AddFile(realPath file.Path) (*file.Reference, error)
AddSymLink(realPath file.Path, linkPath file.Path) (*file.Reference, error)
AddHardLink(realPath file.Path, linkPath file.Path) (*file.Reference, error)
AddDir(realPath file.Path) (*file.Reference, error)
RemovePath(path file.Path) error
Merge(upper Reader) error
}