pathglob

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package pathglob matches URL paths against scope globs.

filepath.Match is a file-name matcher: its "*" stops at "/", so the sample config's `/api/*` never excluded `/api/users/1`, and it was handed paths that still carried the query string, so an exclude of `/logout` missed `/logout?next=/`. Scope rules mean URL paths: "*" crosses "/", "**" is a synonym kept for operators who write it, and the query/fragment is never part of the subject.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Match

func Match(pattern, path string) bool

Match reports whether path matches pattern. "*" (and "**") match any run of characters including "/", "?" matches one character, "[...]" is a character class ("[!...]" negated). Matching is exact (anchored) and case-sensitive; callers lowercase both sides when they want case-insensitivity. An invalid pattern matches nothing.

func ScopePath

func ScopePath(p string) string

ScopePath returns p without its query string or fragment.

Types

This section is empty.

Jump to

Keyboard shortcuts

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