Documentation ¶
Index ¶
- Variables
- func Cdn(name string) (string, string, error)
- func Compile(m *Manager, name string, typ Type, opts Options) (string, error)
- func Conditional(c *Condition, html string) template.HTML
- func Register(name string, parser AssetParser)
- func RegisterBundler(b Bundler)
- func RegisterCompiler(c Compiler)
- func Render(m *Manager, a *Asset) (template.HTML, error)
- func RenderTo(w io.Writer, m *Manager, a *Asset) error
- type Asset
- type AssetParser
- type Attributes
- type Bundler
- type CdnInfo
- type Comparison
- type Compiler
- type Condition
- type Group
- type Loader
- type Manager
- func (m *Manager) Close() error
- func (m *Manager) Create(name string, overwrite bool) (io.WriteCloser, error)
- func (m *Manager) Handler() http.HandlerFunc
- func (m *Manager) Has(name string) bool
- func (m *Manager) Load(name string) (io.ReadCloser, error)
- func (m *Manager) LoadURL(u *url.URL) (io.ReadCloser, error)
- func (m *Manager) Path(u *url.URL) string
- func (m *Manager) Prefix() string
- func (m *Manager) SetPrefix(prefix string)
- func (m *Manager) URL(name string) string
- func (m *Manager) VFS() vfs.VFS
- type Options
- func (o Options) Async() bool
- func (o Options) BoolOpt(key string) bool
- func (o Options) Bottom() bool
- func (o Options) Bundable() bool
- func (o Options) Bundle() bool
- func (o Options) Cdn() bool
- func (o Options) Debug() bool
- func (o Options) IntOpt(key string) (int, error)
- func (o Options) NoDebug() bool
- func (o Options) Priority() (int, error)
- func (o Options) String() string
- func (o Options) StringOpt(key string) string
- func (o Options) Top() bool
- type Position
- type ReadSeekCloser
- type ReadSeekerCloser
- type SingleAssetParser
- type Type
Constants ¶
This section is empty.
Variables ¶
View Source
var CdnInfos = []*CdnInfo{ {Pattern: regexp.MustCompile("angular-([\\d\\.]+\\d)"), Repl: "//ajax.googleapis.com/ajax/libs/angularjs/$1/angular.min.js"}, {Pattern: regexp.MustCompile("CFInstall-([\\d\\.]+\\d)"), Repl: "//ajax.googleapis.com/ajax/libs/chrome-frame/$1/CFInstall.min.js"}, {Pattern: regexp.MustCompile("dojo-([\\d\\.]+\\d)"), Repl: "//ajax.googleapis.com/ajax/libs/dojo/$1/dojo/dojo.js"}, {Pattern: regexp.MustCompile("ext-core-([\\d\\.]+\\d)"), Repl: "//ajax.googleapis.com/ajax/libs/ext-core/$1/ext-core.js"}, {Pattern: regexp.MustCompile("jquery-([\\d\\.]+\\d)"), Repl: "//ajax.googleapis.com/ajax/libs/jquery/$1/jquery.min.js", Fallback: "window.jQuery"}, {Pattern: regexp.MustCompile("jquery-ui-([\\d\\.]+\\d)"), Repl: "//ajax.googleapis.com/ajax/libs/jqueryui/$1/jquery-ui.min.js"}, {Pattern: regexp.MustCompile("mootools-(:?core-)?([\\d\\.]+\\d)"), Repl: "//ajax.googleapis.com/ajax/libs/mootools/$1/mootools-yui-compressed.js"}, {Pattern: regexp.MustCompile("prototype-([\\d\\.]+\\d)"), Repl: "//ajax.googleapis.com/ajax/libs/prototype/$1/prototype.js"}, {Pattern: regexp.MustCompile("scriptaculous-([\\d\\.]+\\d)"), Repl: "//ajax.googleapis.com/ajax/libs/scriptaculous/$1/scriptaculous.js"}, {Pattern: regexp.MustCompile("swfobject-([\\d\\.]+\\d)"), Repl: "//ajax.googleapis.com/ajax/libs/swfobject/$1/swfobject.js"}, {Pattern: regexp.MustCompile("webfont-([\\d\\.]+\\d)"), Repl: "//ajax.googleapis.com/ajax/libs/webfont/$1/webfont.js"}, }
View Source
var Service = "http://assets.gondolaweb.com/"
Service indicates the base URL for the assets service to use. POST calls will be made to:
Reducer + "css" Reducer + "js" Reducer + "less" Reducer + "coffee" ...
The code to reduce or compile will be sent in the form parameter named "code".
Functions ¶
func Register ¶
func Register(name string, parser AssetParser)
func RegisterBundler ¶
func RegisterBundler(b Bundler)
func RegisterCompiler ¶
func RegisterCompiler(c Compiler)
Types ¶
type Asset ¶
type Asset struct { Name string Type Type Position Position Condition *Condition Attributes Attributes HTML string }
func (*Asset) IsTemplate ¶
func (*Asset) TemplateName ¶
type AssetParser ¶
func SingleParser ¶
func SingleParser(parser SingleAssetParser) AssetParser
type Attributes ¶
func (Attributes) String ¶
func (a Attributes) String() string
type Comparison ¶
type Comparison int
const ( ComparisonNone Comparison = iota ComparisonEqual ComparisonLessThan ComparisonLessThanOrEqual ComparisonGreaterThan ComparisonGreaterThanOrEqual )
type Condition ¶
type Condition struct { Comparison Comparison Version int NonIE bool }
func ParseCondition ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) Handler ¶
func (m *Manager) Handler() http.HandlerFunc
Handler returns an http.handlerFunc which serves the assets from this Manager. To avoid circular imports, this function returns an http.HandlerFunc rather than a gnd.la/app.Handler. To obtain a gnd.la/app.Handler use gnd.la/app.HandlerFromHTTPFunc.
type Options ¶
func ParseOptions ¶
type ReadSeekCloser ¶
type ReadSeekCloser interface { io.ReadSeeker io.Closer }
type ReadSeekerCloser ¶
type ReadSeekerCloser interface { io.ReadCloser io.Seeker }
func DefaultLoader ¶
type SingleAssetParser ¶
Click to show internal directories.
Click to hide internal directories.