Documentation
¶
Index ¶
- Variables
- func PipelineCss(name string) (template.HTML, error)
- func PipelineJs(name string) (template.HTML, error)
- func RegisterCompiler(c Compiler)
- func RegisterCompressor(c Compressor)
- type Asset
- type AutoCloseReader
- type Collection
- type Collections
- type Compiler
- type Compressor
- type Config
- type ErrOverridingPath
- type Executor
- type Group
- func (g *Group) AbsPath(path string) string
- func (g *Group) NormAsset(path string, asset Asset) string
- func (g *Group) NormAssets(paths []string, asset Asset) ([]string, error)
- func (g *Group) OutputPath() string
- func (g *Group) ResultPaths(asset Asset) ([]string, error)
- func (g *Group) RootedPath(paths ...string) string
- func (g *Group) SourcePaths() ([]string, error)
- func (g *Group) VersionedPath() string
- type NopCompiler
- type Processor
- func (p *Processor) Compile(group *Group, write bool) (io.Reader, error)
- func (p *Processor) Compress(in io.Reader) (io.Reader, error)
- func (p *Processor) GetAsset() string
- func (p *Processor) GetCompiler(path string) Compiler
- func (p *Processor) GetCompressor() Compressor
- func (p *Processor) Process() error
- func (p *Processor) ProcessGroup(group *Group) error
- func (p *Processor) Watch() error
- func (p *Processor) Write(path string, r io.Reader) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoCompiler = errors.New("No compiler found") ErrAssetNotFound = errors.New("No asset found.") )
View Source
var (
DefaultCompiler = new(NopCompiler)
)
Functions ¶
func RegisterCompiler ¶
func RegisterCompiler(c Compiler)
func RegisterCompressor ¶
func RegisterCompressor(c Compressor)
Types ¶
type Asset ¶
type Asset string
Used for constants to define the asset type set
const ( AssetCss Asset = "css" AssetJs = "js" )
type AutoCloseReader ¶
type AutoCloseReader struct {
io.ReadCloser
}
Reader that closes it self when reaches EOF
type Collections ¶
type Collections map[Asset]Collection
type Compressor ¶
type Compressor interface { Match(Asset) bool // Should compress and concatenate the file in paths and save them in the // output Compress(io.Reader) (io.Reader, error) }
Define compressor interface
type Config ¶
type Config struct { Collections Watcher *fsnotify.Watcher }
Hold a map of asset types each containing a collection
func (*Config) GetAssetGroup ¶
func (*Config) GetAssetTpl ¶
type ErrOverridingPath ¶
type ErrOverridingPath struct {
Path string
}
func (*ErrOverridingPath) Error ¶
func (e *ErrOverridingPath) Error() string
type Executor ¶
func NewExecutor ¶
type Group ¶
type Group struct { // Location inside the AppPath directory // specify this in case the root of static folder is not the default "/static" Root string `json:",omitempty"` Sources []string Output string // contains filtered or unexported fields }
Keep configuration for an asset output
func (*Group) NormAsset ¶
Returns a path for a source that will change the extension to match the asset If the path is the same error is returned. File shouldn't be overriden
func (*Group) NormAssets ¶
func (*Group) ResultPaths ¶
Determine the Result path and return the value TODO: This method will calculate the version hash
func (*Group) RootedPath ¶
func (*Group) SourcePaths ¶
func (*Group) VersionedPath ¶
type NopCompiler ¶
type NopCompiler struct{}
func (*NopCompiler) RequireCompile ¶
func (n *NopCompiler) RequireCompile() bool
func (*NopCompiler) String ¶
func (n *NopCompiler) String() string
type Processor ¶
type Processor struct { Asset Asset Collection Collection }
func NewProcessor ¶
func NewProcessor(asset Asset, collection Collection) *Processor
func (*Processor) GetCompiler ¶
func (*Processor) GetCompressor ¶
func (p *Processor) GetCompressor() Compressor
func (*Processor) ProcessGroup ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.