Loader System (Registry)
Need just 10 functions or want to create your own? Introducing: the Registry
Introduction
Goals
How to use a registry
// Initialize your sprout handler
handler := sprout.New()
// Add one registry
handler.AddRegistry(ownregistry.NewRegistry())
// Add more than one at the same time
handler.AddRegistries(
ownregistry.NewRegistry(),
// ...
)
// Build your FunctionMap based on your handler
tpl := template.Must(
template.New("base").Funcs(handler.Build()).ParseGlob("*.tmpl"),
)You have too many registries to manage?
How to create a registry
Last updated