handler

package
v0.0.0-...-0531a73 Latest Latest
Warning

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

Go to latest
Published: May 21, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMovieNotFound = fiber.NewError(fiber.StatusNotFound, "Movie not found")
View Source
var ErrNoShowtimeFound = fiber.NewError(fiber.StatusNotFound, "Showtime not found")

Functions

This section is empty.

Types

type Auth

type Auth struct {
	// contains filtered or unexported fields
}

func NewAuth

func NewAuth(repository *repository.User, secretKey []byte) *Auth

func (*Auth) LoginHandler

func (a *Auth) LoginHandler(c fiber.Ctx) error

func (*Auth) RegisterHandler

func (a *Auth) RegisterHandler(c fiber.Ctx) error

type LoginPayload

type LoginPayload struct {
	Email    string `json:"email" validate:"required,email,max=254"`
	Password string `json:"password" validate:"required,min=8"`
}

type Movie

type Movie struct {
	// contains filtered or unexported fields
}

func NewMovie

func NewMovie(repository *repository.Movie) *Movie

func (*Movie) Create

func (m *Movie) Create(c fiber.Ctx) error

func (*Movie) DeleteById

func (m *Movie) DeleteById(c fiber.Ctx) error

func (*Movie) GetAll

func (m *Movie) GetAll(c fiber.Ctx) error

func (*Movie) GetById

func (m *Movie) GetById(c fiber.Ctx) error

func (*Movie) UpdateById

func (m *Movie) UpdateById(c fiber.Ctx) error

type MoviePayload

type MoviePayload struct {
	Title           string                `form:"title" validate:"required,min=1,max=254"`
	Description     string                `form:"description" validate:"required"`
	ReleaseDate     string                `form:"release_date" validate:"required,datetime=2006-01-02"`
	DurationMinutes int                   `form:"duration_minutes" validate:"required,min=1"`
	Director        string                `form:"director" validate:"required,min=1,max=100"`
	File            *multipart.FileHeader `form:"file" validate:"required"`
	GenreIDs        []int                 `form:"genre_ids" validate:"required,dive,lte=10"`
}

type RegisterPayload

type RegisterPayload struct {
	Name     string `json:"name" validate:"required,max=100"`
	Email    string `json:"email" validate:"required,email,max=254"`
	Password string `json:"password" validate:"required,min=8"`
}

type Reservation

type Reservation struct {
	// contains filtered or unexported fields
}

func NewReservation

func NewReservation(repository *repository.Reservation) *Reservation

func (*Reservation) CancelReservation

func (r *Reservation) CancelReservation(c fiber.Ctx) error

func (*Reservation) Create

func (r *Reservation) Create(c fiber.Ctx) error

func (*Reservation) GetAll

func (r *Reservation) GetAll(c fiber.Ctx) error

func (*Reservation) GetUserRervations

func (r *Reservation) GetUserRervations(c fiber.Ctx) error

type Showtime

type Showtime struct {
	// contains filtered or unexported fields
}

func NewShowtime

func NewShowtime(repository *repository.Showtime) *Showtime

func (*Showtime) Create

func (s *Showtime) Create(c fiber.Ctx) error

func (*Showtime) DeleteById

func (s *Showtime) DeleteById(c fiber.Ctx) error

func (*Showtime) GetAll

func (s *Showtime) GetAll(c fiber.Ctx) error

func (*Showtime) GetById

func (s *Showtime) GetById(c fiber.Ctx) error

func (*Showtime) UpdateById

func (s *Showtime) UpdateById(c fiber.Ctx) error

type TokenResponse

type TokenResponse struct {
	Token string `json:"token"`
}

Jump to

Keyboard shortcuts

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