Documentation ¶
Index ¶
- func HTML(w http.ResponseWriter, r *http.Request, status int, templateName string)
- func JSON(w http.ResponseWriter, r *http.Request, status int, data any)
- func Set(r *http.Request, name string, value interface{})
- func SetFrame(r *http.Request, name string)
- func SetFrameArg(r *http.Request, name string, value interface{})
- func UseFrame(r *http.Request, name string)
- func XML(w http.ResponseWriter, r *http.Request, status int, data any)
- type Config
- type ConfigOption
- type Inv
- func (inv *Inv) HTML(w http.ResponseWriter, r *http.Request, status int, templateName string)
- func (inv *Inv) JSON(w http.ResponseWriter, r *http.Request, status int, data any)
- func (inv *Inv) Set(name string, value any)
- func (inv *Inv) SetFrame(name string)
- func (inv *Inv) SetFrameArg(name string, value any)
- func (inv *Inv) UseFrame(name string)
- func (inv *Inv) XML(w http.ResponseWriter, r *http.Request, status int, data any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetFrameArg ¶
Types ¶
type ConfigOption ¶
type ConfigOption func(config *Config)
func RebuildOnChange ¶
func RebuildOnChange(ctx context.Context, baseDir string) ConfigOption
RebuildOnChange is a render option which will trigger the rebuild of the templates when a .html file within baseDir or any subdirectories are changed. If baseDir is the empty string, this will do nothing.
func WithDir ¶
func WithDir(dir string) ConfigOption
WithDir sets the directory to search for templates, instead of just the the root. If unable to set the directory, this function will panic
func WithFrame ¶
func WithFrame(frameTemplate string) ConfigOption
WithFrame adds a frame template, which is used to render the contents of template used in the request within another template. Frame templates are evaluated in reverse order, meaning any later fame templates are rendered in earlier order.
func WithFuncs ¶
func WithFuncs(funcs template.FuncMap) ConfigOption
type Inv ¶
type Inv struct {
// contains filtered or unexported fields
}
func (*Inv) SetFrameArg ¶
Click to show internal directories.
Click to hide internal directories.