uri

package
v0.33.2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromPath

func FromPath(rawPath string) string

FromPath creates a URI from OS-specific path per RFC 8089 "file" URI Scheme

func IsURIValid added in v0.17.0

func IsURIValid(uri string) bool

IsURIValid checks whether uri is a valid URI per RFC 8089

func IsWSLURI added in v0.29.2

func IsWSLURI(uri string) bool

IsWSLURI checks whether URI represents a WSL (Windows Subsystem for Linux) UNC path on Windows, such as \\wsl$\Ubuntu\path.

Such a URI represents a common user error since the LS is generally expected to run in the same environment where files are located (i.e. within the Linux subsystem with Linux paths such as /Ubuntu/path).

func MustParseURI added in v0.26.0

func MustParseURI(rawUri string) string

MustParseURI returns a normalized RFC 8089 URI. It will panic if rawUri is invalid.

Use IsURIValid for checking validity upfront.

func MustPathFromURI added in v0.17.0

func MustPathFromURI(uri string) string

func PathFromURI added in v0.17.0

func PathFromURI(rawUri string) (string, error)

PathFromURI extracts OS-specific path from an RFC 8089 "file" URI Scheme

Types

This section is empty.

Jump to

Keyboard shortcuts

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