coreunix

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2017 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(n *core.IpfsNode, r io.Reader) (string, error)

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 AddMetadataTo(n *core.IpfsNode, skey string, m *ft.Metadata) (string, error)

func AddR

func AddR(n *core.IpfsNode, root string) (key string, err error)

AddR recursively adds files in |path|.

func AddWithContext added in v0.4.5

func AddWithContext(ctx context.Context, n *core.IpfsNode, r io.Reader) (string, error)

AddWithContext does the same as Add, but with a custom context.

func AddWrapped

func AddWrapped(n *core.IpfsNode, r io.Reader, filename string) (string, node.Node, error)

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 Cat

func Cat(ctx context.Context, n *core.IpfsNode, pstr string) (uio.DagReader, error)

func Metadata

func Metadata(n *core.IpfsNode, skey string) (*ft.Metadata, error)

func NewMemoryDagService added in v0.4.0

func NewMemoryDagService() dag.DAGService

Types

type AddedObject added in v0.4.0

type AddedObject struct {
	Name  string
	Hash  string `json:",omitempty"`
	Bytes int64  `json:",omitempty"`
}

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
	Chunker   string
	// 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 dag.DAGService) (*Adder, error)

func (*Adder) AddFile added in v0.4.0

func (adder *Adder) AddFile(file files.File) error

AddFile adds the given file while respecting the adder.

func (*Adder) Finalize added in v0.4.0

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

func (*Adder) PinRoot added in v0.4.0

func (adder *Adder) PinRoot() error

func (*Adder) RootNode added in v0.4.0

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

func (*Adder) SetMfsRoot added in v0.4.3

func (adder *Adder) SetMfsRoot(r *mfs.Root)
type Link struct {
	Name, Hash string
	Size       uint64
}

type Object added in v0.4.0

type Object struct {
	Hash  string
	Links []Link
}

Jump to

Keyboard shortcuts

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