Documentation
¶
Index ¶
- Variables
- func ChmodFile(file string, perm fs.FileMode) error
- func ChownFile(file string, user int, group int) error
- func CleanExtension(file string) string
- func CleanName(file string) string
- func CopyFile(source string, destination string) error
- func DeleteFile(file string) error
- func EnsureDirectory(file string) error
- func ExecCommand(cmd string, args ...string) (string, error)
- func ExistDirectory(path string) bool
- func ExistFile(file string) bool
- func FindFiles(root string, names []string) ([]string, error)
- func FindFilesMatch(root string, patterns []string) ([]string, error)
- func GetChecksum(files []string) (string, error)
- func GetPermission(file string) (fs.FileMode, error)
- func ListFiles(root string) ([]string, error)
- func MoveFile(source string, destination string) error
- func ReadFile(file string) (string, error)
- func ReadFileAndPermission(file string) (string, fs.FileMode, error)
- func ReadFiles(files []string) (string, error)
- func ReadFilesAndPermission(files []string) (string, fs.FileMode, error)
- func RegisterBundle(bundle *Bundle)
- func RegisterProcessor(extension string, processor Processor)
- func RemoveProcessors(extension string)
- func RenameFile(source string, destination string) error
- func WalkFiles(root string, callback WalkFilesCallback) error
- func WriteFile(file string, content string, perm fs.FileMode) error
- type Action
- type Bundle
- func (b *Bundle) AddFile(file string) bool
- func (b *Bundle) CleanPath(file string) string
- func (b *Bundle) ContainsFile(file string) bool
- func (b *Bundle) GetDestination() string
- func (b *Bundle) GetFiles() []string
- func (b *Bundle) IsToMultipleDestinations() bool
- func (b *Bundle) MatchPatterns(file string, patterns []string) bool
- func (b *Bundle) RemoveFile(file 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) ShouldIgnore(file string) bool
- func (b *Bundle) ShouldSkip(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) ToSource(file string) string
- type Bundles
- type Compress
- type Destination
- type Logger
- type Processor
- type Processors
- type ProcessorsMap
- type Progressive
- type Source
- type SourceMap
- type WalkFilesCallback
Constants ¶
This section is empty.
Variables ¶
var Default = &Bundle{}
Default bundle used as model
Functions ¶
func CleanExtension ¶ added in v0.0.3
Return the clean file extension, without dot
func EnsureDirectory ¶
EnsureDirectory makes sure directory exists from file path
func ExistDirectory ¶ added in v0.0.2
ExistDirectory check if directory exists
func FindFilesMatch ¶ added in v0.0.3
FindFilesMatch retrieve files from source path that match patterns
func GetChecksum ¶ added in v0.0.3
GetChecksum retrive the checksum for files
func GetPermission ¶
GetPermission retrieve file permission from file
func ReadFileAndPermission ¶
ReadFileAndPermission retrieve file content and permissions from file
func ReadFilesAndPermission ¶ added in v0.0.3
ReadFilesAndPermission retrieve files content from file list and the permision of the first file
func RegisterBundle ¶ added in v0.0.3
func RegisterBundle(bundle *Bundle)
RegisterBundle register a bundle into the index
func RegisterProcessor ¶ added in v0.0.3
RegisterProcessor register a new processor for the extension
func RemoveProcessors ¶ added in v0.0.3
func RemoveProcessors(extension string)
RemoveProcessors removes all processors for the extension
func RenameFile ¶
RenameFile rename a file name
func WalkFiles ¶ added in v0.0.3
func WalkFiles(root string, callback WalkFilesCallback) error
WalkFiles find files in source path and process callback for every result
Types ¶
type Action ¶ added in v0.0.3
type Action struct {
Type string
}
Action struct
type Bundle ¶ added in v0.0.2
type Bundle struct { Extension string Source Source Destination Destination Compress Compress SourceMap SourceMap Progressive Progressive }
Bundle struct
func NewBundle ¶ added in v0.0.3
func NewBundle() *Bundle
NewBundle create a new bundle instance from default bundle
func RetrieveBundleFor ¶ added in v0.0.3
RetrieveBundleFor retrieve the related bundle of the file
func (*Bundle) CleanPath ¶ added in v0.0.3
Return the clean file, without source and destination path
func (*Bundle) ContainsFile ¶ added in v0.0.3
Contains check if file is in bundle source files
func (*Bundle) GetDestination ¶ added in v0.0.3
Return the final destination file path
func (*Bundle) IsToMultipleDestinations ¶ added in v0.0.3
Detect if bundle processing should have multiple destinations
func (*Bundle) MatchPatterns ¶ added in v0.0.3
MatchPatterns return if file match one of the given patterns
func (*Bundle) RemoveFile ¶ added in v0.0.3
RemoveFile remove file from bundle source files
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) ShouldIgnore ¶ added in v0.0.3
ShouldIgnore return if processing should be ignored for given file
func (*Bundle) ShouldSkip ¶ added in v0.0.3
ShouldSkip return if processing should be skipped for given file
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 Bundles ¶ added in v0.0.3
type Bundles []*Bundle
Bundles struct
func RetrieveBundles ¶ added in v0.0.3
func RetrieveBundles() Bundles
RetrieveBundles get a list of all registered bundles
type Destination ¶ added in v0.0.3
Destination struct
type Logger ¶ added in v0.0.3
type Logger struct { Processed []string Skipped []string Ignored []string Written []string Deleted []string }
Logger struct
func (*Logger) AddDeleted ¶ added in v0.0.3
AddDeleted append file to deleted list
func (*Logger) AddIgnored ¶ added in v0.0.3
AddIgnored append file to ignored list
func (*Logger) AddProcessed ¶ added in v0.0.3
AddProcessed append file to processed list
func (*Logger) AddSkipped ¶ added in v0.0.3
AddSkipped append file to skipped list
func (*Logger) AddWritten ¶ added in v0.0.3
AddWritten append file to written list
type Processors ¶
type Processors []Processor
Processors struct
func RetrieveProcessors ¶ added in v0.0.3
func RetrieveProcessors(extension string) Processors
RetrieveProcessors for given extension
type Progressive ¶ added in v0.0.2
Compress struct
type WalkFilesCallback ¶ added in v0.0.3
WalkFilesCallback type