Documentation ¶
Overview ¶
Package asset provides access to assets that have been stored into the binary executable which has been turned into a self-extracting zip archive.
If the current directory contains a sub directory `assets', files present there will override corresponding files in the zip archive.
Index ¶
- Variables
- func BindBefore(dir string)
- func BindExeDir()
- func BindExeSubDir(name string)
- func FileString(name string) (content string, err error)
- func Open(name string) (io.ReadSeekCloser, error)
- func ParseHTMLTemplateFiles(t *template.Template, filenames ...string) (*template.Template, error)
- func ParseTemplateFiles(t *template.Template, filenames ...string) (*template.Template, error)
- func ReadDir(path string) (fi []fs.DirEntry, err error)
- func SetDefaultFS(fsys fs.FS, root, source string) error
- func Stat(path string) (fi os.FileInfo, err error)
Constants ¶
This section is empty.
Variables ¶
var FS fs.FS
A file system containing the asset files
Functions ¶
func BindBefore ¶
func BindBefore(dir string)
func BindExeDir ¶
func BindExeDir()
func BindExeSubDir ¶
func BindExeSubDir(name string)
func FileString ¶
FileString reads an asset file and returns its contents as a string.
func ParseHTMLTemplateFiles ¶ added in v0.1.1
func ParseTemplateFiles ¶
func SetDefaultFS ¶ added in v0.3.0
SetDefaultFS sets a file system to be used by global functions in case during init() a local asset directory could not be found and the executable does not have a zip file appended to it.
This function allows maintaining the the package's previous behaviour while extending it to work with io/fs based file systems.
Types ¶
This section is empty.