Documentation ¶
Index ¶
- func AdminAuthentication(c *fiber.Ctx) error
- func ErrorHandler(ctx *fiber.Ctx, err error) error
- func JWTAuthentication(userStore db.UserStore) fiber.Handler
- type AuthHandler
- type AuthParams
- type AuthResponse
- type BookRoomParams
- type BookingHandler
- type Error
- type HotelHandler
- type HotelQueryParams
- type ResourceResp
- type RoomHandler
- type UserHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdminAuthentication ¶
func AdminAuthentication(c *fiber.Ctx) error
func ErrorHandler ¶
func JWTAuthentication ¶
Types ¶
type AuthHandler ¶
type AuthHandler struct {
// contains filtered or unexported fields
}
func NewAuthHandler ¶
func NewAuthHandler(userStore db.UserStore) *AuthHandler
func (*AuthHandler) HandleAuth ¶
func (h *AuthHandler) HandleAuth(c *fiber.Ctx) error
A handler should only do: - serialization of incoming request - fetch data - call some business logic (or 3rd party lib)k - return data
type AuthParams ¶
type AuthResponse ¶
type BookRoomParams ¶
type BookingHandler ¶
type BookingHandler struct {
// contains filtered or unexported fields
}
func NewBookingHandler ¶
func NewBookingHandler(store *db.Store) *BookingHandler
func (*BookingHandler) HandleCancelBooking ¶
func (h *BookingHandler) HandleCancelBooking(c *fiber.Ctx) error
func (*BookingHandler) HandleGetBooking ¶
func (h *BookingHandler) HandleGetBooking(c *fiber.Ctx) error
func (*BookingHandler) HandleGetBookings ¶
func (h *BookingHandler) HandleGetBookings(c *fiber.Ctx) error
type Error ¶
func ErrBadRequest ¶
func ErrBadRequest() Error
func ErrInvalidID ¶
func ErrInvalidID() Error
func ErrNotFound ¶
func ErrUnAuthorized ¶
func ErrUnAuthorized() Error
type HotelHandler ¶
type HotelHandler struct {
// contains filtered or unexported fields
}
func NewHotelHandler ¶
func NewHotelHandler(store *db.Store) *HotelHandler
func (*HotelHandler) HandleGetHotel ¶
func (h *HotelHandler) HandleGetHotel(c *fiber.Ctx) error
func (*HotelHandler) HandleGetHotels ¶
func (h *HotelHandler) HandleGetHotels(c *fiber.Ctx) error
func (*HotelHandler) HandleGetRooms ¶
func (h *HotelHandler) HandleGetRooms(c *fiber.Ctx) error
type HotelQueryParams ¶
type HotelQueryParams struct { db.Pagination Rating int }
type ResourceResp ¶
type RoomHandler ¶
type RoomHandler struct {
// contains filtered or unexported fields
}
func NewRoomHandler ¶
func NewRoomHandler(store *db.Store) *RoomHandler
func (*RoomHandler) HandleBookRoom ¶
func (h *RoomHandler) HandleBookRoom(c *fiber.Ctx) error
func (*RoomHandler) HandleGetRooms ¶
func (h *RoomHandler) HandleGetRooms(c *fiber.Ctx) error
type UserHandler ¶
type UserHandler struct {
// contains filtered or unexported fields
}
func NewUserHandler ¶
func NewUserHandler(userStore db.UserStore) *UserHandler
func (*UserHandler) HandleDeleteUser ¶
func (h *UserHandler) HandleDeleteUser(c *fiber.Ctx) error
func (*UserHandler) HandleGetUser ¶
func (h *UserHandler) HandleGetUser(c *fiber.Ctx) error
func (*UserHandler) HandleGetUsers ¶
func (h *UserHandler) HandleGetUsers(c *fiber.Ctx) error
func (*UserHandler) HandlePostUser ¶
func (h *UserHandler) HandlePostUser(c *fiber.Ctx) error
func (*UserHandler) HandlePutUser ¶
func (h *UserHandler) HandlePutUser(c *fiber.Ctx) error
Click to show internal directories.
Click to hide internal directories.