storage

package module
v0.0.0-...-103f237 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package storage convenience wrapper around mfs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFSNode

func GetFSNode(root *mfs.Root, path string) (mfs.FSNode, error)

GetFSNode get the node at a path

func GetFile

func GetFile(root *mfs.Root, path string) ([]byte, error)

GetFile get data for file at path

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 GetNode

func GetNode(root *mfs.Root, path string) (*merkledag.ProtoNode, error)

GetNode get the DAG node at a path

func GetNodeForFSNode

func GetNodeForFSNode(fsnode mfs.FSNode) (*merkledag.ProtoNode, error)

GetNodeForFSNode convert an FSNode to a DAG node

func GetRoot

func GetRoot(root *mfs.Root) (ipld.Node, error)

GetRoot gets the current root 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.

func StoreFile

func StoreFile(root *mfs.Root, filepath string, contents []byte) *errors.Error

StoreFile store a file

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL