Documentation
¶
Overview ¶
Package rootfs implements extensions to go's fs.FS to work around its limitations
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidPath = errors.New("invalid path") //nolint:revive
Functions ¶
This section is empty.
Types ¶
type FS ¶
type FS interface {
// Opens a File given its path. Path can be absolute or relative.
// If path is relative, it is joined to the root to get the effective path.
// The path must be within the FS's root directory
Open(path string) (fs.File, error)
// returns FS's root dir
Root() string
}
FS defines an interface that extends go's fs.FS with a mechanism for working with absolute paths
func NewFromDir ¶
NewFromDir create a rootFS from a root directory. The root must be an absolute path
Click to show internal directories.
Click to hide internal directories.