handlers

package
v0.1.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseHandler

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

BaseHandler provides common functionality for all handlers

func NewBaseHandler

func NewBaseHandler(
	authMiddleware *amw.CookieAuthMiddleware,
	formService form.Service,
	logger logging.Logger,
) *BaseHandler

NewBaseHandler creates a new base handler

func (*BaseHandler) LogError

func (h *BaseHandler) LogError(message string, err error)

LogError logs an error with consistent formatting

func (*BaseHandler) SetupMiddleware

func (h *BaseHandler) SetupMiddleware(group *echo.Group)

SetupMiddleware sets up common middleware for a route group

type DashboardHandler

type DashboardHandler struct {
	Base *BaseHandler
	// contains filtered or unexported fields
}

DashboardHandler handles dashboard-related HTTP requests

func NewDashboardHandler

func NewDashboardHandler(
	formService form.Service,
	logger logging.Logger,
	base *BaseHandler,
) *DashboardHandler

NewDashboardHandler creates a new dashboard handler

func (*DashboardHandler) Register

func (h *DashboardHandler) Register(e *echo.Echo)

Register sets up the dashboard routes

func (*DashboardHandler) ShowDashboard

func (h *DashboardHandler) ShowDashboard(c echo.Context) error

ShowDashboard displays the user's dashboard

type FormData

type FormData struct {
	Title       string `json:"title" form:"title" validate:"required"`
	Description string `json:"description" form:"description" validate:"required"`
}

FormData represents the structure for form creation and updates

type FormHandler

type FormHandler struct {
	Base *BaseHandler
	// contains filtered or unexported fields
}

FormHandler handles form-related HTTP requests

func NewFormHandler

func NewFormHandler(
	formService form.Service,
	formOperations *services.FormOperations,
	logger logging.Logger,
	base *BaseHandler,
) *FormHandler

NewFormHandler creates a new form handler

func (*FormHandler) CreateForm

func (h *FormHandler) CreateForm(c echo.Context) error

CreateForm handles form creation

func (*FormHandler) DeleteForm

func (h *FormHandler) DeleteForm(c echo.Context) error

DeleteForm handles form deletion

func (*FormHandler) Register

func (h *FormHandler) Register(e *echo.Echo)

Register sets up the form routes

func (*FormHandler) ShowEditForm

func (h *FormHandler) ShowEditForm(c echo.Context) error

ShowEditForm displays the form editing page

func (*FormHandler) ShowNewForm

func (h *FormHandler) ShowNewForm(c echo.Context) error

ShowNewForm displays the form creation page

func (*FormHandler) UpdateForm

func (h *FormHandler) UpdateForm(c echo.Context) error

UpdateForm handles form updates

type Handler

type Handler struct {
	DashboardHandler  *DashboardHandler
	FormHandler       *FormHandler
	SubmissionHandler *SubmissionHandler
	SchemaHandler     *SchemaHandler
}

Handler handles dashboard-related HTTP requests

func NewHandler

func NewHandler(
	userService user.Service,
	formService form.Service,
	logger logging.Logger,
) (*Handler, error)

NewHandler creates a new dashboard handler

func (*Handler) CreateForm

func (h *Handler) CreateForm(c echo.Context) error

CreateForm handles form creation

func (*Handler) DeleteForm

func (h *Handler) DeleteForm(c echo.Context) error

DeleteForm handles form deletion

func (*Handler) GetFormSchema

func (h *Handler) GetFormSchema(c echo.Context) error

GetFormSchema handles getting a form's schema

func (*Handler) Register

func (h *Handler) Register(e *echo.Echo)

Register sets up the dashboard routes

func (*Handler) ShowDashboard

func (h *Handler) ShowDashboard(c echo.Context) error

ShowDashboard displays the user's dashboard

func (*Handler) ShowEditForm

func (h *Handler) ShowEditForm(c echo.Context) error

ShowEditForm displays the form editing page

func (*Handler) ShowFormSubmissions

func (h *Handler) ShowFormSubmissions(c echo.Context) error

ShowFormSubmissions handles viewing form submissions

func (*Handler) ShowNewForm

func (h *Handler) ShowNewForm(c echo.Context) error

ShowNewForm displays the form creation page

func (*Handler) UpdateForm

func (h *Handler) UpdateForm(c echo.Context) error

UpdateForm handles updating a form's basic details

func (*Handler) UpdateFormSchema

func (h *Handler) UpdateFormSchema(c echo.Context) error

UpdateFormSchema handles updating a form's schema

type SchemaHandler

type SchemaHandler struct {
	Base *BaseHandler
	// contains filtered or unexported fields
}

SchemaHandler handles form schema-related HTTP requests

func NewSchemaHandler

func NewSchemaHandler(
	formService form.Service,
	logger logging.Logger,
	base *BaseHandler,
) *SchemaHandler

NewSchemaHandler creates a new schema handler

func (*SchemaHandler) GetFormSchema

func (h *SchemaHandler) GetFormSchema(c echo.Context) error

GetFormSchema handles getting a form's schema

func (*SchemaHandler) Register

func (h *SchemaHandler) Register(e *echo.Echo)

Register sets up the schema routes

func (*SchemaHandler) UpdateFormSchema

func (h *SchemaHandler) UpdateFormSchema(c echo.Context) error

UpdateFormSchema handles updating a form's schema

type SubmissionHandler

type SubmissionHandler struct {
	Base *BaseHandler
	// contains filtered or unexported fields
}

SubmissionHandler handles form submission-related HTTP requests

func NewSubmissionHandler

func NewSubmissionHandler(
	formService form.Service,
	logger logging.Logger,
	base *BaseHandler,
) *SubmissionHandler

NewSubmissionHandler creates a new submission handler

func (*SubmissionHandler) Register

func (h *SubmissionHandler) Register(e *echo.Echo)

Register sets up the submission routes

func (*SubmissionHandler) ShowFormSubmissions

func (h *SubmissionHandler) ShowFormSubmissions(c echo.Context) error

ShowFormSubmissions handles viewing form submissions

Jump to

Keyboard shortcuts

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