-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathacona.go
47 lines (41 loc) · 1.54 KB
/
acona.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
package acona
import (
"io"
"github.com/pkg/errors"
)
var (
ErrorCantPurge = errors.New("can't purge directory")
ErrorCantCopy = errors.New("can't copy object - incompatible remotes")
ErrorCantMove = errors.New("can't move object - incompatible remotes")
ErrorCantDirMove = errors.New("can't move directory - incompatible remotes")
ErrorDirExists = errors.New("can't copy directory - destination already exists")
ErrorCantSetModTime = errors.New("can't set modified time")
ErrorDirNotFound = errors.New("directory not found")
ErrorObjectNotFound = errors.New("object not found")
ErrorLevelNotSupported = errors.New("level value not supported")
ErrorListAborted = errors.New("list aborted")
ErrorListOnlyRoot = errors.New("can only list from root")
ErrorIsFile = errors.New("is a file not a directory")
ErrorNotDeleting = errors.New("not deleting files as there were IO errors")
ErrorCantMoveOverlapping = errors.New("can't move files on overlapping remotes")
)
type Object interface {
Checksum() string
ID() string
IsDir() bool
ModTime() int64
MimeType() string
Path() string
Size() int64
Optional() interface{}
}
type Store interface {
Name() string
Root() string
PutObject(reader io.Reader, path, clientChecksum string) error
GetObject(path string) (io.ReadCloser, error)
Examine(path string) (Object, error)
ListTree(path string) ([]Object, error)
Remove(path string) error
Rename(sourcePath, targetPath string) error
}