Documentation ¶
Index ¶
- func Add(ctx context.Context, ds ipld.DAGService, path string, filter ignore.Filter) (ipld.Node, error)
- func Cat(ctx context.Context, dag ipld.DAGService, id cid.Cid) (string, error)
- func Write(ctx context.Context, dag ipld.DAGService, path string, node ipld.Node) error
- type ByTypeAndName
- type DirEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Add ¶
func Add(ctx context.Context, ds ipld.DAGService, path string, filter ignore.Filter) (ipld.Node, error)
Add creates a node from the file at path and adds it to the merkle dag.
Types ¶
type ByTypeAndName ¶
type ByTypeAndName []*DirEntry
ByTypeAndName is used to sort dir entries.
func (ByTypeAndName) Less ¶
func (a ByTypeAndName) Less(i, j int) bool
Less returns true if entry at index i is less than entry at index j.
func (ByTypeAndName) Swap ¶
func (a ByTypeAndName) Swap(i, j int)
Swap swaps the indices of two entries.
type DirEntry ¶
type DirEntry struct { // Cid is the id of the entry. Cid cid.Cid `json:"cid"` // Name is the name of the file. Name string `json:"name"` // IsDir indicates if the file is a directory. IsDir bool `json:"is_dir"` // Size is the size in bytes of the file. Size uint64 `json:"size"` }
DirEntry contains info about a file.
Click to show internal directories.
Click to hide internal directories.