MCPcopy Create free account

hub / github.com/abiosoft/mold / functions

Functions63 in github.com/abiosoft/mold

↓ 24 callersFunctionNew
New creates a new [Engine] with fs as the underlying filesystem. The directory will be traversed and all files matching the configured filename exten
mold.go:76
↓ 24 callersFunctioncreateTestFS
(extraFiles ...testFile)
mold_test.go:16
↓ 15 callersMethodString
()
process.go:177
↓ 12 callersFunctionMust
Must is a helper that wraps a call to a function returning ([Engine], error) and panics if the error is non-nil. Example: engine := mold.Must(mold.
mold.go:86
↓ 11 callersMethodRender
Render executes the layout template, merging it with the specified view template, then writes the resulting HTML to the provided io.Writer. Parameter
mold.go:28
↓ 8 callersFunctionWithLayout
WithLayout configures the path to the layout file.
mold.go:117
↓ 4 callersFunctionhasExt
(exts []string, ext string)
engine.go:257
↓ 4 callersFunctionnewVal
(val T)
engine.go:313
↓ 3 callersFunctionWith
With is a helper for specifying multiple options. Example: options := mold.With( mold.WithLayout("layout.html"), mold.WithRoot("web"),
mold.go:103
↓ 3 callersFunctionWithRoot
WithRoot configures the base directory from which template files are loaded.
mold.go:112
↓ 3 callersFunctionprocessTree
processTree traverses the node tree and swaps render and partial declarations with equivalent template calls. It returns all referenced templates enco
process.go:10
↓ 3 callersMethodupdate
(val T)
engine.go:317
↓ 2 callersFunctionHideFS
HideFS wraps an [fs.FS] and restricts access to files with the specified extensions, essentially hiding them. This is useful to prevent exposing templ
mold.go:147
↓ 2 callersMethodOpen
Open implements fs.FS.
mold.go:165
↓ 2 callersFunctiongetActionArgs
(cmd *parse.CommandNode)
process.go:128
↓ 2 callersFunctionparsePartial
(partial *templateFile)
engine.go:243
↓ 2 callersFunctionpos
(body string, pos int)
process.go:157
↓ 2 callersFunctionreadFile
(fsys fs.FS, name string)
engine.go:248
↓ 2 callersFunctionvalidateLayoutFile
(exts []string, name string)
engine.go:272
↓ 1 callersFunctionWithExt
WithExt configures the filename extensions for the templates. Only files with the specified extensions would be parsed. Default: [".html", ".gohtml"
mold.go:125
↓ 1 callersFunctionWithFuncMap
WithFuncMap configures the custom Go template functions.
mold.go:130
↓ 1 callersFunctioninvalidFuncType
(typ templateType, funcName string)
process.go:117
↓ 1 callersFunctionnewEngine
(fsys fs.FS, options ...Option)
engine.go:27
↓ 1 callersFunctionparseLayout
(root templateSet, layoutRaw string, funcMap template.FuncMap)
engine.go:168
↓ 1 callersFunctionparseView
(set templateSet, layout *templateFile, name string)
engine.go:206
↓ 1 callersFunctionplaceholderFuncs
()
engine.go:286
↓ 1 callersFunctionprocessActionNode
(root *templateFile, parent *parse.ListNode, index int, node parse.Node, funcName string)
process.go:68
↓ 1 callersFunctionprocessNode
(root *templateFile, parent *parse.ListNode, index int, node parse.Node)
process.go:22
↓ 1 callersFunctionsetup
(c *Config, options ...Option)
engine.go:121
↓ 1 callersFunctionwalk
(fsys fs.FS, exts []string, funcMap template.FuncMap)
engine.go:75
MethodError
()
process.go:153
MethodRender
Render implements Layout.
engine.go:62
FunctionTestHideFS_Allowed
(t *testing.T)
mold_test.go:308
FunctionTestHideFS_Hidden
(t *testing.T)
mold_test.go:299
FunctionTestNew
(t *testing.T)
mold_test.go:32
FunctionTestNew_CyclicReferenceError
(t *testing.T)
mold_test.go:98
FunctionTestNew_Ext
(t *testing.T)
mold_test.go:106
FunctionTestNew_FuncMap
(t *testing.T)
mold_test.go:135
FunctionTestNew_InvalidSub
(t *testing.T)
mold_test.go:48
FunctionTestNew_LayoutInvalidExt
(t *testing.T)
mold_test.go:82
FunctionTestNew_LayoutNotFound
(t *testing.T)
mold_test.go:66
FunctionTestNew_LayoutParseError
(t *testing.T)
mold_test.go:74
FunctionTestNew_Panic
(t *testing.T)
mold_test.go:55
FunctionTestNew_Sub
(t *testing.T)
mold_test.go:43
FunctionTestNew_ViewParseError
(t *testing.T)
mold_test.go:90
FunctionTestPos
(t *testing.T)
process_test.go:8
FunctionTestRender
(t *testing.T)
mold_test.go:170
FunctionTestRender_InvalidData
(t *testing.T)
mold_test.go:223
FunctionTestRender_LayoutPartialNotFound
(t *testing.T)
mold_test.go:207
FunctionTestRender_PartialInvalidPartial
(t *testing.T)
mold_test.go:255
FunctionTestRender_PartialInvalidRender
(t *testing.T)
mold_test.go:244
FunctionTestRender_TemplateIf
(t *testing.T)
mold_test.go:266
FunctionTestRender_TemplateRange
(t *testing.T)
mold_test.go:288
FunctionTestRender_TemplateWith
(t *testing.T)
mold_test.go:277
FunctionTestRender_ViewInvalidRender
(t *testing.T)
mold_test.go:234
FunctionTestRender_ViewNotFound
(t *testing.T)
mold_test.go:193
FunctionTestRender_ViewPartialNotFound
(t *testing.T)
mold_test.go:215
FunctionTestValidExt
(t *testing.T)
engine_test.go:8
FunctionhandleIndex
(w http.ResponseWriter, r *http.Request)
examples/2_custom_layout/main.go:25
FunctionhandleNoScript
(w http.ResponseWriter, r *http.Request)
examples/2_custom_layout/main.go:29
Functionhandler
(w http.ResponseWriter, r *http.Request)
examples/1_default_layout/main.go:24
Functionmain
()
examples/2_custom_layout/main.go:19
Functionmain
()
examples/1_default_layout/main.go:16