routes

package
v0.0.0-...-e6b7f3d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(dbConn *gorm.DB, appBox *rice.Box, authService auth.Auth, emailService email.Email) *mux.Router

Setup initialize the routes for the REST API

Types

type AppHandler

type AppHandler struct {
	App           *rice.Box
	IndexFilename string
}

AppHandler for SPA endpoint

func (*AppHandler) Serve

func (a *AppHandler) Serve() http.HandlerFunc

Serve the index file that contains the SPA router, to handle app URL paths

type CourtsHandler

type CourtsHandler struct {
	DB *gorm.DB
}

CourtsHandler for HTTP endpoints

func (*CourtsHandler) Delete

func (c *CourtsHandler) Delete() http.HandlerFunc

Delete endpoint that deletes existing court

func (*CourtsHandler) Get

func (c *CourtsHandler) Get() http.HandlerFunc

Get endpoint that list courts

func (*CourtsHandler) PatchActive

func (c *CourtsHandler) PatchActive() http.HandlerFunc

PatchActive endpoint that activates or deactivate an existing court

func (*CourtsHandler) Post

func (c *CourtsHandler) Post() http.HandlerFunc

Post endpoint that creates a new court

func (*CourtsHandler) Put

func (c *CourtsHandler) Put() http.HandlerFunc

Put endpoint that updates existing court

type ReservationsHandler

type ReservationsHandler struct {
	DB *gorm.DB
}

ReservationsHandler for HTTP endpoints

func (*ReservationsHandler) Get

Get endpoint that list reservations

func (*ReservationsHandler) GetBooked

func (re *ReservationsHandler) GetBooked() http.HandlerFunc

GetBooked endpoint that finds reserved slots for the next 30 days across all courts

func (*ReservationsHandler) GetCourtID

func (re *ReservationsHandler) GetCourtID() http.HandlerFunc

Get endpoint that list reservations

func (*ReservationsHandler) GetStatistics

func (re *ReservationsHandler) GetStatistics() http.HandlerFunc

GetStatistics endpoint that return statistics for reservations

func (*ReservationsHandler) GetUserID

func (re *ReservationsHandler) GetUserID() http.HandlerFunc

Get endpoint that list reservations

func (*ReservationsHandler) Post

Post endpoint that creates a new reservation

type SlotsHandler

type SlotsHandler struct {
	DB *gorm.DB
}

SlotsHandler for HTTP endpoints

func (*SlotsHandler) Get

func (s *SlotsHandler) Get() http.HandlerFunc

Get endpoint that list slots

func (*SlotsHandler) PatchActive

func (s *SlotsHandler) PatchActive() http.HandlerFunc

PatchActive endpoint that activates or deactivate an existing slot

type UsersHandler

type UsersHandler struct {
	DB           *gorm.DB
	AuthService  auth.Auth
	EmailService email.Email
}

UsersHandler for HTTP endpoints

func (*UsersHandler) ConfirmEmail

func (u *UsersHandler) ConfirmEmail() http.HandlerFunc

ConfirmEmail endpoint that handles user email verification

func (*UsersHandler) Get

func (u *UsersHandler) Get() http.HandlerFunc

Get endpoint that list users

func (*UsersHandler) GetID

func (u *UsersHandler) GetID() http.HandlerFunc

Get endpoint that list single user

func (*UsersHandler) GetStatistics

func (u *UsersHandler) GetStatistics() http.HandlerFunc

GetStatistics endpoint that return statistics for users

func (*UsersHandler) Login

func (u *UsersHandler) Login() http.HandlerFunc

Login endpoint that handles user login

func (*UsersHandler) Post

func (u *UsersHandler) Post() http.HandlerFunc

Post endpoint that creates a new user

func (*UsersHandler) PostConfirmEmailResend

func (u *UsersHandler) PostConfirmEmailResend() http.HandlerFunc

PostConfirmEmailResend endpoint that resend a confirmation email to user

func (*UsersHandler) PutEmail

func (u *UsersHandler) PutEmail() http.HandlerFunc

PutEmail endpoint that updates existing user email

func (*UsersHandler) PutInfo

func (u *UsersHandler) PutInfo() http.HandlerFunc

PutInfo endpoint that updates existing user info

func (*UsersHandler) PutPassword

func (u *UsersHandler) PutPassword() http.HandlerFunc

PutPassword endpoint that updates existing user password

func (*UsersHandler) ResetPassword

func (u *UsersHandler) ResetPassword() http.HandlerFunc

ResetPassword endpoint that handles user password reset

func (*UsersHandler) ResetPasswordEmail

func (u *UsersHandler) ResetPasswordEmail() http.HandlerFunc

ResetPasswordEmail endpoint that sends email for reset password

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL