Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContentEncoding ¶
type ContentEncoding int
const ( // Identity Content-ContentEncoding (this is the default) Identity ContentEncoding = iota // identity // Gzip Content-ContentEncoding Gzip // gzip // Deflate Content-ContentEncoding Deflate // deflate )
func (ContentEncoding) String ¶
func (i ContentEncoding) String() string
type ContentType ¶
type ContentType string
ContentType is used to prioritize asset types based on the Critical Rendering Path. See: https://developers.google.com/web/fundamentals/performance/critical-rendering-path
func (ContentType) Priority ¶
func (c ContentType) Priority() int
Priority returns the ContentType's sort priority based on the Critical Rendering Path. See: https://developers.google.com/web/fundamentals/performance/critical-rendering-path
type EncodedAsset ¶
type EncodedAsset struct { Url string `json:"url"` File string `json:"file"` Lazy bool `json:"lazy"` ModTime time.Time `json:"mod_time"` ContentType ContentType `json:"content_type"` Etag string `json:"etag"` Data EncodedData `json:"-"` Source string `json:"source"` }
EncodedAsset represents a single asset that has been loaded, and encoded.
type EncodedAssets ¶
type EncodedAssets []*EncodedAsset
EncodedAssets is a sorted list of EncodedAssets. The entries are sorted based on their ContentType.Priority() such that higher priority entries occur before lower priority entries.
func (EncodedAssets) Contains ¶
func (e EncodedAssets) Contains(url string) bool
Contains returns true if the list of encoded assets contains the requested url.
func (EncodedAssets) Less ¶
func (e EncodedAssets) Less(i, j int) bool
Len implements sort.Interface.Less()
func (EncodedAssets) Swap ¶
func (e EncodedAssets) Swap(i, j int)
Len implements sort.Interface.Swap()
type EncodedData ¶
type EncodedData []*EncodedDatum
EncodedData is a sorted list of EncodedDatum. The entries are sorted based on their ContentLength such that smaller entries occur before larger ones.
func (EncodedData) Less ¶
func (e EncodedData) Less(i, j int) bool
Len implements sort.Interface.Less()
type EncodedDatum ¶
type EncodedDatum struct { ContentEncoding ContentEncoding `json:"content_encoding"` Data []byte `json:"-"` }
EncodedDatum represents a single encoding of a single asset.
type Site ¶
type Site struct { Index string `json:"index"` Checksum string `json:"checksum"` Assets EncodedAssets `json:"assets"` }
Site represents a loaded site.