handler

package
v0.0.0-...-cc89513 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthClaims

type AuthClaims struct {
	Role string `json:"role"`
	jwt.RegisteredClaims
}

type ContextKey

type ContextKey string
var (
	RoleCtxKey                       ContextKey = "role"
	SubCtxKey                        ContextKey = "sub"
	MyInfoCtx                        ContextKey = "myInfo"
	UserInfoCtx                      ContextKey = "userInfo"
	ScheduleTemplateMetaCtx          ContextKey = "scheduleTemplateMeta"
	ScheduleTemplateCtx              ContextKey = "scheduleTemplate"
	SchedulePlanCtx                  ContextKey = "schedulePlan"
	LatestSubmissionAvailablePlanCtx ContextKey = "latestSubmissionAvailablePlan"
)

type Handler

type Handler struct {
	Mux *chi.Mux
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(cfg *config.Config, repo *repository.Repository, mailCh *amqp.Channel, rdb *redis.Client) (*Handler, error)

func (*Handler) ConfirmResetPassword

func (h *Handler) ConfirmResetPassword(w http.ResponseWriter, r *http.Request)

func (*Handler) ConfirmUpdateEmail

func (h *Handler) ConfirmUpdateEmail(w http.ResponseWriter, r *http.Request)

func (*Handler) CreateSchedulePlan

func (h *Handler) CreateSchedulePlan(w http.ResponseWriter, r *http.Request)

func (*Handler) CreateScheduleTemplate

func (h *Handler) CreateScheduleTemplate(w http.ResponseWriter, r *http.Request)

func (*Handler) CreateUser

func (h *Handler) CreateUser(w http.ResponseWriter, r *http.Request)

func (*Handler) DeleteSchedulePlan

func (h *Handler) DeleteSchedulePlan(w http.ResponseWriter, r *http.Request)

func (*Handler) DeleteScheduleTemplate

func (h *Handler) DeleteScheduleTemplate(w http.ResponseWriter, r *http.Request)

func (*Handler) DeleteUser

func (h *Handler) DeleteUser(w http.ResponseWriter, r *http.Request)

func (*Handler) GenerateSchedulingResult

func (h *Handler) GenerateSchedulingResult(w http.ResponseWriter, r *http.Request)

func (*Handler) GetAllSchedulePlans

func (h *Handler) GetAllSchedulePlans(w http.ResponseWriter, r *http.Request)

func (*Handler) GetAllScheduleTemplates

func (h *Handler) GetAllScheduleTemplates(w http.ResponseWriter, r *http.Request)

func (*Handler) GetAllUserInfo

func (h *Handler) GetAllUserInfo(w http.ResponseWriter, r *http.Request)

func (*Handler) GetMyInfo

func (h *Handler) GetMyInfo(w http.ResponseWriter, r *http.Request)

func (*Handler) GetSchedulePlanByID

func (h *Handler) GetSchedulePlanByID(w http.ResponseWriter, r *http.Request)

func (*Handler) GetSchedulePlanSubmissions

func (h *Handler) GetSchedulePlanSubmissions(w http.ResponseWriter, r *http.Request)

func (*Handler) GetScheduleTemplate

func (h *Handler) GetScheduleTemplate(w http.ResponseWriter, r *http.Request)

func (*Handler) GetSchedulingResult

func (h *Handler) GetSchedulingResult(w http.ResponseWriter, r *http.Request)

func (*Handler) GetUserInfo

func (h *Handler) GetUserInfo(w http.ResponseWriter, r *http.Request)

func (*Handler) GetYourAvailabilitySubmission

func (h *Handler) GetYourAvailabilitySubmission(w http.ResponseWriter, r *http.Request)

func (*Handler) Login

func (h *Handler) Login(w http.ResponseWriter, r *http.Request)

func (*Handler) Logout

func (h *Handler) Logout(w http.ResponseWriter, r *http.Request)

func (*Handler) RegisterRoutes

func (h *Handler) RegisterRoutes()

func (*Handler) RequireResetPassword

func (h *Handler) RequireResetPassword(w http.ResponseWriter, r *http.Request)

func (*Handler) RequireUpdateEmail

func (h *Handler) RequireUpdateEmail(w http.ResponseWriter, r *http.Request)

func (*Handler) RequiredRole

func (h *Handler) RequiredRole(roles []domain.Role) func(next http.Handler) http.Handler

func (*Handler) SubmitSchedulingResult

func (h *Handler) SubmitSchedulingResult(w http.ResponseWriter, r *http.Request)

func (*Handler) SubmitYourAvailability

func (h *Handler) SubmitYourAvailability(w http.ResponseWriter, r *http.Request)

func (*Handler) UpdateMyPassword

func (h *Handler) UpdateMyPassword(w http.ResponseWriter, r *http.Request)

func (*Handler) UpdateSchedulePlan

func (h *Handler) UpdateSchedulePlan(w http.ResponseWriter, r *http.Request)

func (*Handler) UpdateScheduleTemplate

func (h *Handler) UpdateScheduleTemplate(w http.ResponseWriter, r *http.Request)

func (*Handler) UpdateUser

func (h *Handler) UpdateUser(w http.ResponseWriter, r *http.Request)

func (*Handler) UpdateUserPassword

func (h *Handler) UpdateUserPassword(w http.ResponseWriter, r *http.Request)

type Response

type Response struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
	Data    any    `json:"data"`
}

type ResponseWriter

type ResponseWriter struct {
	http.ResponseWriter
	StatusCode int
}

func (*ResponseWriter) WriteHeader

func (rw *ResponseWriter) WriteHeader(statusCode int)

Jump to

Keyboard shortcuts

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