embedfs

package
v6.0.0-beta.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2026 License: Apache-2.0 Imports: 9 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

embedfs exposes an embed.FS as a read-only billy.Filesystem.

Index

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) Create

func (fs *Embed) Create(_ string) (billy.File, error)

Create is not supported.

Calls will always return billy.ErrReadOnly.

func (*Embed) Join

func (fs *Embed) Join(elem ...string) string

Join return a path with all elements joined by forward slashes.

This behaviour is OS-agnostic.

func (*Embed) Lstat

func (fs *Embed) Lstat(_ string) (os.FileInfo, error)

Lstat is not supported.

Calls will always return billy.ErrNotSupported.

func (*Embed) MkdirAll

func (fs *Embed) MkdirAll(_ string, _ os.FileMode) error

MkdirAll is not supported.

Calls will always return billy.ErrReadOnly.

func (*Embed) Open

func (fs *Embed) Open(filename string) (billy.File, error)

func (*Embed) OpenFile

func (fs *Embed) OpenFile(filename string, flag int, _ os.FileMode) (billy.File, error)

func (*Embed) ReadDir

func (fs *Embed) ReadDir(path string) ([]iofs.DirEntry, error)
func (fs *Embed) Readlink(_ string) (string, error)

Readlink is not supported.

Calls will always return billy.ErrNotSupported.

func (*Embed) Remove

func (fs *Embed) Remove(_ string) error

Remove is not supported.

Calls will always return billy.ErrReadOnly.

func (*Embed) Rename

func (fs *Embed) Rename(_, _ string) error

Rename is not supported.

Calls will always return billy.ErrReadOnly.

func (*Embed) Root

func (fs *Embed) Root() string

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.

func (*Embed) Stat

func (fs *Embed) Stat(filename string) (os.FileInfo, error)
func (fs *Embed) Symlink(_, _ string) error

Symlink is not supported.

Calls will always return billy.ErrReadOnly.

func (*Embed) TempFile

func (fs *Embed) TempFile(_, _ string) (billy.File, error)

TempFile is not supported.

Calls will always return billy.ErrNotSupported.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL