aboutsummaryrefslogtreecommitdiff
path: root/lib/memfs/embed_options.go
AgeCommit message (Collapse)Author
2026-01-15all: convert license and copyright to use SPDX identifiersShulhan
With help of spdxconv tool [1], we able to bulk update all files license and copyright format to comply with SPDX formats. [1] https://kilabit.info/project/spdxconv/
2022-02-28lib/memfs: embed the field CommentHeader on generated Go fileShulhan
Since the comment header may contain multiple lines and the value will be rendered into template, we must remind user that the value must be set using raw string literal syntax ``, not "".
2022-02-14lib/memfs: add option CommentHeader to EmbedOptionsShulhan
The CommentHeader option allow user to define custom header to the Go generated file. The string value is not checked, whether it's a comment or not, it will rendered as is.
2021-12-19lib/memfs: remove field ContentEncoding from EmbedOptions and NodeShulhan
The original idea for option ContentEncoding in EmbedOptions and Node is to save spaces, compressing the content on disk on embedding and doing transport, when the MemFS instance is used to serve the (embedded) contents of file system. This option turns out break the HTTP content negotiation [1] of accept-encoding header, if the HTTP server does not handle it properly, which default Go HTTP server does not. In order to prevent this issue in the future, for anyone who use the memfs for serving static HTTP contents, we remove the options and store the embedded content as is and let the HTTP server handle how the compression by itself. [1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Content_negotiation
2021-10-26lib/memfs: move the embedded parameter to OptionsShulhan
Since the GoEmbed can be called only when MemFS instance is initiated, it would be better if parameters for GoEmbed also initialized in the struct Options. In this way any additional parameters needed to add to GoEmbed does not changes the method signature in the future. This commit add new type EmbedOptions that contains the parameters for GoEmbed. In this new type, we add new field EmbedWithoutModTime. if its true, the modification time for all files and directories are not stored inside generated code, instead all files will use the current time when the program is running.