Documentation
¶
Index ¶
- Constants
- type FileHandler
- func (fh *FileHandler) AddFile(ctx context.Context, r io.Reader) (ipld.Node, error)
- func (fh *FileHandler) DAGService() ipld.DAGService
- func (fh *FileHandler) GetFile(ctx context.Context, c cid.Cid) (ufsio.ReadSeekCloser, error)
- func (fh *FileHandler) HasCid(ctx context.Context, c cid.Cid) (exists bool, err error)
- type FileService
Constants ¶
View Source
const CName = "common.commonfile.fileservice"
View Source
const (
ChunkSize = 1 << 20
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileHandler ¶ added in v0.9.9
type FileHandler struct {
// contains filtered or unexported fields
}
FileHandler contains all the core file operations logic It can be used directly with any BlockStore implementation
func NewFileHandler ¶ added in v0.9.9
func NewFileHandler(bs fileblockstore.BlockStore) *FileHandler
NewFileHandler creates a new FileHandler with the given BlockStore
func (*FileHandler) DAGService ¶ added in v0.9.9
func (fh *FileHandler) DAGService() ipld.DAGService
DAGService returns the underlying DAG service
func (*FileHandler) GetFile ¶ added in v0.9.9
func (fh *FileHandler) GetFile(ctx context.Context, c cid.Cid) (ufsio.ReadSeekCloser, error)
GetFile gets file from ipfs storage
type FileService ¶
type FileService interface {
// GetFile gets file from ipfs storage
GetFile(ctx context.Context, c cid.Cid) (ufsio.ReadSeekCloser, error)
// AddFile adds file to ipfs storage
AddFile(ctx context.Context, r io.Reader) (ipld.Node, error)
// DAGService returns ipld.DAGService object
DAGService() ipld.DAGService
// HasCid checks is CID exists
HasCid(ctx context.Context, c cid.Cid) (exists bool, err error)
app.Component
}
func New ¶
func New() FileService
Click to show internal directories.
Click to hide internal directories.