Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pkg/storage/rclone/rclone.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ func (s *rcloneStorage) Pull(ctx context.Context, rpath string, w io.Writer) err
return err
}

func (s *rcloneStorage) ReadObject(ctx context.Context, rpath string) (io.ReadCloser, error) {
rpath = normalizeRemotePath(rpath)
obj, err := s.f.NewObject(ctx, rpath)
if err != nil {
return nil, err
}
return obj.Open(ctx)
}

func (s *rcloneStorage) Remove(ctx context.Context, rpath string, recursive bool) error {
rpath = normalizeRemotePath(rpath)
if !recursive {
Expand Down
3 changes: 3 additions & 0 deletions pkg/storage/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ type Storage interface {
// Stat returns the information about the given path.
// The `rpath` parameter can be a file.
Stat(ctx context.Context, rpath string) (StatResult, error)

// ReadObject reads a file.
ReadObject(ctx context.Context, rpath string) (io.ReadCloser, error)
}

type staticDirEntry struct {
Expand Down