asset

package module
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 License: MIT Imports: 12 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
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

func FileString(name string) (content string, err error)

FileString reads an asset file and returns its contents as a string.

func Open

func Open(name string) (io.ReadSeekCloser, error)

func ParseHTMLTemplateFiles added in v0.1.1

func ParseHTMLTemplateFiles(t *template.Template, filenames ...string) (*template.Template, error)

func ParseTemplateFiles

func ParseTemplateFiles(t *template.Template, filenames ...string) (*template.Template, error)

func ReadDir

func ReadDir(path string) (fi []fs.DirEntry, err error)

func SetDefaultFS added in v0.3.0

func SetDefaultFS(fsys fs.FS, root, source string) error

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.

func Stat

func Stat(path string) (fi os.FileInfo, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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