Documentation ¶
Index ¶
- func AuthLogin(w http.ResponseWriter, username, password string, sessions auth.SessionManager, ...) bool
- type AnonUser
- type Attrs
- type AuthUser
- type ErrorHTTP
- type Handle
- type Handler
- type PublicHandle
- type Server
- func (srv *Server) AddPublicRoute(route string, h PublicHandle)
- func (srv *Server) AddUserRoute(route string, h Handle)
- func (srv *Server) Attrs(b map[string]interface{}) map[string]interface{}
- func (srv *Server) Execute(w http.ResponseWriter, name string, data Attrs)
- func (srv *Server) ExecuteLayout(w http.ResponseWriter, name string, d Attrs)
- func (srv *Server) ListenAndServe() error
- func (srv *Server) Login(w http.ResponseWriter, r *http.Request) ServerError
- func (srv *Server) Logout(w http.ResponseWriter, r *http.Request) ServerError
- func (srv *Server) Root(w http.ResponseWriter, r *http.Request, user User) ServerError
- type ServerError
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthLogin ¶
func AuthLogin(w http.ResponseWriter, username, password string, sessions auth.SessionManager, users auth.UserManager, hasher auth.Hasher, c config.CookieConfig) bool
TODO Move to actual auth package
Types ¶
type AnonUser ¶
type AnonUser struct{}
AnonUser is a anonymous user that can never be considered authenticated
func (*AnonUser) IsAuthenticated ¶
IsAuthenticated will always return false for AnonUser instances
type AuthUser ¶
type AuthUser struct {
// contains filtered or unexported fields
}
func (*AuthUser) IsAuthenticated ¶
IsAuthenticated will always return false for AnonUser instances
type Handle ¶
type Handle func(http.ResponseWriter, *http.Request, User) ServerError
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
TODO Ugly, but we want templates and configuration
type PublicHandle ¶
type PublicHandle func(http.ResponseWriter, *http.Request) ServerError
func (PublicHandle) ServeHTTP ¶
func (f PublicHandle) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) AddPublicRoute ¶
func (srv *Server) AddPublicRoute(route string, h PublicHandle)
func (*Server) AddUserRoute ¶
func (*Server) ExecuteLayout ¶
func (srv *Server) ExecuteLayout(w http.ResponseWriter, name string, d Attrs)
func (*Server) ListenAndServe ¶
func (*Server) Login ¶
func (srv *Server) Login(w http.ResponseWriter, r *http.Request) ServerError
func (*Server) Logout ¶
func (srv *Server) Logout(w http.ResponseWriter, r *http.Request) ServerError
func (*Server) Root ¶
func (srv *Server) Root(w http.ResponseWriter, r *http.Request, user User) ServerError
type ServerError ¶
Click to show internal directories.
Click to hide internal directories.