Documentation ¶
Overview ¶
Package rebed brings simple embedded file functionality to Go's new embed directive.
It can recreate the directory structure from the embed.FS type with or without the files it contains. This is useful to expose the filesystem to the end user so they may see and modify the files.
It also provides basic directory walking functionality for the embed.FS type.
Index ¶
- Variables
- func Create(fsys embed.FS, outputPath string) error
- func Patch(fsys embed.FS, outputPath string) error
- func Touch(fsys embed.FS, outputPath string) error
- func Tree(fsys embed.FS, outputPath string) error
- func Walk(fsys embed.FS, startPath string, f func(path string, de fs.DirEntry) error) error
- func WalkDir(fsys embed.FS, startPath string, f func(path string, de fs.DirEntry) error) error
- func Write(fsys embed.FS, outputPath string) error
Constants ¶
This section is empty.
Variables ¶
var ErrExist error = os.ErrExist
ErrExist returned by Create when encountering a file conflict in filesystem creation
Functions ¶
func Create ¶
Create attempts to recreate filesystem. It first checks that there be no matching files present and returns an error if there is an existing file conflict in outputPath.
Folders are not considered to conflict.
func Touch ¶
Touch creates the target filesystem folder structure in the binary's current working directory with empty files. Does not modify already existing files.
func Walk ¶
Walk expects a relative path within fsys. f called on every file/directory found recursively.
f's first argument is the relative/absolute path to directory being scanned. "." as startPath will scan all files and folders.
Any error returned by f will cause Walk to return said error immediately.
Types ¶
This section is empty.