Documentation ¶
Overview ¶
Package packer implements the core packing functionality. It is designed to be used by a wrapper program (CLI etc.).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Pack ¶
func Pack(filesToPack FilesToPack, outputFilename string) error
Pack a file. Use Pack2 for progress reporting.
Types ¶
type FileToPack ¶
type FileToPack struct { // Filename is the path to the file on disk (relative or absolute). Filename string `yaml:"filename"` // ContentType is used as the Content-Type header for the source data. ContentType string `yaml:"content_type"` // DisableCompression can be set to skip any compression for this file. DisableCompression bool `yaml:"disable_compression"` // DisableGzip can be set to skip gzip compression for this file. DisableGzip bool `yaml:"disable_gzip"` // DisableBrotli can be set to skip brotli compression for this file. DisableBrotli bool `yaml:"disable_brotli"` }
FileToPack contains the headers / options for a file which is about to be packed.
type FilesToPack ¶
type FilesToPack map[string]FileToPack
FilesToPack is the set of files which will be incorporated into the packfile. The key is the path at which the file will be served, and the value gives the disk filename as well as headers / options.
type Progress ¶ added in v1.1.0
type Progress interface { // Count reports the number of items that have begun processing. Count(n int) // Begin denotes the processing of an input file. Begin(filename, compression string) // End denotes the completion of input file processing. End(filename, compression string) }
Progress is a callback object which reports packing progress.
Click to show internal directories.
Click to hide internal directories.