Documentation ¶
Overview ¶
package mdfs provides a file system that wraps a directory and an embed.FS. it prioritizes the directory FS and falls back to the embedded FS if the file cannot be found on disk. This is useful during development or when deploying with assets not embedded in the binary.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FS ¶
type FS struct {
// contains filtered or unexported fields
}
FS wraps a directory and an embed FS that are expected to have the same contents. it prioritizes the directory FS and falls back to the embedded FS if the file cannot be found on disk. This is useful during development or when deploying with assets not embedded in the binary.
func New ¶
NewFallbackFS returns a new FS that wraps the given directory and embedded FS. the embed.FS is expected to embed the same files as the directory FS.
func (FS) Open ¶
Open opens the named file.
When Open returns an error, it should be of type *PathError with the Op field set to "open", the Path field set to name, and the Err field describing the problem.
Open should reject attempts to open names that do not satisfy ValidPath(name), returning a *PathError with Err set to ErrInvalid or ErrNotExist.