Documentation
¶
Index ¶
- func GenerateEmbedBindata(fsRootPath, outputFile string) error
- func NewEmbeddedFS(data []byte) fs.ReadDirFS
- type EmbeddedCompressedFile
- type EmbeddedFile
- type EmbeddedFileBase
- type EmbeddedFileInfo
- type EmbeddedMeta
- type EmbeddedOriginFile
- type Layer
- type LayeredFS
- func (l *LayeredFS) GetFileLayerName(elems ...string) string
- func (l *LayeredFS) ListAllFiles(name string, fileMode ...bool) ([]string, error)
- func (l *LayeredFS) ListFiles(name string, fileMode ...bool) ([]string, error)
- func (l *LayeredFS) Open(name string) (http.File, error)
- func (l *LayeredFS) ReadFile(elems ...string) ([]byte, error)
- func (l *LayeredFS) ReadLayeredFile(elems ...string) ([]byte, string, error)
- func (l *LayeredFS) WatchLocalChanges(ctx context.Context, callback func())
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EmbeddedCompressedFile ¶
type EmbeddedCompressedFile struct {
EmbeddedFileBase
// contains filtered or unexported fields
}
func (*EmbeddedCompressedFile) Close ¶
func (f *EmbeddedCompressedFile) Close() error
func (*EmbeddedCompressedFile) Read ¶
func (f *EmbeddedCompressedFile) Read(p []byte) (n int, err error)
type EmbeddedFile ¶
type EmbeddedFile interface {
io.ReadSeeker
fs.ReadDirFile
ReadDir(n int) ([]fs.DirEntry, error)
}
type EmbeddedFileBase ¶
type EmbeddedFileBase struct {
// contains filtered or unexported fields
}
func (*EmbeddedFileBase) Seek ¶
func (f *EmbeddedFileBase) Seek(offset int64, whence int) (int64, error)
func (*EmbeddedFileBase) Stat ¶
func (f *EmbeddedFileBase) Stat() (fs.FileInfo, error)
type EmbeddedFileInfo ¶
type EmbeddedMeta ¶
type EmbeddedMeta struct {
Root *embeddedFileInfo
}
type EmbeddedOriginFile ¶
type EmbeddedOriginFile struct {
EmbeddedFileBase
}
func (*EmbeddedOriginFile) Close ¶
func (f *EmbeddedOriginFile) Close() error
func (*EmbeddedOriginFile) Read ¶
func (f *EmbeddedOriginFile) Read(p []byte) (n int, err error)
type Layer ¶
type Layer struct {
// contains filtered or unexported fields
}
Layer represents a layer in a layered asset file-system. It has a name and works like http.FileSystem
func Bindata ¶
Bindata returns a new Layer with the given name, it serves files from the given bindata asset.
func Local ¶
Local returns a new Layer with the given name, it serves files from the given local path.
type LayeredFS ¶
type LayeredFS struct {
// contains filtered or unexported fields
}
LayeredFS is a layered asset file-system. It works like http.FileSystem, but it can have multiple layers. The first layer is the top layer, and it will be used first. If the file is not found in the top layer, it will be searched in the next layer.
func Layered ¶
Layered returns a new LayeredFS with the given layers. The first layer is the top layer.
func (*LayeredFS) GetFileLayerName ¶
GetFileLayerName returns the name of the first-seen layer that contains the given file.
func (*LayeredFS) ListAllFiles ¶
ListAllFiles returns files/directories in the given directory, including subdirectories, recursively. The fileMode controls the returned files: * omitted: all files and directories will be returned. * true: only files will be returned. * false: only directories will be returned. The returned files are sorted by name.
func (*LayeredFS) ListFiles ¶
ListFiles lists files/directories in the given directory. The fileMode controls the returned files. * omitted: all files and directories will be returned. * true: only files will be returned. * false: only directories will be returned. The returned files are sorted by name.
func (*LayeredFS) Open ¶
Open opens the named file. The caller is responsible for closing the file.
func (*LayeredFS) ReadFile ¶
ReadFile reads the named file.
func (*LayeredFS) ReadLayeredFile ¶
ReadLayeredFile reads the named file, and returns the layer name.
Source Files
¶
- embed.go
- layered.go