filesystemscope

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPathOutsideScope = errors.New("path outside filesystem scope")
	ErrReadDenied       = errors.New("read permission denied")
	ErrWriteDenied      = errors.New("write permission denied")
	ErrPathNotDirectory = errors.New("path is not a directory")
)

Functions

This section is empty.

Types

type PathContext

type PathContext struct {
	HomePathAbs   string
	DefaultRootID string
	Roots         []Root
}

type PermissionSet

type PermissionSet struct {
	Read  bool
	Write bool
}

type Registry

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

func NewDefaultRegistry

func NewDefaultRegistry(homeDir string) (*Registry, error)

func NewRegistry

func NewRegistry(cfg *config.Config) (*Registry, error)

func (*Registry) Contains

func (r *Registry) Contains(path string) (ResolvedPath, bool)

func (*Registry) DefaultRootPath

func (r *Registry) DefaultRootPath() string

func (*Registry) HomePathAbs

func (r *Registry) HomePathAbs() string

func (*Registry) NormalizeInput

func (r *Registry) NormalizeInput(path string) (string, error)

func (*Registry) PathContext

func (r *Registry) PathContext() PathContext

func (*Registry) Resolve

func (r *Registry) Resolve(path string, opts ResolveOptions) (ResolvedPath, error)

func (*Registry) ResolveTarget

func (r *Registry) ResolveTarget(path string, opts ResolveOptions) (ResolvedPath, error)

func (*Registry) UpdateFromConfig

func (r *Registry) UpdateFromConfig(cfg *config.Config) error

type ResolveOptions

type ResolveOptions struct {
	RequireExisting bool
	RequireDir      bool
	ForWrite        bool
}

type ResolvedPath

type ResolvedPath struct {
	RootID      string
	RootLabel   string
	InputPath   string
	LogicalAbs  string
	RealAbs     string
	Relative    string
	Permissions PermissionSet
}

type Root

type Root struct {
	ID          string
	Label       string
	PathAbs     string
	PathReal    string
	Kind        RootKind
	Permissions PermissionSet
	Hidden      bool
	System      bool
}

type RootKind

type RootKind string
const (
	RootKindHome     RootKind = "home"
	RootKindComputer RootKind = "computer"
	RootKindCustom   RootKind = "custom"
)

Jump to

Keyboard shortcuts

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