Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseContext ¶
func NewBaseContext ¶
func NewBaseContext(templateName string) *BaseContext
func (*BaseContext) AddError ¶
func (ctx *BaseContext) AddError(err error)
func (*BaseContext) AddNotice ¶
func (ctx *BaseContext) AddNotice(notice string)
func (*BaseContext) Name ¶
func (ctx *BaseContext) Name() string
type FormContext ¶
type FormContext struct {
*BaseContext
CsrfToken string
}
func NewFormContext ¶
func NewFormContext(res http.ResponseWriter, req *http.Request, base *BaseContext) (*FormContext, error)
func (*FormContext) CsrfTokenField ¶
func (fc *FormContext) CsrfTokenField() template.HTML
type TemplateContext ¶
type TemplateContext interface {
// Add an error that should be displayed
// to the user
AddError(err error)
// Add a notice/message that should be
// displayed to the user
AddNotice(notice string)
// Name of the (main) template that is being
// rendered (not header or footer templates).
Name() string
}
type TemplateRenderer ¶
type TemplateRenderer interface {
RenderTemplate(wr io.Writer, ctx TemplateContext) error
}
func NewTemplateRenderer ¶
func NewTemplateRenderer() TemplateRenderer
Click to show internal directories.
Click to hide internal directories.