Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/abiosoft/mold
/ functions
Functions
63 in github.com/abiosoft/mold
⨍
Functions
63
◇
Types & classes
13
↓ 24 callers
Function
New
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 callers
Function
createTestFS
(extraFiles ...testFile)
mold_test.go:16
↓ 15 callers
Method
String
()
process.go:177
↓ 12 callers
Function
Must
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 callers
Method
Render
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 callers
Function
WithLayout
WithLayout configures the path to the layout file.
mold.go:117
↓ 4 callers
Function
hasExt
(exts []string, ext string)
engine.go:257
↓ 4 callers
Function
newVal
(val T)
engine.go:313
↓ 3 callers
Function
With
With is a helper for specifying multiple options. Example: options := mold.With( mold.WithLayout("layout.html"), mold.WithRoot("web"),
mold.go:103
↓ 3 callers
Function
WithRoot
WithRoot configures the base directory from which template files are loaded.
mold.go:112
↓ 3 callers
Function
processTree
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 callers
Method
update
(val T)
engine.go:317
↓ 2 callers
Function
HideFS
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 callers
Method
Open
Open implements fs.FS.
mold.go:165
↓ 2 callers
Function
getActionArgs
(cmd *parse.CommandNode)
process.go:128
↓ 2 callers
Function
parsePartial
(partial *templateFile)
engine.go:243
↓ 2 callers
Function
pos
(body string, pos int)
process.go:157
↓ 2 callers
Function
readFile
(fsys fs.FS, name string)
engine.go:248
↓ 2 callers
Function
validateLayoutFile
(exts []string, name string)
engine.go:272
↓ 1 callers
Function
WithExt
WithExt configures the filename extensions for the templates. Only files with the specified extensions would be parsed. Default: [".html", ".gohtml"
mold.go:125
↓ 1 callers
Function
WithFuncMap
WithFuncMap configures the custom Go template functions.
mold.go:130
↓ 1 callers
Function
invalidFuncType
(typ templateType, funcName string)
process.go:117
↓ 1 callers
Function
newEngine
(fsys fs.FS, options ...Option)
engine.go:27
↓ 1 callers
Function
parseLayout
(root templateSet, layoutRaw string, funcMap template.FuncMap)
engine.go:168
↓ 1 callers
Function
parseView
(set templateSet, layout *templateFile, name string)
engine.go:206
↓ 1 callers
Function
placeholderFuncs
()
engine.go:286
↓ 1 callers
Function
processActionNode
(root *templateFile, parent *parse.ListNode, index int, node parse.Node, funcName string)
process.go:68
↓ 1 callers
Function
processNode
(root *templateFile, parent *parse.ListNode, index int, node parse.Node)
process.go:22
↓ 1 callers
Function
setup
(c *Config, options ...Option)
engine.go:121
↓ 1 callers
Function
walk
(fsys fs.FS, exts []string, funcMap template.FuncMap)
engine.go:75
Method
Error
()
process.go:153
Method
Render
Render implements Layout.
engine.go:62
Function
TestHideFS_Allowed
(t *testing.T)
mold_test.go:308
Function
TestHideFS_Hidden
(t *testing.T)
mold_test.go:299
Function
TestNew
(t *testing.T)
mold_test.go:32
Function
TestNew_CyclicReferenceError
(t *testing.T)
mold_test.go:98
Function
TestNew_Ext
(t *testing.T)
mold_test.go:106
Function
TestNew_FuncMap
(t *testing.T)
mold_test.go:135
Function
TestNew_InvalidSub
(t *testing.T)
mold_test.go:48
Function
TestNew_LayoutInvalidExt
(t *testing.T)
mold_test.go:82
Function
TestNew_LayoutNotFound
(t *testing.T)
mold_test.go:66
Function
TestNew_LayoutParseError
(t *testing.T)
mold_test.go:74
Function
TestNew_Panic
(t *testing.T)
mold_test.go:55
Function
TestNew_Sub
(t *testing.T)
mold_test.go:43
Function
TestNew_ViewParseError
(t *testing.T)
mold_test.go:90
Function
TestPos
(t *testing.T)
process_test.go:8
Function
TestRender
(t *testing.T)
mold_test.go:170
Function
TestRender_InvalidData
(t *testing.T)
mold_test.go:223
Function
TestRender_LayoutPartialNotFound
(t *testing.T)
mold_test.go:207
Function
TestRender_PartialInvalidPartial
(t *testing.T)
mold_test.go:255
Function
TestRender_PartialInvalidRender
(t *testing.T)
mold_test.go:244
Function
TestRender_TemplateIf
(t *testing.T)
mold_test.go:266
Function
TestRender_TemplateRange
(t *testing.T)
mold_test.go:288
Function
TestRender_TemplateWith
(t *testing.T)
mold_test.go:277
Function
TestRender_ViewInvalidRender
(t *testing.T)
mold_test.go:234
Function
TestRender_ViewNotFound
(t *testing.T)
mold_test.go:193
Function
TestRender_ViewPartialNotFound
(t *testing.T)
mold_test.go:215
Function
TestValidExt
(t *testing.T)
engine_test.go:8
Function
handleIndex
(w http.ResponseWriter, r *http.Request)
examples/2_custom_layout/main.go:25
Function
handleNoScript
(w http.ResponseWriter, r *http.Request)
examples/2_custom_layout/main.go:29
Function
handler
(w http.ResponseWriter, r *http.Request)
examples/1_default_layout/main.go:24
Function
main
()
examples/2_custom_layout/main.go:19
Function
main
()
examples/1_default_layout/main.go:16