Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSessionManager ¶
Types ¶
type CommentHandler ¶
type CommentHandler struct {
// contains filtered or unexported fields
}
func (*CommentHandler) Store ¶
func (h *CommentHandler) Store() http.HandlerFunc
func (*CommentHandler) Vote ¶
func (h *CommentHandler) Vote() http.HandlerFunc
type CreateCommentForm ¶
type CreateCommentForm struct { Content string Errors FormErrors }
func (*CreateCommentForm) Validate ¶
func (f *CreateCommentForm) Validate() bool
type CreatePostForm ¶
type CreatePostForm struct { Title string Content string Errors FormErrors }
func (*CreatePostForm) Validate ¶
func (f *CreatePostForm) Validate() bool
type CreateThreadForm ¶
type CreateThreadForm struct { Title string Description string Errors FormErrors }
func (*CreateThreadForm) Validate ¶
func (f *CreateThreadForm) Validate() bool
type FormErrors ¶
type Handler ¶
type Handler struct { *chi.Mux // contains filtered or unexported fields }
func NewHandler ¶
func (*Handler) Home ¶
func (h *Handler) Home() http.HandlerFunc
type LoginForm ¶
type LoginForm struct { Username string Password string IncorrectCredentials bool Errors FormErrors }
type PostHandler ¶
type PostHandler struct {
// contains filtered or unexported fields
}
func (*PostHandler) Create ¶
func (h *PostHandler) Create() http.HandlerFunc
To handle r.Get("/{id}/new", postHandler.Create())
func (*PostHandler) Show ¶
func (h *PostHandler) Show() http.HandlerFunc
To handle r.Get("/{threadID}/{postID}", postHandler.Show())
func (*PostHandler) Store ¶
func (h *PostHandler) Store() http.HandlerFunc
To handle r.Post("/{id}", postHandler.Store())
func (*PostHandler) Vote ¶
func (h *PostHandler) Vote() http.HandlerFunc
To handle r.Get("/{threadID}/{postID}/vote", postHandler.Vote())
type RegisterForm ¶
type RegisterForm struct { Username string Password string UsernameTaken bool Errors FormErrors }
func (*RegisterForm) Validate ¶
func (f *RegisterForm) Validate() bool
type SessionData ¶
func GetSessionData ¶
func GetSessionData(session *scs.SessionManager, ctx context.Context) SessionData
type ThreadHandler ¶
type ThreadHandler struct {
// contains filtered or unexported fields
}
func (*ThreadHandler) Create ¶
func (h *ThreadHandler) Create() http.HandlerFunc
func (*ThreadHandler) Delete ¶
func (h *ThreadHandler) Delete() http.HandlerFunc
func (*ThreadHandler) List ¶
func (h *ThreadHandler) List() http.HandlerFunc
func (*ThreadHandler) Show ¶
func (h *ThreadHandler) Show() http.HandlerFunc
func (*ThreadHandler) Store ¶
func (h *ThreadHandler) Store() http.HandlerFunc
type UserHandler ¶
type UserHandler struct {
// contains filtered or unexported fields
}
func (*UserHandler) Login ¶
func (h *UserHandler) Login() http.HandlerFunc
To handle h.Get("/login", userHandler.Login())
func (*UserHandler) LoginSubmit ¶
func (h *UserHandler) LoginSubmit() http.HandlerFunc
To handle h.Post("/login", userHandler.LoginSubmit())
func (*UserHandler) Logout ¶
func (h *UserHandler) Logout() http.HandlerFunc
func (*UserHandler) Register ¶
func (h *UserHandler) Register() http.HandlerFunc
To handle h.Get("/register", userHandler.Register())
func (*UserHandler) RegisterSubmit ¶
func (h *UserHandler) RegisterSubmit() http.HandlerFunc
To handle h.Post("/register", userHandler.RegisterSubmit())
Click to show internal directories.
Click to hide internal directories.