paths

package
v0.36.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RootDir = `/`
)

Variables

This section is empty.

Functions

func CanonicalTarPath added in v0.28.0

func CanonicalTarPath(p string) string

CanonicalTarPath return a cleaned path (see path.Clean) with leading slashes removed

func FilePathToURI

func FilePathToURI(path, relativeTo string) (string, error)

FilePathToURI converts a filepath to URI. If relativeTo is provided not empty and path is a relative path it will be made absolute based on the provided value. Otherwise, the current working directory is used.

func FilterReservedNames added in v0.13.0

func FilterReservedNames(p string) string

func IsDir

func IsDir(p string) (bool, error)

func IsURI

func IsURI(ref string) bool

func URIToFilePath

func URIToFilePath(uri string) (string, error)

examples:

- unix file: file://laptop/some%20dir/file.tgz

- windows drive: file:///C:/Documents%20and%20Settings/file.tgz

- windows share: file://laptop/My%20Documents/file.tgz

func WindowsBasename added in v0.14.0

func WindowsBasename(p string) string

WindowsBasename is equivalent to path.Basename or filepath.Basename but always for Windows paths reproduced because Windows implementation is not exported

func WindowsDir added in v0.14.0

func WindowsDir(p string) string

WindowsDir is equivalent to path.Dir or filepath.Dir but always for Windows paths reproduced because Windows implementation is not exported

func WindowsPathSID added in v0.14.0

func WindowsPathSID(uid, gid int) string

WindowsPathSID returns the appropriate SID for a given UID and GID This is the basic logic for path permissions in Pack and Lifecycle

func WindowsToSlash added in v0.14.0

func WindowsToSlash(p string) string

WindowsToSlash is equivalent to path.ToSlash or filepath.ToSlash but always for Windows paths reproduced because Windows implementation is not exported

Types

This section is empty.

Jump to

Keyboard shortcuts

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