Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseDirWithExt ¶
ParseDirWithExt returns a new instance of all CSS files located within the provided directory.
Types ¶
type DirStatement ¶
type DirStatement struct { Total int DirRoot string FilesByExt map[string][]FileStatement }
DirStatement defines a structure for all files retrieved from the giving directory.
func GetDirStatement ¶
func GetDirStatement(dir string, doGo bool) (DirStatement, error)
GetDirStatement returns a instance of a DirStatement which contains all files retrieved through running the directory.
type DirWalker ¶
DirWalker defines a function type which for processing a path and it's info retrieved from the fs.
type FileStatement ¶
FileStatement defines a structure to contain the details of a given file.
type Packer ¶
type Packer interface {
Pack(files []FileStatement, dir DirStatement) ([]WriteDirective, error)
}
Packer exposes a interface which exposes methods for validating the type of files it supports and a method to appropriately pack the FileStatments as desired into the given endpoint directory.
type StaticDirective ¶
StaticDirective defines a specific directive option which requires the content of the file be written into it's own single file as dictated by the DirName and FileName provided.
type Webpack ¶
type Webpack struct {
// contains filtered or unexported fields
}
Webpack defines the core structure for handling bundling of different assets using registered packers.
func (*Webpack) Build ¶
func (w *Webpack) Build(dir string, doGoSources bool) (map[string][]WriteDirective, map[string][]WriteDirective, error)
Build runs through the directory pull all files and runs them through the packers to service each files by extension and returns a slice of all WriteDirective for final processing.
func (*Webpack) Compile ¶
func (w *Webpack) Compile(dir string, doGoSources bool) (io.WriterTo, map[string][]WriteDirective, error)
Compile returns a io.WriterTo which contains a complete source of all assets generated and stored inside a io.WriteTo which will contain the go source excluding the package declaration so has to allow you write the contents into the package you wish.
type WriteDirective ¶
type WriteDirective struct { OriginPath string OriginAbsPath string Writer io.WriterTo Static *StaticDirective }
WriteDirective defines a type which defines a directive with details of the content to be written to and the original path and abspath of it's origin.
func (WriteDirective) Read ¶
func (directive WriteDirective) Read() (string, error)
Read will copy directives writer into a content buffer and returns the giving string representation of that data, content will be gzipped.