path

package
v0.0.0-...-7ae29b8 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

This package provides a simple way to represent a path value and perform common operations on it. All the functions expected with `path/filepath` are provided. The reason for using this over a simple string is that it allows Vagrant to modify the format of the path on demand. For example, if we wanted to reference all paths on Windows via UNC, or short names, or msys2, we simply have to enable it here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Match

func Match(pattern string, p Path) (bool, error)

Types

type Path

type Path interface {
	Abs() (Path, error)
	String() string
	Base() Path
	Clean() Path
	Dir() Path
	EvalSymLinks() (Path, error)
	Exists() bool
	Ext() string
	FromSlash() Path
	HasPrefix(string) bool
	IsAbs() bool
	IsRoot() (bool, error)
	Join(...string) Path
	Parent() Path
	SameFile(Path) (bool, error)
	Split() (Path, string)
	SplitList() []string
	ToSlash() string
	VolumeName() string
	Walk(filepath.WalkFunc) error
}

func Glob

func Glob(pattern string) (matches []Path, err error)

func NewPath

func NewPath(p string) Path

func Rel

func Rel(basepath, targetpath Path) (relP Path, err error)

Jump to

Keyboard shortcuts

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