registry

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Find

func Find(abs path.Absolute) (fs.FS, error)

func Register

func Register(ph Handler)

Register registers the given PathFS for the Schema that it returns There can only be one PathFS for a given Schema. It there is already a PathFS for a given Schema, the new PathFS is used instead (last wins). Schema is compiled as a regular expression and if it does not compile, it panics

Types

type Handler

type Handler interface {

	// the Schema that can be handled by the PathFS
	// it will be converted to a regular expression to match against the head of an absolute path
	Schema() string

	// GetFS receives an absolute path and returns a filesystem FS
	// that can handle the path or an error, if it could not handle it
	// for valid absolute paths with a head that starts with Schema()
	// GetFS should always return a working FS
	GetFS(abs path.Absolute) (fs.FS, error)
}

Jump to

Keyboard shortcuts

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