mirror of
https://github.com/kataras/iris.git
synced 2025-12-20 03:17:04 +00:00
replace the redis library we used with another one, no performance differences but most options for connections pooling and read/write/connect timeout (two config fields are changed as well)
relative to: https://github.com/kataras/iris/issues/1285 Former-commit-id: c20530cd67144ab8d1c9325807fe5c13268fa428
This commit is contained in:
49
view/html.go
49
view/html.go
@@ -13,32 +13,30 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type (
|
||||
// HTMLEngine contains the html view engine structure.
|
||||
HTMLEngine struct {
|
||||
// files configuration
|
||||
directory string
|
||||
extension string
|
||||
assetFn func(name string) ([]byte, error) // for embedded, in combination with directory & extension
|
||||
namesFn func() []string // for embedded, in combination with directory & extension
|
||||
reload bool // if true, each time the ExecuteWriter is called the templates will be reloaded, each ExecuteWriter waits to be finished before writing to a new one.
|
||||
// parser configuration
|
||||
options []string // text options
|
||||
left string
|
||||
right string
|
||||
layout string
|
||||
rmu sync.RWMutex // locks for layoutFuncs and funcs
|
||||
layoutFuncs map[string]interface{}
|
||||
funcs map[string]interface{}
|
||||
// HTMLEngine contains the html view engine structure.
|
||||
type HTMLEngine struct {
|
||||
// files configuration
|
||||
directory string
|
||||
extension string
|
||||
assetFn func(name string) ([]byte, error) // for embedded, in combination with directory & extension
|
||||
namesFn func() []string // for embedded, in combination with directory & extension
|
||||
reload bool // if true, each time the ExecuteWriter is called the templates will be reloaded, each ExecuteWriter waits to be finished before writing to a new one.
|
||||
// parser configuration
|
||||
options []string // text options
|
||||
left string
|
||||
right string
|
||||
layout string
|
||||
rmu sync.RWMutex // locks for layoutFuncs and funcs
|
||||
layoutFuncs map[string]interface{}
|
||||
funcs map[string]interface{}
|
||||
|
||||
//
|
||||
middleware func(name string, contents []byte) (string, error)
|
||||
Templates *template.Template
|
||||
//
|
||||
}
|
||||
)
|
||||
//
|
||||
middleware func(name string, contents []byte) (string, error)
|
||||
Templates *template.Template
|
||||
//
|
||||
}
|
||||
|
||||
var _ Engine = &HTMLEngine{}
|
||||
var _ Engine = (*HTMLEngine)(nil)
|
||||
|
||||
var emptyFuncs = template.FuncMap{
|
||||
"yield": func() (string, error) {
|
||||
@@ -132,8 +130,7 @@ func (s *HTMLEngine) Option(opt ...string) *HTMLEngine {
|
||||
}
|
||||
|
||||
// Delims sets the action delimiters to the specified strings, to be used in
|
||||
// subsequent calls to Parse, ParseFiles, or ParseGlob. Nested template
|
||||
// definitions will inherit the settings. An empty delimiter stands for the
|
||||
// templates. An empty delimiter stands for the
|
||||
// corresponding default: {{ or }}.
|
||||
func (s *HTMLEngine) Delims(left, right string) *HTMLEngine {
|
||||
s.left, s.right = left, right
|
||||
|
||||
Reference in New Issue
Block a user