Documentation
¶
Overview ¶
Package zfs provides some extensions to the fs package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmbedOrDir ¶
EmbedOrDir returns e if dev is false, or a os.DirFS at the module root.
This is intended to serve files from the local FS when developing and requires to be run in the source code directory.
In both cases it will try to fs.Sub() to dir, but it's a non-fatal error if this directory doesn't exist.
func MustReadFile ¶
MustReadFile is like fs.ReadFile, but will panic() on errors.
func SubIfExists ¶
SubIfExists will fs.Sub() to a directory only if it exists.
This will continue with the next directory if it doesn't exist. For example with "db/query", it will try to Sub to "db" first, and will continue to Sub to "query" regardless of whether the Sub to "db" succeeded or not, so "db/query" and "query" will end up beiing Sub()'d.
Types ¶
type OverlayFS ¶
type OverlayFS struct {
// contains filtered or unexported fields
}
func NewOverlayFS ¶
OverlayFS returns a filesystem which reads from overlay, falling back to base if that fails.
func (OverlayFS) InBase ¶
InBase reports if this filename exists in the base part. It may or may not exist in the overlay part.
func (OverlayFS) InOverlay ¶
InOverlay reports if this filename exists in the overlay part. It may or may not exist in the base part.