Documentation ¶
Index ¶
- 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 ¶
This section is empty.
Types ¶
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 ¶
func Bindata(name string, fs http.FileSystem) *Layer
Bindata returns a new Layer with the given name, it serves files from the given bindata asset.
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) ReadLayeredFile ¶
ReadLayeredFile reads the named file, and returns the layer name.
func (*LayeredFS) WatchLocalChanges ¶
WatchLocalChanges watches local changes in the file-system. It's used to help to reload assets when the local file-system changes.