Documentation ¶
Index ¶
- Constants
- type Gallery
- func (g *Gallery) Create(w http.ResponseWriter, r *http.Request)
- func (g *Gallery) Delete(w http.ResponseWriter, r *http.Request)
- func (g *Gallery) Edit(w http.ResponseWriter, r *http.Request)
- func (g *Gallery) Show(w http.ResponseWriter, r *http.Request)
- func (g *Gallery) Update(w http.ResponseWriter, r *http.Request)
- type GalleryForm
- type LoginForm
- type SignupForm
- type Static
- type User
Constants ¶
View Source
const (
ShowGallery = "show_gallery"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gallery ¶
type Gallery struct { NewView *view.View ShowView *view.View EditView *view.View // contains filtered or unexported fields }
Gallery controller for all related resources
func NewGallery ¶
func NewGallery(gs model.GalleryService, r *mux.Router) *Gallery
NewGallery instantiates a new controller for the gallery resource
func (*Gallery) Create ¶
func (g *Gallery) Create(w http.ResponseWriter, r *http.Request)
Create parses the form body and create an new gallery
func (*Gallery) Delete ¶
func (g *Gallery) Delete(w http.ResponseWriter, r *http.Request)
Delete a gallery resource: POST /gallery/:id/delete
func (*Gallery) Edit ¶
func (g *Gallery) Edit(w http.ResponseWriter, r *http.Request)
Edit a users gallery
type GalleryForm ¶
type GalleryForm struct {
Title string `schema:"title"`
}
GalleryForm represents the data parsed from the form body
type SignupForm ¶
type SignupForm struct { Name string `schema:"name"` Email string `schema:"email"` Password string `schema:"password"` }
SignupForm captures user input from the sign up forms
type User ¶
type User struct { NewView *view.View LoginView *view.View // contains filtered or unexported fields }
User represents a user in our application
func NewUser ¶
func NewUser(us model.UserService) *User
NewUser instantiates and returns a *User type
func (*User) CookieTest ¶
func (u *User) CookieTest(w http.ResponseWriter, r *http.Request)
CookieTest is a debug route for cookies
func (*User) Create ¶
func (u *User) Create(w http.ResponseWriter, r *http.Request)
Create a new user by handling the request with form data
Click to show internal directories.
Click to hide internal directories.