summaryrefslogtreecommitdiffstats
path: root/modules/lfs/client.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/lfs/client.go')
-rw-r--r--modules/lfs/client.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/lfs/client.go b/modules/lfs/client.go
index ae35919d77..0a21440f73 100644
--- a/modules/lfs/client.go
+++ b/modules/lfs/client.go
@@ -10,9 +10,17 @@ import (
"net/url"
)
+// DownloadCallback gets called for every requested LFS object to process its content
+type DownloadCallback func(p Pointer, content io.ReadCloser, objectError error) error
+
+// UploadCallback gets called for every requested LFS object to provide its content
+type UploadCallback func(p Pointer, objectError error) (io.ReadCloser, error)
+
// Client is used to communicate with a LFS source
type Client interface {
- Download(ctx context.Context, oid string, size int64) (io.ReadCloser, error)
+ BatchSize() int
+ Download(ctx context.Context, objects []Pointer, callback DownloadCallback) error
+ Upload(ctx context.Context, objects []Pointer, callback UploadCallback) error
}
// NewClient creates a LFS client