zrok/drives/sync/model.go

28 lines
600 B
Go
Raw Normal View History

2023-11-27 21:44:38 +01:00
package sync
2023-11-27 23:31:13 +01:00
import (
"io"
"os"
"time"
)
2023-11-27 21:44:38 +01:00
type Object struct {
Path string
IsDir bool
2023-11-27 21:44:38 +01:00
Size int64
Modified time.Time
ETag string
}
type Target interface {
Inventory() ([]*Object, error)
2024-01-10 20:35:27 +01:00
Dir(path string) ([]*Object, error)
Mkdir(path string) error
2023-11-27 23:31:13 +01:00
ReadStream(path string) (io.ReadCloser, error)
WriteStream(path string, stream io.Reader, mode os.FileMode) error
WriteStreamWithModTime(path string, stream io.Reader, mode os.FileMode, modTime time.Time) error
2024-01-11 19:19:20 +01:00
Move(src, dest string) error
Rm(path string) error
2023-11-28 03:11:19 +01:00
SetModificationTime(path string, mtime time.Time) error
2023-11-27 21:44:38 +01:00
}