Documentation ¶
Overview ¶
Package coreunix is a fork of github.com/ipfs/go-ipfs/core/coreunix
gx paths used: "gx/ipfs/QmUJYo4etAQqFfSS2rarFAE97eNGB8ej64YkRT2SmsYD4r/go-ipfs/pin" ipld "gx/ipfs/QmR7TcHkR9nxkUorfi8XMTAMLUK7GiP64TWWBzY3aacc1o/go-ipld-format" dag "gx/ipfs/QmSei8kFMfqdJq7Q68d2LMnHbTWKKg2daA29ezUYFAUNgc/go-merkledag" posinfo "gx/ipfs/QmQyUyYcpKG1u53V7N25qRTGw5XwaAxTMKXbduqHotQztg/go-ipfs-posinfo" core "gx/ipfs/QmUJYo4etAQqFfSS2rarFAE97eNGB8ej64YkRT2SmsYD4r/go-ipfs/core" unixfs "gx/ipfs/QmfB3oNXGGq9S4B2a9YeCajoATms3Zw2VvDm8fK7VeLSV8/go-unixfs" balanced "gx/ipfs/QmfB3oNXGGq9S4B2a9YeCajoATms3Zw2VvDm8fK7VeLSV8/go-unixfs/importer/balanced" ihelper "gx/ipfs/QmfB3oNXGGq9S4B2a9YeCajoATms3Zw2VvDm8fK7VeLSV8/go-unixfs/importer/helpers" trickle "gx/ipfs/QmfB3oNXGGq9S4B2a9YeCajoATms3Zw2VvDm8fK7VeLSV8/go-unixfs/importer/trickle" coreiface "gx/ipfs/QmUJYo4etAQqFfSS2rarFAE97eNGB8ej64YkRT2SmsYD4r/go-ipfs/core/coreapi/interface" posinfo "gx/ipfs/QmQyUyYcpKG1u53V7N25qRTGw5XwaAxTMKXbduqHotQztg/go-ipfs-posinfo" cid "gx/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7/go-cid" mfs "gx/ipfs/QmUwXQs8aZ472DmXZ8uJNf7HJNKoMJQVa7RaCz7ujZ3ua9/go-mfs" chunker "gx/ipfs/QmTUTG9Jg9ZRA1EzTPGTDvnwfcfKhDMnqANnP9fe4rSjMR/go-ipfs-chunker" logging "gx/ipfs/QmZChCsSt8DctjceaL56Eibc29CVQq4dGKRXC5JRZ6Ppae/go-log" bstore "gx/ipfs/QmcDDgAXDbpDUpadCJKLr49KYR4HuL7T8Z1dZTHt6ixsoR/go-ipfs-blockstore" files "gx/ipfs/QmZMWMvWMVKCbHetJ4RgndbuEF1io2UpUxwQwtNjtYPzSC/go-ipfs-files"
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 Metadata(n *core.IpfsNode, skey string) (*ft.Metadata, error)
- type AddEvent
- 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 ¶
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.
Types ¶
type AddEvent ¶
type AddEvent struct { Name string Hash string `json:",omitempty"` Bytes int64 `json:",omitempty"` Size string `json:",omitempty"` }
AddEvent is emitted when a unixfs file is completed & has an addressable hash
type Adder ¶
type Adder struct { Out chan<- interface{} Progress bool Hidden bool Pin bool Trickle bool RawLeaves bool Silent bool Wrap bool Name string NoCopy bool Chunker string CidBuilder cid.Builder // contains filtered or unexported fields }
Adder holds the switches passed to the `add` command.
func NewAdder ¶
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) AddAllAndPin ¶
AddAllAndPin adds the given request's files and pin them.
func (*Adder) PinRoot ¶
Recursively pins the root node of Adder and writes the pin state to the backing datastore.
func (*Adder) SetMfsRoot ¶
SetMfsRoot sets `r` as the root for Adder.