Easy resource embedder
gassets alternatives and similar packages
Based on the "Resource Embedding" category.
Alternatively, view gassets alternatives based on common mentions on social networks and blogs.
7.5 0.1 gassets VS vfsgenTakes an input http.FileSystem (likely at go generate time) and generates Go code that statically implements it.
3.4 0.0 gassets VS statics:file_folder: Embeds static resources into go files for single binary compilation + works with http.FileSystem + symlinks
Do you think we are missing an alternative of gassets or a related project?
Easy asset and resource embedder!
Get the source and install it:
go get -u github.com/ShrewdSpirit/gassets/cmd/gassets/... go install github.com/ShrewdSpirit/gassets/cmd/gassets
gassets.toml file in your assets directory and write the following in it:
These are required keys for
output-path specifies where the generated file is placed. It's relative to the given directory (
-d commandline option).
For each virtual directory and file, a toml table is required.
root is the root of all your virtual directories and files. You can add as many vdirs and files to
root and any other vdir.
To add virtual directory to
root you should add:
You can add files to each vdir in two ways:
- Use glob
- Add a file table
To add files by globs,
include key must be supplied with an array of globs. See the example
Only matching files will be included in current vdir.
A file table has 2 keys, one being optional. The
path key is required and it's the path to the file relative to given directory.
The other key is
override-files which is an array of strings for files to be loaded instead if the given path exists at runtime. The path is relative to working directory.
-d: Assets directory (where
output-path="." [root] [root.file1] path="file.txt" [root.file2] path="test/file2.txt" [root.myvdir] include=["test/glob/*.jpg"] [root.myvdir.index_template] path="index.templ" override-files=["templates/index.templ", "index.templ"]
*Note that all licence references and agreements mentioned in the gassets README section above are relevant to that project's source code only.