Documentation
¶
Overview ¶
Package handlers provides HTTP request handlers and utilities for the web server.
Index ¶
- func BuildGitAuthConfig(r *http.Request) *domain.GitAuthConfig
- func ConvertGitAuthConfig(auth *domain.GitAuthConfig) *projectcomponent.GitAuthConfig
- func ConvertProjectToView(p *domain.Project) projectcomponent.ProjectView
- func ConvertProjectsToViews(projects []*domain.Project) []projectcomponent.ProjectView
- func GetVersion() string
- func HandleHTMLContent(htmlFunc func(uuid.UUID) (string, error)) http.HandlerFunc
- func HandleModal(modalFunc func(uuid.UUID) (templ.Component, error), operation string) http.HandlerFunc
- func HandleProjectAction(actionFunc func(*http.Request) error, successTrigger, operation string) http.HandlerFunc
- func HandleStream(streamFunc func(uuid.UUID, chan<- docker.StreamMessage) error, ...) http.HandlerFunc
- func LogOperationError(operation, layer string, err error, fields ...any)
- func ParseProjectID(r *http.Request) (uuid.UUID, error)
- func RenderComponent(w http.ResponseWriter, r *http.Request, component templ.Component, ...) error
- func SetupSSE(w http.ResponseWriter)
- func StreamOutput(w http.ResponseWriter, outputChan <-chan docker.StreamMessage, ...) error
- func WithFormParsing(next http.HandlerFunc) http.HandlerFunc
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 ¶
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 ¶
LogOperationError logs errors with consistent structure
func ParseProjectID ¶
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 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.