server

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientRequest

type ClientRequest struct {
	Type      string `json:"type"`       // "execute" or "stop"
	SessionID string `json:"session_id"` // Provide session_id to hot-multiplex
	Prompt    string `json:"prompt"`     // The user input (for "execute")
	WorkDir   string `json:"work_dir"`   // Working directory for CLI (for "execute")
	Reason    string `json:"reason"`     // Reason for stopping (for "stop")
}

ClientRequest represents the JSON payload expected from the WebSocket client.

type ServerResponse

type ServerResponse struct {
	Event string `json:"event"`
	Data  any    `json:"data"`
}

ServerResponse represents the JSON payload sent to the WebSocket client.

type WebSocketHandler

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

WebSocketHandler manages a WebSocket connection to a HotPlex Engine.

func NewWebSocketHandler

func NewWebSocketHandler(engine hotplex.HotPlexClient, logger *slog.Logger) *WebSocketHandler

NewWebSocketHandler creates a new handler.

func (*WebSocketHandler) ServeHTTP

func (h *WebSocketHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP upgrades the HTTP connection and starts the read loop.

Jump to

Keyboard shortcuts

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