Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewContext ¶
func NewContext(p *Plush2Render, c gin.H) plush.Context
NewContext create a plush.Context
Types ¶
type Plush2Render ¶
type Plush2Render struct { Options *RenderOptions Name string Context plush.Context // contains filtered or unexported fields }
Plush2Render is a custom Gin template renderer using plush.
func Default ¶
func Default() *Plush2Render
Default creates a Plush2Render instance with default options.
func New ¶
func New(options RenderOptions) *Plush2Render
New creates a new Plush2Render instance with custom Options.
func (*Plush2Render) AddHelper ¶
func (p *Plush2Render) AddHelper(fn string, f interface{})
func (*Plush2Render) Instance ¶
func (p *Plush2Render) Instance(name string, data interface{}) render.Render
Instance should return a new Plush2Render struct per request and prepare the template by either loading it from disk or using plush's cache.
func (*Plush2Render) Render ¶
func (p *Plush2Render) Render(w http.ResponseWriter) error
Render should render the template to the response.
func (*Plush2Render) WriteContentType ¶
func (p *Plush2Render) WriteContentType(w http.ResponseWriter)
WriteContentType should add the Content-Type header to the response when not set yet.
type RenderOptions ¶
RenderOptions is used to configure the renderer.
Click to show internal directories.
Click to hide internal directories.