Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is a http.Handler that will pre-render the given ember app.
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
Instance represents a running Fastboot instance.
func Boot ¶
Boot will boot the provided Fastboot-capable app in a headless browser and return a running instance.
type Options ¶
type Options struct {
App *ember.App
Origin string
Timeout time.Duration // 5s
Cache time.Duration
Isolated bool
Headed bool
OnRequest func(*Request)
OnResult func(*Result)
OnError func(error)
}
Options are used to configure the handler.
type Request ¶
type Request struct {
Method string `json:"method"`
Protocol string `json:"protocol"`
Path string `json:"path"`
Headers map[string][]string `json:"headers"`
Cookies map[string]string `json:"cookies"`
QueryParams map[string]string `json:"queryParams"`
Body string `json:"body"`
}
Request represents a request to be made.
type Result ¶
type Result struct {
HeadContent string `json:"headContent"`
BodyContent string `json:"bodyContent"`
HTMLAttributes map[string]string `json:"htmlAttributes"`
HeadAttributes map[string]string `json:"headAttributes"`
BodyAttributes map[string]string `json:"bodyAttributes"`
}
Result represents the result of an instance visit.
func Render ¶
Render will run the provided app in a headless browser and return the HTML output for the specified URL.
func (*Result) BodyAttributesString ¶
BodyAttributesString will return the body attributes as a string.
func (*Result) HTMLAttributesString ¶
HTMLAttributesString will return the HTML attributes as a string.
func (*Result) HeadAttributesString ¶
HeadAttributesString will return the head attributes as a string.