handler

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package handler provides HTTP handlers for the dehydrated-api-go application. It includes handlers for domain management and configuration operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DomainHandler

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

DomainHandler handles HTTP requests for domain operations

func NewDomainHandler

func NewDomainHandler(service serviceinterface.DomainService) *DomainHandler

NewDomainHandler creates a new DomainHandler instance

func (*DomainHandler) CreateDomain

func (h *DomainHandler) CreateDomain(c *fiber.Ctx) error

@Summary Create a domain @Description Create a new domain entry @Tags domains @Accept json @Produce json @Security BearerAuth @Param request body model.CreateDomainRequest true "Domain creation request" @Success 201 {object} model.DomainResponse @Failure 400 {object} model.DomainResponse "Bad Request - Invalid request body or domain already exists" @Failure 401 {object} model.DomainResponse "Unauthorized - Invalid or missing authentication token" @Router /api/v1/domains [post] CreateDomain handles POST /api/v1/domains

func (*DomainHandler) DeleteDomain

func (h *DomainHandler) DeleteDomain(c *fiber.Ctx) error

@Summary Delete a domain @Description Delete a domain entry @Tags domains @Accept json @Produce json @Security BearerAuth @Param domain path string true "Domain name" @Success 204 "No Content" @Failure 400 {object} model.DomainResponse "Bad Request - Invalid domain parameter" @Failure 401 {object} model.DomainResponse "Unauthorized - Invalid or missing authentication token" @Failure 404 {object} model.DomainResponse "Not Found - Domain not found" @Router /api/v1/domains/{domain} [delete] DeleteDomain handles DELETE /api/v1/domains/:domain

func (*DomainHandler) GetDomain

func (h *DomainHandler) GetDomain(c *fiber.Ctx) error

@Summary Get a domain @Description Get details of a specific domain @Tags domains @Accept json @Produce json @Security BearerAuth @Param domain path string true "Domain name" @Success 200 {object} model.DomainResponse @Failure 400 {object} model.DomainResponse "Bad Request - Invalid domain parameter" @Failure 401 {object} model.DomainResponse "Unauthorized - Invalid or missing authentication token" @Failure 404 {object} model.DomainResponse "Not Found - Domain not found" @Router /api/v1/domains/{domain} [get] GetDomain handles GET /api/v1/domains/:domain

func (*DomainHandler) ListDomains

func (h *DomainHandler) ListDomains(c *fiber.Ctx) error

@Summary List all domains @Description Get a list of all configured domains @Tags domains @Accept json @Produce json @Security BearerAuth @Success 200 {object} model.DomainsResponse @Failure 401 {object} model.DomainsResponse "Unauthorized - Invalid or missing authentication token" @Failure 500 {object} model.DomainsResponse "Internal Server Error" @Router /api/v1/domains [get] ListDomains handles GET /api/v1/domains

func (*DomainHandler) RegisterRoutes

func (h *DomainHandler) RegisterRoutes(app fiber.Router)

RegisterRoutes registers all domain-related routes

func (*DomainHandler) UpdateDomain

func (h *DomainHandler) UpdateDomain(c *fiber.Ctx) error

@Summary Update a domain @Description Update an existing domain entry @Tags domains @Accept json @Produce json @Security BearerAuth @Param domain path string true "Domain name" @Param request body model.UpdateDomainRequest true "Domain update request" @Success 200 {object} model.DomainResponse @Failure 400 {object} model.DomainResponse "Bad Request - Invalid request body or domain parameter" @Failure 401 {object} model.DomainResponse "Unauthorized - Invalid or missing authentication token" @Failure 404 {object} model.DomainResponse "Not Found - Domain not found" @Router /api/v1/domains/{domain} [put] UpdateDomain handles PUT /api/v1/domains/:domain

type HealthHandler

type HealthHandler struct{}

HealthHandler handles HTTP requests for health operations

func NewHealthHandler

func NewHealthHandler() *HealthHandler

NewHealthHandler creates a new HealthHandler instance

func (*HealthHandler) Health

func (h *HealthHandler) Health(c *fiber.Ctx) error

@Summary Health check @Description Check if the API is running and healthy @Tags health @Accept json @Produce json @Success 200 {object} model.DomainsResponse @Router /health [get] Health handles GET /health

func (*HealthHandler) RegisterRoutes

func (h *HealthHandler) RegisterRoutes(app *fiber.App)

RegisterRoutes registers all health-related routes

Jump to

Keyboard shortcuts

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