ipfsadd

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: Apache-2.0, MIT, Apache-2.0, + 1 more Imports: 20 Imported by: 0

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
	Trickle   bool
	RawLeaves bool
	Silent    bool
	NoCopy    bool
	Chunker   string

	CidBuilder cid.Builder

	// Cluster: ipfs does a hack in commands/add.go to set the filenames
	// in emitted events correctly. We carry a root folder name (or a
	// filename in the case of single files here and emit those events
	// correctly from the beginning).
	OutputPrefix string
	// contains filtered or unexported fields
}

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

func NewAdder

func NewAdder(ctx context.Context, ds ipld.DAGService, allocs func() []peer.ID) (*Adder, error)

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

func (*Adder) AddAllAndPin added in v0.12.0

func (adder *Adder) AddAllAndPin(file files.Node) (ipld.Node, error)

AddAllAndPin adds the given request's files and pin them. Cluster: we don'pin. Former AddFiles.

func (*Adder) PinRoot added in v0.12.0

func (adder *Adder) PinRoot(root ipld.Node) error

PinRoot recursively pins the root node of Adder and writes the pin state to the backing datastore. Cluster: we don't pin. Former Finalize().

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