Documentation ¶
Index ¶
- Constants
- func AddMetadataTo(n *core.IpfsNode, skey string, m *ft.Metadata) (string, error)
- func GetDataForUserAndMeta(ctx context.Context, nd ipld.Node, ds ipld.DAGService) ([]byte, []byte, error)
- func GetMetaData(ctx context.Context, api coreiface.CoreAPI, path ipath.Path) ([]byte, error)
- func MetaDataMap(ctx context.Context, api coreiface.CoreAPI, path ipath.Path) (map[string]interface{}, error)
- func MetaNodeFsData(ctx context.Context, api coreiface.CoreAPI, path ipath.Path) ([]byte, error)
- func Metadata(n *core.IpfsNode, skey string) (*ft.Metadata, error)
- type Adder
- type Link
- type MetaModifier
- type ReedSolomonAdder
Constants ¶
const ( SerialFile = iota + 1 MultipartFile SliceFile )
Variables ¶
This section is empty.
Functions ¶
func AddMetadataTo ¶
func GetDataForUserAndMeta ¶
func GetDataForUserAndMeta(ctx context.Context, nd ipld.Node, ds ipld.DAGService) ([]byte, []byte, error)
GetDataForUserAndMeta returns raw dag node user data, metadata in byte array, and error. Note that this function assumes, if token metadata exists inside the DAG topped by the given 'node', the 'node' has metadata root as first child, user data root as second child.
func GetMetaData ¶
Returns the full metadata DAG data bytes for the DAG of the given file path.
func MetaDataMap ¶
func MetaDataMap(ctx context.Context, api coreiface.CoreAPI, path ipath.Path) (map[string]interface{}, error)
MetaDataMap takes a root node path and returns an unmarshalled metadata map in bytes
func MetaNodeFsData ¶
MetaData takes a root node path and returns the metadata in bytes
Types ¶
type Adder ¶
type Adder struct { Out chan<- interface{} Progress bool Pin bool Trickle bool RawLeaves bool Silent bool NoCopy bool MetaForDirectory bool MetaDagToAdd bool MetadataDag ipld.Node Chunker string CidBuilder cid.Builder TokenMetadata string PinDuration int64 // 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.GCLocker, 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 ¶
func (adder *Adder) SetMfsRoot(r *mfs.Root)
SetMfsRoot sets `r` as the root for Adder.
type MetaModifier ¶
MetaModifier contains the options to the `metadata` command.
func NewMetaModifier ¶
func NewMetaModifier(ctx context.Context, p pin.Pinner, bs bstore.GCLocker, ds ipld.DAGService) (*MetaModifier, error)
func (*MetaModifier) AddMetaAndPin ¶
Add metadata to the given DAG root node for a BTFS file.
func (*MetaModifier) RemoveMetaAndPin ¶
RemoveMetaAndPin removes the metadata entries from the DAG of the given `node` root node of a BTFS file.
type ReedSolomonAdder ¶
type ReedSolomonAdder struct { Adder FileType int InfileReaders []io.Reader IsDir bool CurrentOffset uint64 }
func NewReedSolomonAdder ¶
func NewReedSolomonAdder(adder *Adder) (*ReedSolomonAdder, error)
NewReedSolomonAdder returns a new ReedSolomonAdder used for a file/directory add operation.
func (*ReedSolomonAdder) AddAllAndPin ¶
func (rsadder *ReedSolomonAdder) AddAllAndPin(ctx context.Context, file files.Node) (ipld.Node, error)
AddAllAndPin adds the given request's files and pin them.