zrok/util/sync/model.go

24 lines
412 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)
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
2023-11-28 03:11:19 +01:00
SetModificationTime(path string, mtime time.Time) error
2023-11-27 21:44:38 +01:00
}