handlers

package
v0.0.0-...-a6ba8f7 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package handlers provides HTTP request handlers and utilities for the web server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildGitAuthConfig

func BuildGitAuthConfig(r *http.Request) *domain.GitAuthConfig

BuildGitAuthConfig creates GitAuthConfig from form values

func ConvertGitAuthConfig

func ConvertGitAuthConfig(auth *domain.GitAuthConfig) *projectcomponent.GitAuthConfig

ConvertGitAuthConfig converts backend GitAuthConfig to frontend GitAuthConfig

func ConvertProjectToView

func ConvertProjectToView(p *domain.Project) projectcomponent.ProjectView

ConvertProjectToView converts a backend Project to frontend ProjectView

func ConvertProjectsToViews

func ConvertProjectsToViews(projects []*domain.Project) []projectcomponent.ProjectView

ConvertProjectsToViews converts backend projects to frontend ProjectView

func GetVersion

func GetVersion() string

GetVersion returns the server version for use in templates

func HandleHTMLContent

func HandleHTMLContent(htmlFunc func(uuid.UUID) (string, error)) http.HandlerFunc

HandleHTMLContent creates a generic handler for HTML content endpoints

func HandleModal

func HandleModal(modalFunc func(uuid.UUID) (templ.Component, error), operation string) http.HandlerFunc

HandleModal creates a generic handler for modal endpoints

func HandleProjectAction

func HandleProjectAction(actionFunc func(*http.Request) error, successTrigger, operation string) http.HandlerFunc

HandleProjectAction creates a generic handler for project actions (create/update/delete)

func HandleStream

func HandleStream(streamFunc func(uuid.UUID, chan<- docker.StreamMessage) error, streamType string) http.HandlerFunc

HandleStream creates a generic handler for streaming endpoints

func LogOperationError

func LogOperationError(operation, layer string, err error, fields ...any)

LogOperationError logs errors with consistent structure

func ParseProjectID

func ParseProjectID(r *http.Request) (uuid.UUID, error)

ParseProjectID extracts and validates project ID from URL parameters

func RenderComponent

func RenderComponent(w http.ResponseWriter, r *http.Request, component templ.Component, operation string) error

RenderComponent renders a templ component with error handling

func SetupSSE

func SetupSSE(w http.ResponseWriter)

SetupSSE configures Server-Sent Events headers

func StreamOutput

func StreamOutput(w http.ResponseWriter, outputChan <-chan docker.StreamMessage, streamType string) error

StreamOutput handles the streaming of output to SSE clients

func WithFormParsing

func WithFormParsing(next http.HandlerFunc) http.HandlerFunc

WithFormParsing middleware parses form data before calling the next handler

Types

This section is empty.

Jump to

Keyboard shortcuts

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