Documentation ¶
Overview ¶
Package storage convenience wrapper around mfs
Index ¶
- func GetFSNode(root *mfs.Root, path string) (mfs.FSNode, error)
- func GetFile(root *mfs.Root, path string) ([]byte, error)
- func GetFileStreamForBlock(urlPath string, block blocks.Block, dag ipld.DAGService) (io.ReadSeeker, error)
- func GetNode(root *mfs.Root, path string) (*merkledag.ProtoNode, error)
- func GetNodeForFSNode(fsnode mfs.FSNode) (*merkledag.ProtoNode, error)
- func GetRoot(root *mfs.Root) (ipld.Node, error)
- func NewStorage(protoNode *merkledag.ProtoNode, ds ipld.DAGService) (root *mfs.Root, err error)
- func StoreFile(root *mfs.Root, filepath string, contents []byte) *errors.Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFileStreamForBlock ¶
func GetFileStreamForBlock(urlPath string, block blocks.Block, dag ipld.DAGService) (io.ReadSeeker, error)
GetFileStreamForBlock get a streem on the file for a block
func GetNodeForFSNode ¶
func GetNodeForFSNode(fsnode mfs.FSNode) (*merkledag.ProtoNode, error)
GetNodeForFSNode convert an FSNode to a DAG node
func NewStorage ¶
func NewStorage(protoNode *merkledag.ProtoNode, ds ipld.DAGService) (root *mfs.Root, err error)
NewStorage create an mfs root to use for storage. Close it when you're done with it.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.