Documentation ¶
Index ¶
- Constants
- type Page
- func NewPage[T interface{}](source *Source, pageName string, dataSource func(r *http.Request) (T, int)) *Page[T, interface{}]
- func NewPageWithContext[T interface{}, C interface{}](source *Source, pageName string, dataSource func(r *http.Request) (T, int), ...) *Page[T, C]
- func NewStaticPageWithContext[C interface{}](source *Source, pageName string, ctxSource func(r *http.Request) (C, int)) *Page[interface{}, C]
- type Source
- type StaticPage
Constants ¶
View Source
const ( TemplateNameBase = "base" BaseFilename = "site/base.html" PageSubdirectory = "site/pages" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Page ¶
type Page[T interface{}, C interface{}] struct {
// contains filtered or unexported fields
}
func NewPageWithContext ¶ added in v0.3.0
func NewStaticPageWithContext ¶ added in v0.3.0
func (*Page[T, C]) AsHttpHandlerFunc ¶ added in v0.3.1
func (p *Page[T, C]) AsHttpHandlerFunc() http.HandlerFunc
AsHttpHandlerFunc returns a http.HandlerFunc for certain APIs that don't want a full http.Handler
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
func (*Source) AssetsHandler ¶ added in v0.2.1
func (*Source) OnRenderError ¶ added in v0.3.3
type StaticPage ¶ added in v0.2.0
type StaticPage struct {
// contains filtered or unexported fields
}
func NewStaticPage ¶ added in v0.2.0
func NewStaticPage(source *Source, pageName string) *StaticPage
func (*StaticPage) AsHttpHandlerFunc ¶ added in v0.3.1
func (p *StaticPage) AsHttpHandlerFunc() http.HandlerFunc
func (*StaticPage) ServeHTTP ¶ added in v0.2.0
func (p *StaticPage) ServeHTTP(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.