Documentation ¶
Index ¶
- func Add(n *core.IpfsNode, r io.Reader) (string, error)
- func AddMetadataTo(n *core.IpfsNode, skey string, m *ft.Metadata) (string, error)
- func AddR(n *core.IpfsNode, root string) (key string, err error)
- func AddWithContext(ctx context.Context, n *core.IpfsNode, r io.Reader) (string, error)
- func AddWrapped(n *core.IpfsNode, r io.Reader, filename string) (string, ipld.Node, error)
- func Cat(ctx context.Context, n *core.IpfsNode, pstr string) (uio.DagReader, error)
- func Metadata(n *core.IpfsNode, skey string) (*ft.Metadata, error)
- func NewMemoryDagService() ipld.DAGService
- type AddedObject
- type Adder
- type Link
- type Object
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Add ¶
Add builds a merkledag node from a reader, adds it to the blockstore, and returns the key representing that node. If you want to pin it, use NewAdder() and Adder.PinRoot().
func AddMetadataTo ¶
func AddWithContext ¶ added in v0.4.5
AddWithContext does the same as Add, but with a custom context.
func AddWrapped ¶
AddWrapped adds data from a reader, and wraps it with a directory object to preserve the filename. Returns the path of the added file ("<dir hash>/filename"), the DAG node of the directory, and and error if any.
func NewMemoryDagService ¶ added in v0.4.0
func NewMemoryDagService() ipld.DAGService
NewMemoryDagService builds and returns a new mem-datastore.
Types ¶
type AddedObject ¶ added in v0.4.0
type Adder ¶ added in v0.4.0
type Adder struct { Out chan interface{} Progress bool Hidden bool Pin bool Trickle bool RawLeaves bool Silent bool Wrap bool NoCopy bool Chunker string Prefix *cid.Prefix // contains filtered or unexported fields }
Adder holds the switches passed to the `add` command.
func NewAdder ¶ added in v0.4.0
func NewAdder(ctx context.Context, p pin.Pinner, bs bstore.GCBlockstore, ds ipld.DAGService) (*Adder, error)
NewAdder Returns a new Adder used for a file add operation.
func (*Adder) Finalize ¶ added in v0.4.0
Finalize flushes the mfs root directory and returns the mfs root node.
func (*Adder) PinRoot ¶ added in v0.4.0
Recursively pins the root node of Adder and writes the pin state to the backing datastore.
func (*Adder) SetMfsRoot ¶ added in v0.4.3
SetMfsRoot sets `r` as the root for Adder.