ipfsadd

package
v0.0.0-...-6646f2c Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2019 License: MIT Imports: 18 Imported by: 1

Documentation

Overview

Package ipfsadd is a simplified copy of go-ipfs/core/coreunix/add.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adder

type Adder struct {
	Out       chan *api.AddedOutput
	Progress  bool
	Hidden    bool
	Trickle   bool
	RawLeaves bool
	Silent    bool
	Wrap      bool
	NoCopy    bool
	Chunker   string

	Prefix     *cid.Prefix
	CidBuilder cid.Builder
	// contains filtered or unexported fields
}

Adder holds the switches passed to the `add` command.

func NewAdder

func NewAdder(ctx context.Context, ds ipld.DAGService) (*Adder, error)

NewAdder Returns a new Adder used for a file add operation.

func (*Adder) AddFile

func (adder *Adder) AddFile(path string, file files.Node) error

AddFile adds the given file while respecting the adder.

func (*Adder) Finalize

func (adder *Adder) Finalize() (ipld.Node, error)

Finalize flushes the mfs root directory and returns the mfs root node.

func (*Adder) RootNode

func (adder *Adder) RootNode() (ipld.Node, error)

RootNode returns the root node of the Added.

func (*Adder) SetMfsRoot

func (adder *Adder) SetMfsRoot(r *mfs.Root)

SetMfsRoot sets `r` as the root for Adder.

Jump to

Keyboard shortcuts

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