Package path contains utilities to work with ipfs paths.
Join joins strings slices using /
SplitAbsPath clean up and split fpath. It extracts the first component (which must be a Multihash) and return it separately.
SplitList splits strings usings /
A Path represents an ipfs content path:
* /<cid>/path/to/file * /ipfs/<cid> * /ipns/<cid>/path/to/folder * etc
FromCid safely converts a cid.Cid type to a Path type.
FromSegments returns a path given its different segments.
FromString safely converts a string type to a Path type.
ParseCidToPath takes a CID in string form and returns a valid ipfs Path.
ParsePath returns a well-formed ipfs Path. The returned path will always be prefixed with /ipfs/ or /ipns/. The prefix will be added if not present in the given string. This function will return an error when the given string is not a valid ipfs path.
IsJustAKey returns true if the path is of the form <key> or /ipfs/<key>, or /ipld/<key>
IsValid checks if a path is a valid ipfs Path.
PopLastSegment returns a new Path without its final segment, and the final segment, separately. If there is no more to pop (the path is just a key), the original path is returned.
Segments returns the different elements of a path (elements are delimited by a /).
String converts a path to string.
|resolver||Package resolver implements utilities for resolving paths within ipfs.|