Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PopulateTemplates ¶
PopulateTemplates loads and parses all of the templates in the templates directory
func Register ¶
func Register(db *sql.DB, authorizer httpauth.Authorizer, authBackend httpauth.AuthBackend, roles map[string]httpauth.Role, templates *template.Template, pinger *pinger.Pinger, version string, cookieKey []byte, secureCookie bool, publicFiles embed.FS)
Register the handlers for a given route.
Types ¶
type CurrentUserGetter ¶
type CurrentUserGetter interface { CurrentUser(rw http.ResponseWriter, req *http.Request) (user httpauth.UserData, e error) Messages(rw http.ResponseWriter, req *http.Request) []string }
CurrentUserGetter gets the current user from the http request
type MockCurrentUserGetter ¶
MockCurrentUserGetter provides the base struct for the methods to mock the httpauth package. The properties on this struct can vary the results returned.
func (MockCurrentUserGetter) CurrentUser ¶
func (m MockCurrentUserGetter) CurrentUser(rw http.ResponseWriter, req *http.Request) (user httpauth.UserData, e error)
CurrentUser is the mock of the CurrentUser method from the httpauth package.
func (MockCurrentUserGetter) Messages ¶
func (m MockCurrentUserGetter) Messages(rw http.ResponseWriter, req *http.Request) []string
Messages is the mock of the Messasges method from the httpauth package.
Click to show internal directories.
Click to hide internal directories.