Documentation
¶
Overview ¶
embedfs exposes an embed.FS as a read-only billy.Filesystem.
Index ¶
- func New(efs *embed.FS) billy.Filesystem
- type Embed
- func (fs *Embed) Capabilities() billy.Capability
- func (fs *Embed) Chroot(_ string) (billy.Filesystem, error)
- func (fs *Embed) Create(_ string) (billy.File, error)
- func (fs *Embed) Join(elem ...string) string
- func (fs *Embed) Lstat(_ string) (os.FileInfo, error)
- func (fs *Embed) MkdirAll(_ string, _ os.FileMode) error
- func (fs *Embed) Open(filename string) (billy.File, error)
- func (fs *Embed) OpenFile(filename string, flag int, _ os.FileMode) (billy.File, error)
- func (fs *Embed) ReadDir(path string) ([]iofs.DirEntry, error)
- func (fs *Embed) Readlink(_ string) (string, error)
- func (fs *Embed) Remove(_ string) error
- func (fs *Embed) Rename(_, _ string) error
- func (fs *Embed) Root() string
- func (fs *Embed) Stat(filename string) (os.FileInfo, error)
- func (fs *Embed) Symlink(_, _ string) error
- func (fs *Embed) TempFile(_, _ string) (billy.File, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(efs *embed.FS) billy.Filesystem
New returns a read-only billy.Filesystem backed by efs. A nil efs is treated as an empty embed.FS.
Types ¶
type Embed ¶
type Embed struct {
// contains filtered or unexported fields
}
Embed is a read-only billy.Filesystem backed by an embed.FS. Write operations return billy.ErrReadOnly; symlink, chroot, lstat and tempfile operations return billy.ErrNotSupported.
func (*Embed) Capabilities ¶
func (fs *Embed) Capabilities() billy.Capability
func (*Embed) Chroot ¶
func (fs *Embed) Chroot(_ string) (billy.Filesystem, error)
Chroot is not supported.
Calls will always return billy.ErrNotSupported.
func (*Embed) Join ¶
Join return a path with all elements joined by forward slashes.
This behaviour is OS-agnostic.
func (*Embed) Root ¶
Root returns the empty string. Embed has no notion of a base directory: paths are passed straight through to the wrapped embed.FS, which uses forward-slash paths rooted at the embedding package.