Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BundleMode ¶
type BundleMode int32
const ( DevBundleMode BundleMode = 0 ProdBundleMode BundleMode = 1 )
var CurrentDevMode BundleMode = DevBundleMode
type DefaultPage ¶
type DefaultPage interface {
Handle(*Request)
}
DefaultPage defines the standard behavior for a orbit page handler
type MuxHandler ¶
type MuxHandler interface { HandleFunc(string, func(http.ResponseWriter, *http.Request)) Handle(string, http.Handler) ServeHTTP(http.ResponseWriter, *http.Request) }
muxHandle is used to inject the base mux handler behavior
type PageRender ¶
type PageRender string
const ( // orbit:page .//pages/example2.jsx ExampleTwoPage PageRender = "fe9faa2750e8559c8c213c2c25c4ce73" // orbit:page .//pages/example.jsx ExamplePage PageRender = "496a05464c3f5aa89e1d8bed7afe59d4" )
type Request ¶
type Request struct { RenderPage func(page PageRender, data interface{}) Request *http.Request Response http.ResponseWriter Slugs map[string]string }
Request is the standard request payload for the orbit page handler this is just a fancy wrapper around the http request & response that will also assist the rendering of bundled pages & incoming path slugs
type Serve ¶
type Serve struct {
// contains filtered or unexported fields
}
func (*Serve) HandleFunc ¶
HandleFunc attaches a handler to the specified pattern, this handler will be ran upon a match of the request path during an incoming http request.
func (*Serve) HandlePage ¶
func (s *Serve) HandlePage(path string, dp DefaultPage)
HandlePage attaches an orbit page to the specified pattern, this handler will be ran upon a match of the request path during an incoming http request