path

package
v0.22.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Path

type Path struct {
	// contains filtered or unexported fields
}

func ExtractLongestCommonPath

func ExtractLongestCommonPath(paths ...Path) Path

ExtractLongestCommonPath returns the longest common path of two paths.

func MakeEmpty

func MakeEmpty() Path

MakeEmpty creates an empty path.

func MustParse

func MustParse(path string) Path

MustParse parses a path string into a Path. It panics if the path is invalid.

func Parse

func Parse(path string) (Path, error)

Parse parses a path string into a Path.

func (Path) Base

func (f Path) Base() string

Base returns the base of the path.

func (Path) Dir

func (f Path) Dir() (Path, error)

Dir returns the directory of the path.

func (Path) Equal

func (f Path) Equal(other Path) bool

Equal checks if two paths are equal.

func (Path) HasPrefix

func (f Path) HasPrefix(prefix Path) bool

HasPrefix checks if the path has the prefix.

func (Path) HasSuffix

func (f Path) HasSuffix(suffix Path) bool

HasSuffix checks if the path has the suffix.

func (Path) IsAncestorOf

func (f Path) IsAncestorOf(path Path) bool

IsAncestorOf returns true if the path is an ancestor of the other path.

func (Path) IsEmpty

func (f Path) IsEmpty() bool

IsEmpty returns true if the path is empty.

func (Path) Join

func (f Path) Join(other Path) Path

Join joins two paths.

func (Path) LocalString

func (f Path) LocalString() string

LocalString returns the local string representation of a Path.

func (Path) String

func (f Path) String() string

String returns the string representation of a Path.

func (Path) TrimPrefix

func (f Path) TrimPrefix(prefix Path) Path

TrimPrefix trims the prefix from the path.

func (Path) TrimSuffix

func (f Path) TrimSuffix(suffix Path) Path

TrimSuffix trims the suffix from the path.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL