Documentation ¶
Index ¶
- Variables
- func AddPlugin(plugin *Plugin)
- func Append(path string, root string) error
- func Index(path string) error
- func IndexBundles() error
- func IndexItems(root string) error
- func IndexRelated() error
- func Process(bundle *Bundle) error
- func Remove(path string)
- func RemovePlugin(namespace string)
- func SetBundles(bundles []*Bundle)
- func Update(path string) error
- type Bundle
- func (b *Bundle) CleanPath(file string) string
- func (b *Bundle) MatchPatterns(file string, patterns []string) bool
- func (b *Bundle) ShouldCompress(file string) bool
- func (b *Bundle) ShouldGenerateProgressive(file string) bool
- func (b *Bundle) ShouldGenerateSourceMap(file string) bool
- func (b *Bundle) ShouldInclude(file string) bool
- func (b *Bundle) ToDestination(file string) string
- func (b *Bundle) ToExtension(file string, extension string) string
- func (b *Bundle) ToHashed(file string, hash string) string
- func (b *Bundle) ToNonHashed(file string, hash string) string
- func (b *Bundle) ToSource(file string) string
- type Compress
- type DeleteFunc
- type Destination
- type ExecuteFunc
- type InitFunc
- type Item
- type OptimizeFunc
- type Plugin
- type Progressive
- type Related
- type RelatedFunc
- type ResolveFunc
- type Source
- type SourceMap
Constants ¶
This section is empty.
Variables ¶
var Default = &Bundle{ Destination: Destination{ Hashed: true, }, Compress: Compress{ Enabled: true, }, SourceMap: SourceMap{ Enabled: true, }, Progressive: Progressive{ Enabled: true, }, }
Default bundle model
Functions ¶
func AddPlugin ¶ added in v0.0.12
func AddPlugin(plugin *Plugin)
AddPlugin add a new plugin to the index
func IndexBundles ¶ added in v0.0.12
func IndexBundles() error
IndexBundles creates and retrieve every possible bundle with current index
func IndexItems ¶ added in v0.0.12
IndexItems walks on path and add files to the index
func IndexRelated ¶ added in v0.0.12
func IndexRelated() error
IndexRelated detect the related assets on the index
func Remove ¶ added in v0.0.2
func Remove(path string)
Remove item information from index if match file path
func RemovePlugin ¶ added in v0.0.12
func RemovePlugin(namespace string)
RemovePlugin removes all plugins from index that match the given namespace
func SetBundles ¶ added in v0.0.12
func SetBundles(bundles []*Bundle)
SetBundles renew the index of bundles with a new list
Types ¶
type Bundle ¶ added in v0.0.2
type Bundle struct { Extension string Item *Item Source Source Destination Destination Compress Compress SourceMap SourceMap Progressive Progressive }
Bundle struct
func GetBundles ¶ added in v0.0.4
func GetBundles() []*Bundle
GetBundles retrieve all bundles in the index
func (*Bundle) CleanPath ¶ added in v0.0.3
CleanPath return the clean file, without source and destination path
func (*Bundle) MatchPatterns ¶ added in v0.0.3
MatchPatterns return if file match one of the given patterns
func (*Bundle) ShouldCompress ¶ added in v0.0.3
ShouldCompress return if compress should be enabled for given file
func (*Bundle) ShouldGenerateProgressive ¶ added in v0.0.3
ShouldGenerateProgressive return if progressive formats should be generated for given file
func (*Bundle) ShouldGenerateSourceMap ¶ added in v0.0.3
ShouldGenerateSourceMap return if source map should be generated for given file
func (*Bundle) ShouldInclude ¶ added in v0.0.4
ShouldInclude return if file should be included on the bundle
func (*Bundle) ToDestination ¶ added in v0.0.3
ToDestination transform and return the full destination path for file
func (*Bundle) ToExtension ¶ added in v0.0.3
ToExtension return a file converted to a specific extension
func (*Bundle) ToHashed ¶ added in v0.0.3
ToHashed return a file converted to a hashed name to avoid caching
func (*Bundle) ToNonHashed ¶ added in v0.0.11
ToNonHashed return a file converted back to a non hashed name
type Destination ¶ added in v0.0.3
Destination struct
type Item ¶ added in v0.0.4
type Item struct { Path string // Full path (root + location) 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 // Current Checksum Previous string // Previous Checksum Related []Related // Related items }
Item struct
func (*Item) GetRelatedPaths ¶ added in v0.0.17
GetRelatedPaths retrieve the related paths of the item
type OptimizeFunc ¶ added in v0.0.12
Optimize function
type Plugin ¶ added in v0.0.4
type Plugin struct { Namespace string Extensions []string Init InitFunc Related RelatedFunc Resolve ResolveFunc Execute ExecuteFunc Optimize OptimizeFunc Delete DeleteFunc }
Plugin struct
type Progressive ¶ added in v0.0.2
Progressive struct
type RelatedFunc ¶ added in v0.0.12
Related function
type ResolveFunc ¶ added in v0.0.4
Resolve function