api

package
v1.15.3 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: BSD-3-Clause Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWebSocketHandler

func NewWebSocketHandler(
	group *gin.RouterGroup,
	projectService *services.ProjectService,
	containerService *services.ContainerService,
	systemService *services.SystemService,
	authMiddleware *middleware.AuthMiddleware,
	cfg *config.Config,
)

func RegisterDiagnosticsRoutes

func RegisterDiagnosticsRoutes(group *gin.RouterGroup, authMiddleware *middleware.AuthMiddleware, wsMetrics *WebSocketMetrics)

Types

type DiagnosticsHandler

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

func (*DiagnosticsHandler) WebSocketDiagnostics

func (h *DiagnosticsHandler) WebSocketDiagnostics(c *gin.Context)

type WebSocketHandler

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

WebSocketHandler consolidates all WebSocket and streaming endpoints. REST endpoints are handled by Huma handlers.

func (*WebSocketHandler) ContainerExec

func (h *WebSocketHandler) ContainerExec(c *gin.Context)

ContainerExec provides interactive terminal access to a container.

@Summary		Execute command in container via WebSocket
@Description	Interactive terminal access to a container over WebSocket
@Tags			WebSocket
@Param			id			path	string	true	"Environment ID"
@Param			containerId	path	string	true	"Container ID"
@Param			shell		query	string	false	"Shell to execute"	default(/bin/sh)
@Router			/api/environments/{id}/ws/containers/{containerId}/terminal [get]

func (*WebSocketHandler) ContainerLogs

func (h *WebSocketHandler) ContainerLogs(c *gin.Context)

ContainerLogs streams container logs over WebSocket.

@Summary		Get container logs via WebSocket
@Description	Stream container logs over WebSocket connection
@Tags			WebSocket
@Param			id			path	string	true	"Environment ID"
@Param			containerId	path	string	true	"Container ID"
@Param			follow		query	bool	false	"Follow log output"						default(true)
@Param			tail		query	string	false	"Number of lines to show from the end"	default(100)
@Param			since		query	string	false	"Show logs since timestamp"
@Param			timestamps	query	bool	false	"Show timestamps"				default(false)
@Param			format		query	string	false	"Output format (text or json)"	default(text)
@Param			batched		query	bool	false	"Batch log messages"			default(false)
@Router			/api/environments/{id}/ws/containers/{containerId}/logs [get]

func (*WebSocketHandler) ContainerStats

func (h *WebSocketHandler) ContainerStats(c *gin.Context)

ContainerStats streams container stats over WebSocket.

@Summary		Get container stats via WebSocket
@Description	Stream container resource statistics over WebSocket connection
@Tags			WebSocket
@Param			id			path	string	true	"Environment ID"
@Param			containerId	path	string	true	"Container ID"
@Router			/api/environments/{id}/ws/containers/{containerId}/stats [get]

func (*WebSocketHandler) ProjectLogs

func (h *WebSocketHandler) ProjectLogs(c *gin.Context)

ProjectLogs streams project logs over WebSocket.

@Summary		Get project logs via WebSocket
@Description	Stream project logs over WebSocket connection
@Tags			WebSocket
@Param			id			path	string	true	"Environment ID"
@Param			projectId	path	string	true	"Project ID"
@Param			follow		query	bool	false	"Follow log output"						default(true)
@Param			tail		query	string	false	"Number of lines to show from the end"	default(100)
@Param			since		query	string	false	"Show logs since timestamp"
@Param			timestamps	query	bool	false	"Show timestamps"				default(false)
@Param			format		query	string	false	"Output format (text or json)"	default(text)
@Param			batched		query	bool	false	"Batch log messages"			default(false)
@Router			/api/environments/{id}/ws/projects/{projectId}/logs [get]

func (*WebSocketHandler) SystemStats

func (h *WebSocketHandler) SystemStats(c *gin.Context)

SystemStats streams system stats over WebSocket.

@Summary		Get system stats via WebSocket
@Description	Stream system resource statistics over WebSocket connection
@Tags			WebSocket
@Param			id	path	string	true	"Environment ID"
@Router			/api/environments/{id}/ws/system/stats [get]

type WebSocketMetrics

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

WebSocketMetrics tracks active WebSocket connections and their counts.

func DefaultWebSocketMetrics

func DefaultWebSocketMetrics() *WebSocketMetrics

DefaultWebSocketMetrics returns the package-level WebSocketMetrics singleton.

func NewWebSocketMetrics

func NewWebSocketMetrics() *WebSocketMetrics

NewWebSocketMetrics creates a new WebSocketMetrics instance.

func (*WebSocketMetrics) Connections

Connections returns a snapshot of all tracked WebSocket connections.

func (*WebSocketMetrics) RegisterConnection

func (m *WebSocketMetrics) RegisterConnection(info systemtypes.WebSocketConnectionInfo) string

RegisterConnection adds a connection to the tracker and increments the appropriate kind counter. Returns the assigned connection ID.

func (*WebSocketMetrics) Snapshot

Snapshot returns a point-in-time copy of the active connection counts.

func (*WebSocketMetrics) UnregisterConnection

func (m *WebSocketMetrics) UnregisterConnection(id string)

UnregisterConnection removes a connection from the tracker and decrements the appropriate kind counter.

Jump to

Keyboard shortcuts

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