Documentation ¶
Overview ¶
Package path contains utilities to work with ipfs paths.
Index ¶
- func Join(pths []string) stringdeprecated
- func SplitAbsPath(fpath Path) (cid.Cid, []string, error)deprecated
- func SplitList(pth string) []stringdeprecated
- type ErrInvalidPathdeprecated
- type Pathdeprecated
- func FromCid(c cid.Cid) Pathdeprecated
- func FromSegments(prefix string, seg ...string) (Path, error)deprecated
- func FromString(s string) Pathdeprecated
- func ParseCidToPath(txt string) (Path, error)deprecated
- func ParsePath(txt string) (Path, error)deprecated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrInvalidPath
deprecated
added in
v0.3.1
type ErrInvalidPath struct {
// contains filtered or unexported fields
}
Deprecated: use github.com/ipfs/boxo/path.ErrInvalidPath
func (ErrInvalidPath) Error ¶ added in v0.3.1
func (e ErrInvalidPath) Error() string
func (ErrInvalidPath) Is ¶ added in v0.3.1
func (e ErrInvalidPath) Is(err error) bool
func (ErrInvalidPath) Unwrap ¶ added in v0.3.1
func (e ErrInvalidPath) Unwrap() error
type Path
deprecated
type Path string
A Path represents an ipfs content path:
- <cid>/path/to/file
- /ipfs/<cid>
- /ipns/<cid>/path/to/folder
- etc
Deprecated: use github.com/ipfs/boxo/path.Path
func FromSegments
deprecated
func FromString
deprecated
func ParseCidToPath
deprecated
func ParsePath
deprecated
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.
Deprecated: use github.com/ipfs/boxo/path.ParsePath
func (Path) IsJustAKey ¶
IsJustAKey returns true if the path is of the form <key> or /ipfs/<key>, or /ipld/<key>
func (Path) PopLastSegment ¶
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.