Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigureTemplates ¶
func ConfigureTemplates(templateFolderUri string)
This function takes a URI and uses that as the base location to parse all of your html templates.
func NewRouter ¶
This will create a new Gorilla Mux router that will call router.Handle and router.Methods on the routeArray variable in this file. It also will set up any global middleware defined through AddGlibalMiddleware
func RegisterGlobalMiddleware ¶
func RegisterGlobalMiddleware(fn mux.MiddlewareFunc)
func RegisterRoute ¶
func RegisterRoute(newRoute Route)
Allows users of the library to add routes to the server. This is done this way to enforce inversion of control. The services should push the routes to the router. The router shouldn't pull the routes from them.
func RenderTemplate ¶
func RenderTemplate(w http.ResponseWriter, template string, model interface{})
This is a handler that will take a template name and appends the .html extention. It will then serve the html template. If you pass a model, it will attempt to use that model to fill out the template when it is parsed.