Documentation
¶
Index ¶
- Variables
- func Append(path string) error
- func Index(path string) error
- func Map(files []string, dependencies []string, destination string)
- func Process(bundle *Bundle) error
- func Register(plugin *Plugin)
- func Remove(path string)
- func Unregister(extension string)
- func Update(path string) error
- type Bundle
- func (b *Bundle) CleanPath(file string) string
- func (b *Bundle) Deleted(path string)
- func (b *Bundle) Ignored(path string)
- func (b *Bundle) MatchPatterns(file string, patterns []string) bool
- func (b *Bundle) Processed(path string)
- 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) ShouldOutputToMany() bool
- func (b *Bundle) Skipped(path string)
- 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) ToSource(file string) string
- func (b *Bundle) Written(path string)
- type Compress
- type DeleteFunc
- type Destination
- type InitFunc
- type Item
- type Logs
- type Mapper
- type Plugin
- type Progressive
- type ResolveFunc
- type RunFunc
- 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 Register ¶ added in v0.0.4
func Register(plugin *Plugin)
Register add a new plugin to the index
func Remove ¶ added in v0.0.2
func Remove(path string)
Remove item information from indexer if match file path
func Unregister ¶ added in v0.0.4
func Unregister(extension string)
Unregister removes all plugins that match the given extension
Types ¶
type Bundle ¶ added in v0.0.2
type Bundle struct {
Extension string
Items []*Item
Source Source
Destination Destination
Compress Compress
SourceMap SourceMap
Progressive Progressive
Logs Logs
}
Bundle struct
func GetBundleFor ¶ added in v0.0.4
GetBundleFor retrieve the related bundle for the file
func GetBundleFromMapper ¶ added in v0.0.4
GetBundleFromMapper retrieve the final bundle from given mapper
func GetBundles ¶ added in v0.0.4
func GetBundles() []*Bundle
GetBundles retrieve every possible bundle with current indexer
func NewBundle ¶ added in v0.0.3
func NewBundle() *Bundle
NewBundle create and retrieve a new bundle
func (*Bundle) CleanPath ¶ added in v0.0.3
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) ShouldOutputToMany ¶ added in v0.0.4
Detect if bundle should output to multiple destinations
func (*Bundle) ToDestination ¶ added in v0.0.3
Transform and return the full destination path for file
func (*Bundle) ToExtension ¶ added in v0.0.3
Return a file converted to a specific extension
type Destination ¶ added in v0.0.3
Destination struct
type Item ¶ added in v0.0.4
type Item struct {
Path string
Folder string
File string
Name string
Extension string
Content string
Permission fs.FileMode
Exists bool
Checksum string
Previous string
}
Item struct
type Logs ¶ added in v0.0.4
type Logs struct {
Processed []string
Skipped []string
Ignored []string
Written []string
Deleted []string
}
Logs struct
type Plugin ¶ added in v0.0.4
type Plugin struct {
Extensions []string
Init InitFunc
Run RunFunc
Delete DeleteFunc
Resolve ResolveFunc
}
Plugin struct
type Progressive ¶ added in v0.0.2
Compress struct
type ResolveFunc ¶ added in v0.0.4
Resolve function