uriresolve

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package uriresolve resolves the local-path forms shared by the file:// and sqlite:// URI schemes.

Both schemes accept the same shapes:

  • <scheme>:///abs/path canonical absolute path
  • <scheme>://~/relative tilde via host="~"
  • <scheme>://./relative cwd-relative via host="."

Sharing the resolver keeps the two schemes in lockstep — a new accepted form (or a fix to an existing one) lands in one place and applies to both.

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyPath = errors.New("uriresolve: empty path")

ErrEmptyPath is returned when the URI has no path component after host resolution. Callers wrap with scheme context.

View Source
var ErrUnsupportedHost = errors.New("uriresolve: unsupported host")

ErrUnsupportedHost is returned when the URI's host slot is not one of "", "~", or "." — these are the only forms the local resolver accepts. Callers wrap this with their scheme name for a friendly error message.

Functions

func ResolveLocalPath

func ResolveLocalPath(u *url.URL) (string, error)

ResolveLocalPath turns a parsed URI into an absolute filesystem path according to the shared host conventions. Returns the resolved absolute path or one of the sentinel errors above (suitable for errors.Is checks).

The returned path is always absolute — callers do not need to run filepath.Abs themselves.

Types

This section is empty.

Jump to

Keyboard shortcuts

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