Documentation ¶
Index ¶
- Variables
- func ReplaceVariable(ctx *fasthttp.RequestCtx, w io.Writer, tag string) (int, error)
- type ReplaceFunc
- type TagFunc
- type VariablePlaceholder
- func (vp *VariablePlaceholder) ExecuteFuncString(tmplName string, fn TagFunc) (string, error)
- func (vp *VariablePlaceholder) ExecuteString(tmplName string, ctx *fasthttp.RequestCtx) (string, error)
- func (vp *VariablePlaceholder) GetTmpl(tmplName string) (*fasttemplate.Template, bool)
- func (vp *VariablePlaceholder) SetTmpl(tmplName string)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotBuiltin indicate the value of placeholder isn't builtin, users need to implement themselves ErrNotBuiltin = errors.New("not built-in variable") // ErrTmplNotExist ... ErrTmplNotExist = errors.New("tmpl not exist") )
Functions ¶
func ReplaceVariable ¶
ReplaceVariable should be used in ExecuteFuncString
Types ¶
type ReplaceFunc ¶
type TagFunc ¶
type TagFunc = fasttemplate.TagFunc
type VariablePlaceholder ¶
type VariablePlaceholder struct {
// contains filtered or unexported fields
}
func NewVariablePlaceholder ¶
func NewVariablePlaceholder() *VariablePlaceholder
NewVariablePlaceholder ...
func (*VariablePlaceholder) ExecuteFuncString ¶
func (vp *VariablePlaceholder) ExecuteFuncString(tmplName string, fn TagFunc) (string, error)
func (*VariablePlaceholder) ExecuteString ¶
func (vp *VariablePlaceholder) ExecuteString(tmplName string, ctx *fasthttp.RequestCtx) (string, error)
func (*VariablePlaceholder) GetTmpl ¶
func (vp *VariablePlaceholder) GetTmpl(tmplName string) (*fasttemplate.Template, bool)
func (*VariablePlaceholder) SetTmpl ¶
func (vp *VariablePlaceholder) SetTmpl(tmplName string)
Click to show internal directories.
Click to hide internal directories.