Documentation
¶
Overview ¶
Package content creates static content embedded in your Go binary, such as HTML files for a Web server. You provide the static content in files; then you call GenerateContent at go generate time to create a Go source file. The generated source file defines static const strings, one for each static content file. The generated string for the file 'index.html' is 'Index_html' for example. The constant is in the namespace "staticContent". Note: All files are read into memory, they should not be very big.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateContent ¶
func GenerateContent(staticDir string, outputDir string, outputFile string, packageName string) error
GenerateContent reads all the files in a directory and writes a Go source file with strings containing the bytes in each source file. Intended to be used to incorporate static Web content into a Go binary. staticDir: path to directory containing the files with static content outputDir: path to directory where to write the Go source file outputFile: filename of output Go source file packageName: name of the package to use when writing the Go source file
Types ¶
This section is empty.