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
|
2024-01-09 19:58:38 +01:00
|
|
|
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)
|
2024-01-09 19:58:38 +01:00
|
|
|
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
|
2024-01-11 19:19:20 +01:00
|
|
|
Move(src, dest string) error
|
2024-01-11 18:11:21 +01:00
|
|
|
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
|
|
|
}
|