Documentation ¶
Overview ¶
library github.com/CloudyKit/jet
Index ¶
- type JetRender
- type RenderOptions
- type VarMapMx
- func (scope *VarMapMx) Get(name string) reflect.Value
- func (scope *VarMapMx) GetVarMap() jet.VarMap
- func (scope *VarMapMx) Lookup(name string) (reflect.Value, bool)
- func (scope *VarMapMx) Set(name string, v interface{}) *VarMapMx
- func (scope *VarMapMx) SetFunc(name string, v jet.Func) *VarMapMx
- func (scope *VarMapMx) SetWriter(name string, v jet.SafeWriter) *VarMapMx
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JetRender ¶
type JetRender struct { Options *RenderOptions JetSet *jet.Set }
JetRender is a custom Gin template renderer using Pongo2.
func Default ¶
func Default() (jr *JetRender)
Default creates a JetRender instance with default options.
func New ¶
func New(options RenderOptions) *JetRender
New creates a new JetRender instance with custom Options.
func (*JetRender) WriteContentType ¶
WriteContentType should add the Content-Type header to the response when not set yet.
type RenderOptions ¶
RenderOptions is used to configure the renderer.
type VarMapMx ¶
type VarMapMx struct {
// contains filtered or unexported fields
}
VarMapMx defines a mutex-protected jet.VarMap that's usable concurrently.
func NewVarMapMx ¶
func NewVarMapMx() *VarMapMx
NewVarMapMx returns an initialized VarMapMx instance that is ready to be used.
func (*VarMapMx) Get ¶
Get returns the value for a key in the embedded jet.VarMap. The returned reflect.Value is not valid if the key does not exist.
func (*VarMapMx) GetVarMap ¶
func (scope *VarMapMx) GetVarMap() jet.VarMap
GetVarMap returns the embedded jet.VarMap for use in template executions.
func (*VarMapMx) Lookup ¶
Lookup returns the value for a key in the embedded jet.VarMap as well as whether the key was found or not.