Documentation
¶
Index ¶
- func NewPagePrinter(w io.Writer, static bool, include gox.Elem, importMap []byte, meta gox.Editor) gox.Printer
- func NewResourcePrinter(printer gox.Printer) gox.Printer
- type HandlerFunc
- type HandlerSimpleFunc
- type Payload
- type PayloadPrinter
- type SourceBytes
- type SourceExternal
- type SourceFS
- type SourceHandler
- type SourceHook
- type SourceLocalFS
- type SourceProxy
- type SourceStatic
- type SourceString
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPagePrinter ¶
Types ¶
type HandlerFunc ¶
HandlerFunc serves a resource request. Returning true stops serving the resource after that request.
type HandlerSimpleFunc ¶
type HandlerSimpleFunc = func(w http.ResponseWriter, r *http.Request)
HandlerSimpleFunc serves a resource request and keeps the resource available for later requests.
type PayloadPrinter ¶
type PayloadPrinter struct {
// contains filtered or unexported fields
}
func NewPayloadPrinter ¶
func NewPayloadPrinter(disableGzip bool) *PayloadPrinter
func (*PayloadPrinter) Finalize ¶
func (b *PayloadPrinter) Finalize()
func (*PayloadPrinter) Payload ¶
func (b *PayloadPrinter) Payload() actions.Payload
func (*PayloadPrinter) Release ¶
func (b *PayloadPrinter) Release()
type SourceBytes ¶
type SourceBytes []byte
SourceBytes serves bytes held in memory.
func (SourceBytes) Handler ¶
func (s SourceBytes) Handler() HandlerFunc
func (SourceBytes) StaticEntry ¶
func (s SourceBytes) StaticEntry() resources.StaticEntry
type SourceExternal ¶
type SourceExternal string
SourceExternal is a URL the browser loads directly from another host.
Doors writes the URL unchanged. It adds the host to the generated Content-Security-Policy only for script tags and stylesheet or modulepreload links.
type SourceFS ¶
SourceFS serves the file at Entry from FS.
func (SourceFS) Handler ¶
func (s SourceFS) Handler() HandlerFunc
func (SourceFS) StaticEntry ¶
func (s SourceFS) StaticEntry() resources.StaticEntry
type SourceHandler ¶ added in v0.8.5
type SourceHandler interface {
gox.Modify
Handler() HandlerFunc
}
SourceHandler is app-owned content that Doors serves under a generated src or href URL.
type SourceHook ¶
SourceHook serves a resource from a handler.
Return true to stop serving the resource after that request, false to keep it available. The request body is not limited by ServerRequestBodyLimit.
func (SourceHook) Handler ¶
func (s SourceHook) Handler() HandlerFunc
type SourceLocalFS ¶
type SourceLocalFS string
SourceLocalFS serves one file from the local filesystem by path.
func (SourceLocalFS) Handler ¶
func (s SourceLocalFS) Handler() HandlerFunc
func (SourceLocalFS) StaticEntry ¶
func (s SourceLocalFS) StaticEntry() resources.StaticEntry
type SourceProxy ¶
type SourceProxy string
SourceProxy serves a resource by reverse-proxying requests to a URL.
If the URL cannot be parsed, requests fail with status 500.
func (SourceProxy) Handler ¶
func (s SourceProxy) Handler() HandlerFunc
type SourceStatic ¶
type SourceStatic interface {
SourceHandler
StaticEntry() resources.StaticEntry
// contains filtered or unexported methods
}
SourceStatic is content Doors reads up front.
type SourceString ¶
type SourceString string
SourceString serves string content held in memory.
func (SourceString) Handler ¶
func (s SourceString) Handler() HandlerFunc
func (SourceString) StaticEntry ¶
func (s SourceString) StaticEntry() resources.StaticEntry