coreapi unixfs: Return seeker from get

License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>


This commit was moved from ipfs/interface-go-ipfs-core@7fad965396

This commit was moved from ipfs/boxo@8d4196176a
This commit is contained in:
Łukasz Magiera 2018-10-15 12:45:49 +02:00
parent 278701f8d1
commit 7301aaa120

View File

@ -2,6 +2,7 @@ package iface
import (
"context"
"io"
options "github.com/ipfs/go-ipfs/core/coreapi/interface/options"
@ -17,6 +18,11 @@ type AddEvent struct {
Size string `json:",omitempty"`
}
type UnixfsFile interface {
files.SizeFile
io.Seeker
}
// UnixfsAPI is the basic interface to immutable files in IPFS
// NOTE: This API is heavily WIP, things are guaranteed to break frequently
type UnixfsAPI interface {
@ -29,7 +35,7 @@ type UnixfsAPI interface {
//
// Note that some implementations of this API may apply the specified context
// to operations performed on the returned file
Get(context.Context, Path) (files.File, error)
Get(context.Context, Path) (UnixfsFile, error)
// Ls returns the list of links in a directory
Ls(context.Context, Path) ([]*ipld.Link, error)