Documentation ¶
Index ¶
- func NewHandlers(r *Repository)
- type Repository
- func (m *Repository) About(w http.ResponseWriter, r *http.Request)
- func (m *Repository) BookBungalow(w http.ResponseWriter, r *http.Request)
- func (m *Repository) ChooseBungalow(w http.ResponseWriter, r *http.Request)
- func (m *Repository) Contact(w http.ResponseWriter, r *http.Request)
- func (m *Repository) Couple(w http.ResponseWriter, r *http.Request)
- func (m *Repository) Eremite(w http.ResponseWriter, r *http.Request)
- func (m *Repository) Family(w http.ResponseWriter, r *http.Request)
- func (m *Repository) Home(w http.ResponseWriter, r *http.Request)
- func (m *Repository) MakeReservation(w http.ResponseWriter, r *http.Request)
- func (m *Repository) PostMakeReservation(w http.ResponseWriter, r *http.Request)
- func (m *Repository) PostReservation(w http.ResponseWriter, r *http.Request)
- func (m *Repository) Reservation(w http.ResponseWriter, r *http.Request)
- func (m *Repository) ReservationJSON(w http.ResponseWriter, r *http.Request)
- func (m *Repository) ReservationOverview(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Repository ¶
type Repository struct { App *config.AppConfig DB repository.DatabaseRepo }
Repository is the repository type
var Repo *Repository
Repo the repository used by the handlers
func NewRepo ¶
func NewRepo(a *config.AppConfig, db *driver.DB) *Repository
NewRepo creates a new repository
func NewTestRepo ¶ added in v1.0.123
func NewTestRepo(a *config.AppConfig) *Repository
NewTestRepo creates a new repository for basic
func (*Repository) About ¶
func (m *Repository) About(w http.ResponseWriter, r *http.Request)
About is the handler for the about page
func (*Repository) BookBungalow ¶ added in v1.0.121
func (m *Repository) BookBungalow(w http.ResponseWriter, r *http.Request)
BookBungalow takes URL parameters from get request, builds a reservation, stores it in a session, and redirects to make-reservation page
func (*Repository) ChooseBungalow ¶ added in v1.0.116
func (m *Repository) ChooseBungalow(w http.ResponseWriter, r *http.Request)
ChooseBungalow displays list of available bungalows and lets the user choose a bungalow
func (*Repository) Contact ¶
func (m *Repository) Contact(w http.ResponseWriter, r *http.Request)
Contact is the handler for the caontact page
func (*Repository) Couple ¶
func (m *Repository) Couple(w http.ResponseWriter, r *http.Request)
Couple is the handler for the couple page
func (*Repository) Eremite ¶
func (m *Repository) Eremite(w http.ResponseWriter, r *http.Request)
Eremite is the handler for the eremite page
func (*Repository) Family ¶
func (m *Repository) Family(w http.ResponseWriter, r *http.Request)
Family is the handler for the family page
func (*Repository) Home ¶
func (m *Repository) Home(w http.ResponseWriter, r *http.Request)
Home is the handler for the home page
func (*Repository) MakeReservation ¶
func (m *Repository) MakeReservation(w http.ResponseWriter, r *http.Request)
MakeReservation is the handler for the make-reservation page
func (*Repository) PostMakeReservation ¶ added in v1.0.66
func (m *Repository) PostMakeReservation(w http.ResponseWriter, r *http.Request)
PostMakeReservation is the POST request handler for the reservation form
func (*Repository) PostReservation ¶
func (m *Repository) PostReservation(w http.ResponseWriter, r *http.Request)
PostReservation is the handler for the reservation page and POST requests
func (*Repository) Reservation ¶
func (m *Repository) Reservation(w http.ResponseWriter, r *http.Request)
Reservation is the handler for the reservation page
func (*Repository) ReservationJSON ¶
func (m *Repository) ReservationJSON(w http.ResponseWriter, r *http.Request)
ReservationJSON is the handler for reservation-json and returns JSON
func (*Repository) ReservationOverview ¶ added in v1.0.70
func (m *Repository) ReservationOverview(w http.ResponseWriter, r *http.Request)
ReservationOverview displays the reservation summary page