fileuri

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasWindowsDrivePrefix

func HasWindowsDrivePrefix(path string) bool

HasWindowsDrivePrefix reports whether path begins with a Windows drive designator such as C: independently of the host operating system.

func IsWindowsDriveHost

func IsWindowsDriveHost(host string) bool

IsWindowsDriveHost reports whether a file URI authority is a drive such as C:.

func IsWindowsDriveURIPath

func IsWindowsDriveURIPath(path string) bool

IsWindowsDriveURIPath reports whether path uses the /C:/ form produced by a hierarchical Windows file URI.

Types

type FileURI

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

FileURI is a parsed local file URI. It keeps the original URL form so path joining can preserve hierarchical and opaque file URI representations.

func Parse

func Parse(name string) (FileURI, error)

Parse parses hierarchical and opaque file URIs using the same lexical rules for every FileIO consumer.

func (FileURI) Host

func (f FileURI) Host() string

Host returns the URI authority without changing its spelling.

func (FileURI) JoinPath

func (f FileURI) JoinPath(elem ...string) string

JoinPath appends path elements while retaining the URI's hierarchical or opaque representation.

func (FileURI) LocalPath

func (f FileURI) LocalPath(windows bool) string

LocalPath returns the decoded local path. When windows is true, Windows drive authorities and /C:/ URI paths are converted to native drive-shaped paths.

func (FileURI) LocalPathForOS

func (f FileURI) LocalPathForOS() string

LocalPathForOS returns the decoded local path using the running host's file system semantics.

Jump to

Keyboard shortcuts

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