Documentation ¶
Index ¶
- Variables
- func Assets(ctx mojito.Context) error
- func HandleAssets() error
- func HandleAssetsOn(path string) error
- func PermanentRedirect(url string) func(ctx mojito.Context)
- func Redirect(url string) func(ctx mojito.Context)
- func View(view string) func(ctx mojito.RendererContext) error
- func ViewWithBag(view string, callback func(bag renderer.ViewBag)) func(ctx mojito.RendererContext) error
Constants ¶
This section is empty.
Variables ¶
var ( // AssetsPrefix is a prefix that is appended to the ResourcesDir to get the base path for all assets // This is used by the provided AssetsHandler implementation to serve files from AssetsPrefix = "/assets/" )
Functions ¶
func Assets ¶
Assets will return a handler that can serve assets on a given path. AssetsHandler will look for the assets as ResourcesDir + AssetsPrefix on the file system. The path provided must be the same path as registered on the router. Make sure the path you register this handler on ends with the wildcard route parameter "path"! Example: "/assets/*path"
func HandleAssets ¶
func HandleAssets() error
HandleAssets will register the AssetsHandler on the default router
func HandleAssetsOn ¶
HandleAssetsOnPath will register the AssetsHandler on the default router and a given path with the correct route param suffix
func PermanentRedirect ¶
PermanentRedirect will take incoming requests and redirect them to the given URL with a 301 - Permanently moved status code
func Redirect ¶
Redirect will take incoming requests and redirect them to the given URL with a 302 - Temporarily moved status code
func View ¶
func View(view string) func(ctx mojito.RendererContext) error
View will server a given template using the default rendering engine without any view bag contents
func ViewWithBag ¶
func ViewWithBag(view string, callback func(bag renderer.ViewBag)) func(ctx mojito.RendererContext) error
View will server a given template using the default rendering engine and provides the option to modify the viewbag in a callback function
Types ¶
This section is empty.