pathscope

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resolver

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

Resolver checks paths against allow/deny lists.

func NewResolver

func NewResolver(allowDirs []string, denyPatterns []string) (*Resolver, error)

NewResolver creates a Resolver. allowDirs are canonicalized at construction time. If allowDirs is empty, all paths are allowed (canonicalization only). denyPatterns support doublestar glob syntax.

func (*Resolver) AllowDirs

func (r *Resolver) AllowDirs() []string

AllowDirs returns the canonicalized allow directory list.

func (*Resolver) DenyPatterns

func (r *Resolver) DenyPatterns() []string

DenyPatterns returns the deny pattern list.

func (*Resolver) Resolve

func (r *Resolver) Resolve(baseCwd string, path string) (string, error)

Resolve canonicalizes a path and checks it against allow/deny lists. baseCwd is the session's current working directory, used to resolve relative paths.

Jump to

Keyboard shortcuts

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