projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
8784: Add keep-web directory listings via (*arvados.Collection)FileSystem().
[arvados.git]
/
sdk
/
go
/
keepclient
/
collectionreader.go
diff --git
a/sdk/go/keepclient/collectionreader.go
b/sdk/go/keepclient/collectionreader.go
index 344a70c50bf09798e27bb41187fbdcb4d8d35b6e..527318eb49c67046ca86bf2183eceb75d3bcc157 100644
(file)
--- a/
sdk/go/keepclient/collectionreader.go
+++ b/
sdk/go/keepclient/collectionreader.go
@@
-6,19
+6,10
@@
import (
"io"
"os"
"io"
"os"
+ "git.curoverse.com/arvados.git/sdk/go/arvados"
"git.curoverse.com/arvados.git/sdk/go/manifest"
)
"git.curoverse.com/arvados.git/sdk/go/manifest"
)
-// A Reader implements, io.Reader, io.Seeker, and io.Closer, and has a
-// Len() method that returns the total number of bytes available to
-// read.
-type Reader interface {
- io.Reader
- io.Seeker
- io.Closer
- Len() uint64
-}
-
const (
// After reading a data block from Keep, cfReader slices it up
// and sends the slices to a buffered channel to be consumed
const (
// After reading a data block from Keep, cfReader slices it up
// and sends the slices to a buffered channel to be consumed
@@
-38,7
+29,7
@@
var ErrNoManifest = errors.New("Collection has no manifest")
// CollectionFileReader returns a Reader that reads content from a single file
// in the collection. The filename must be relative to the root of the
// collection. A leading prefix of "/" or "./" in the filename is ignored.
// CollectionFileReader returns a Reader that reads content from a single file
// in the collection. The filename must be relative to the root of the
// collection. A leading prefix of "/" or "./" in the filename is ignored.
-func (kc *KeepClient) CollectionFileReader(collection map[string]interface{}, filename string) (
Reader
, error) {
+func (kc *KeepClient) CollectionFileReader(collection map[string]interface{}, filename string) (
arvados.File
, error) {
mText, ok := collection["manifest_text"].(string)
if !ok {
return nil, ErrNoManifest
mText, ok := collection["manifest_text"].(string)
if !ok {
return nil, ErrNoManifest
@@
-47,7
+38,7
@@
func (kc *KeepClient) CollectionFileReader(collection map[string]interface{}, fi
return kc.ManifestFileReader(m, filename)
}
return kc.ManifestFileReader(m, filename)
}
-func (kc *KeepClient) ManifestFileReader(m manifest.Manifest, filename string) (
Reader
, error) {
+func (kc *KeepClient) ManifestFileReader(m manifest.Manifest, filename string) (
arvados.File
, error) {
f := &file{
kc: kc,
}
f := &file{
kc: kc,
}
@@
-164,9
+155,9
@@
func (f *file) Seek(offset int64, whence int) (int64, error) {
return f.offset, nil
}
return f.offset, nil
}
-//
Len
returns the file size in bytes.
-func (f *file)
Len() u
int64 {
- return
uint64(f.size)
+//
Size
returns the file size in bytes.
+func (f *file)
Size()
int64 {
+ return
f.size
}
func (f *file) load(m manifest.Manifest, path string) error {
}
func (f *file) load(m manifest.Manifest, path string) error {