Documentation ¶
Index ¶
- Variables
- func Bytes(path string, data []byte)
- func Data(uri string, modtime int64, mode uint32, data []byte)
- func Done() error
- func File(name string) error
- func List(folder string) []string
- func Open(name string) (http.File, error)
- func ServeFile(w http.ResponseWriter, r *http.Request, name string)
- type FileSystem
Constants ¶
This section is empty.
Variables ¶
var ImporterName = "inbed.go"
ImporterName is the name of the go source file that imports the generated inbed package.
var PackageName = "inbed"
PackageName is the name of the generated package. If the package name has a .go extension then a file is produced instead of a package.
var Root = filepath.Dir(os.Args[0])
Root is the location of the project (defaults to the directory the binary is running from).
var SingleFile string
SingleFile is the filename of the file to embed into, if blank, a package is used instead.
Functions ¶
func Done ¶
func Done() error
Done should be called after all calls to File and before any calls to Open.
func File ¶
File embeds the named file inside your code, relative to the location of the binary. If the file is a directory, the entire directory is recursively embedded.
Types ¶
type FileSystem ¶
type FileSystem struct {
Prefix string
}
FileSystem implements net/http.FileSystem
func (FileSystem) Open ¶
func (fs FileSystem) Open(name string) (http.File, error)
Open implements http.FileSystem with inbed.Open
func (FileSystem) ServeHTTP ¶
func (fs FileSystem) ServeHTTP(w http.ResponseWriter, r *http.Request)