Documentation ¶
Index ¶
- func AddPlugin(plugin *Plugin)
- func AppendFile(path string, root string) error
- func Delete(options *Options, file *File) error
- func IndexFiles(options *Options, root string) error
- func Process(options *Options, file *File) error
- func RemoveFile(path string)
- func RemovePlugin(namespace string)
- func Shutdown(options *Options) error
- func UpdateFile(path string) error
- type Compress
- type Destination
- type File
- type InitFunc
- type OptimizeFunc
- type Options
- func (o *Options) CleanPath(path string) string
- func (o *Options) MatchPatterns(file string, patterns []string) bool
- func (o *Options) ShouldCompress(path string) bool
- func (o *Options) ShouldGenerateProgressive(path string) bool
- func (o *Options) ShouldGenerateSourceMap(path string) bool
- func (o *Options) ShouldInclude(path string) bool
- func (o *Options) ToDestination(path string) string
- func (o *Options) ToExtension(path string, extension string) string
- func (o *Options) ToHashed(path string, hash string) string
- func (o *Options) ToNonHashed(path string, hash string) string
- func (o *Options) ToSource(path string) string
- type Plugin
- type Progressive
- type Related
- type RelatedFunc
- type ResolveFunc
- type ShutdownFunc
- type Source
- type SourceMap
- type TransformFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddPlugin ¶ added in v0.0.12
func AddPlugin(plugin *Plugin)
AddPlugin add a new plugin to the index
func AppendFile ¶ added in v0.1.0
AppendFile appends file information to index from its path
func IndexFiles ¶ added in v0.1.0
IndexFile index the root path files to the index, resolve related and determine destination
func RemoveFile ¶ added in v0.1.0
func RemoveFile(path string)
RemoveFile removes the file information from index if match path
func RemovePlugin ¶ added in v0.0.12
func RemovePlugin(namespace string)
RemovePlugin removes all plugins from index that match the given namespace
func UpdateFile ¶ added in v0.1.0
UpdateFile updates file information on index if matches path
Types ¶
type Destination ¶ added in v0.0.3
Destination struct
type File ¶ added in v0.1.0
type File struct { Path string // Full path (root + location) Destination string // Full destination path Root string // Root location Location string // Location from root Folder string // Location folder File string // File name with extension Name string // File name Extension string // File Extension Content string // File content Permission fs.FileMode // File permissions Exists bool // File exists flag Checksum []string // Checksum history Related []Related // Related items }
File struct
func FindPackage ¶ added in v0.1.0
FindPackage retrieves the related package from given path
func FindPackages ¶ added in v0.1.0
FindPackages retrieves the full list of detected packages
func (*File) FindRelated ¶ added in v0.1.0
FindRelated retrieve the related paths of the item recursively
type InitFunc ¶ added in v0.0.6
Init function Used to start up the plugin and check for their dependencies
type OptimizeFunc ¶ added in v0.0.12
Optimize function Used to run optimizations algorithms to compress file
type Options ¶
type Options struct { Source Source Destination Destination Compress Compress SourceMap SourceMap Progressive Progressive }
Options struct
func (*Options) CleanPath ¶ added in v0.1.0
CleanPath return the clean path, without source and destination path
func (*Options) MatchPatterns ¶ added in v0.1.0
MatchPatterns return if file match one of the given patterns
func (*Options) ShouldCompress ¶ added in v0.0.2
ShouldCompress return if compress should be enabled for given path
func (*Options) ShouldGenerateProgressive ¶ added in v0.1.0
ShouldGenerateProgressive return if progressive formats should be generated for given path
func (*Options) ShouldGenerateSourceMap ¶ added in v0.1.0
ShouldGenerateSourceMap return if source map should be generated for given path
func (*Options) ShouldInclude ¶ added in v0.1.0
ShouldInclude return if path should be included on the bundle
func (*Options) ToDestination ¶ added in v0.1.0
ToDestination transform and return the full destination path for given path
func (*Options) ToExtension ¶ added in v0.1.0
ToExtension return a file path converted to a specific extension
func (*Options) ToHashed ¶ added in v0.1.0
ToHashed return a file path converted to a hashed name to avoid caching
func (*Options) ToNonHashed ¶ added in v0.1.0
ToNonHashed return a file path converted back to a non hashed name
type Plugin ¶ added in v0.0.4
type Plugin struct { Namespace string Extensions []string Initialized bool Init InitFunc Shutdown ShutdownFunc Resolve ResolveFunc Related RelatedFunc Transform TransformFunc Optimize OptimizeFunc }
Plugin struct
type Progressive ¶ added in v0.0.2
Progressive struct
type RelatedFunc ¶ added in v0.0.12
Related function Detects and generates the list of related files to the given item, being a dependency or not
type ResolveFunc ¶ added in v0.0.4
Resolve function Used to transform the source path to the final destination path
type ShutdownFunc ¶ added in v0.2.0
Shutdown function Used to shutdown the plugin and cleanup resources
type TransformFunc ¶ added in v0.1.0
Transform function Used to transform the file content to the final format by applying compilation if necessary