Documentation ¶
Index ¶
- Constants
- func FAQ(tpl Template) http.HandlerFunc
- func StaticHandler(tpl Template) http.HandlerFunc
- type Galleries
- func (g Galleries) Create(w http.ResponseWriter, r *http.Request)
- func (g Galleries) Delete(w http.ResponseWriter, r *http.Request)
- func (g Galleries) Edit(w http.ResponseWriter, r *http.Request)
- func (g Galleries) Index(w http.ResponseWriter, r *http.Request)
- func (g Galleries) New(w http.ResponseWriter, r *http.Request)
- func (g Galleries) Show(w http.ResponseWriter, r *http.Request)
- func (g Galleries) Update(w http.ResponseWriter, r *http.Request)
- type Template
- type UserMiddleware
- type Users
- func (u Users) Create(w http.ResponseWriter, r *http.Request)
- func (u Users) CurrentUser(w http.ResponseWriter, r *http.Request)
- func (u Users) ForgotPassword(w http.ResponseWriter, r *http.Request)
- func (u Users) New(w http.ResponseWriter, r *http.Request)
- func (u Users) ProcessForgotPassword(w http.ResponseWriter, r *http.Request)
- func (u Users) ProcessResetPassword(w http.ResponseWriter, r *http.Request)
- func (u Users) ProcessSignIn(w http.ResponseWriter, r *http.Request)
- func (u Users) ResetPassword(w http.ResponseWriter, r *http.Request)
- func (u Users) SignIn(w http.ResponseWriter, r *http.Request)
- func (u Users) SignOut(w http.ResponseWriter, r *http.Request)
Constants ¶
View Source
const (
CookieSession = "session"
)
Variables ¶
This section is empty.
Functions ¶
func FAQ ¶
func FAQ(tpl Template) http.HandlerFunc
func StaticHandler ¶
func StaticHandler(tpl Template) http.HandlerFunc
Types ¶
type Galleries ¶
type Template ¶
type Template interface {
Execute(w http.ResponseWriter, r *http.Request, data interface{}, errs ...error)
}
type UserMiddleware ¶
type UserMiddleware struct {
SessionService *models.SessionService
}
func (UserMiddleware) RequireUser ¶
func (umw UserMiddleware) RequireUser(next http.Handler) http.Handler
If user found in context, process. Else redirect to signing. Protects access to downstream handlers
type Users ¶
type Users struct { Templates struct { New Template SignIn Template ForgotPassword Template CheckYourEmail Template ResetPassword Template } SessionService *models.SessionService UserService *models.UserService PasswordResetService *models.PasswordResetService EmailService *models.EmailService }
func (Users) Create ¶
func (u Users) Create(w http.ResponseWriter, r *http.Request)
Create new user from registration form
func (Users) CurrentUser ¶
func (u Users) CurrentUser(w http.ResponseWriter, r *http.Request)
Serve current user info
func (Users) ForgotPassword ¶
func (u Users) ForgotPassword(w http.ResponseWriter, r *http.Request)
Serve reset password page
func (Users) New ¶
func (u Users) New(w http.ResponseWriter, r *http.Request)
Serve user registration
func (Users) ProcessForgotPassword ¶
func (u Users) ProcessForgotPassword(w http.ResponseWriter, r *http.Request)
Handle password reset submission
func (Users) ProcessResetPassword ¶
func (u Users) ProcessResetPassword(w http.ResponseWriter, r *http.Request)
func (Users) ProcessSignIn ¶
func (u Users) ProcessSignIn(w http.ResponseWriter, r *http.Request)
Verify user credentials
func (Users) ResetPassword ¶
func (u Users) ResetPassword(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.