mirror of
https://github.com/kopia/kopia.git
synced 2026-03-18 22:26:26 -04:00
22 lines
325 B
Go
22 lines
325 B
Go
package vfs
|
|
|
|
import (
|
|
"io/ioutil"
|
|
|
|
"golang.org/x/net/context"
|
|
)
|
|
|
|
// fileNode implements both Node and Handle.
|
|
type fileNode struct {
|
|
node
|
|
}
|
|
|
|
func (f *fileNode) ReadAll(ctx context.Context) ([]byte, error) {
|
|
reader, err := f.manager.open(f.ObjectID)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return ioutil.ReadAll(reader)
|
|
}
|