websocket

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Options(
	fx.Provide(func(logger *logging.Logger) *Hub {
		return NewHub(logger)
	}),
)

Functions

This section is empty.

Types

type BaseMessage

type BaseMessage struct {
	Type      MessageType `json:"type"`
	Timestamp string      `json:"timestamp"`
}

type Client

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

type ContainerStatusEvent

type ContainerStatusEvent struct {
	BaseMessage
	StackName     string `json:"stack_name"`
	ServiceName   string `json:"service_name"`
	ContainerName string `json:"container_name"`
	ContainerID   string `json:"container_id"`
	Status        string `json:"status"`
	Health        string `json:"health,omitempty"`
	Image         string `json:"image"`
	Ports         []Port `json:"ports,omitempty"`
}

type ErrorEvent

type ErrorEvent struct {
	BaseMessage
	Error   string `json:"error"`
	Context string `json:"context,omitempty"`
}

type Handler

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

func NewHandler

func NewHandler(hub *Hub) *Handler

func (*Handler) HandleAgentWebSocket

func (h *Handler) HandleAgentWebSocket(c echo.Context) error

type Hub

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

func NewHub

func NewHub(logger *logging.Logger) *Hub

func (*Hub) BroadcastContainerStatus

func (h *Hub) BroadcastContainerStatus(event ContainerStatusEvent)

func (*Hub) BroadcastOperationProgress

func (h *Hub) BroadcastOperationProgress(event OperationProgressEvent)

func (*Hub) BroadcastStackStatus

func (h *Hub) BroadcastStackStatus(event StackStatusEvent)

func (*Hub) Run

func (h *Hub) Run()

func (*Hub) ServeWebSocket

func (h *Hub) ServeWebSocket(c echo.Context) error

type MessageType

type MessageType string
const (
	MessageTypeContainerStatus   MessageType = "container_status"
	MessageTypeStackStatus       MessageType = "stack_status"
	MessageTypeOperationProgress MessageType = "operation_progress"
	MessageTypeError             MessageType = "error"
	MessageTypeTerminalOutput    MessageType = "terminal_output"
	MessageTypeTerminalResize    MessageType = "terminal_resize"
	MessageTypeTerminalInput     MessageType = "terminal_input"
	MessageTypeTerminalClose     MessageType = "terminal_close"
)

type OperationProgressEvent

type OperationProgressEvent struct {
	BaseMessage
	StackName    string `json:"stack_name"`
	Operation    string `json:"operation"`
	RawOutput    string `json:"raw_output"`
	ProgressStep string `json:"progress_step,omitempty"`
	ExitCode     int    `json:"exit_code,omitempty"`
	Completed    bool   `json:"completed"`
}

type Port

type Port struct {
	Private int    `json:"private"`
	Public  int    `json:"public,omitempty"`
	Type    string `json:"type"`
}

type StackStatusEvent

type StackStatusEvent struct {
	BaseMessage
	StackName string `json:"stack_name"`
	Status    string `json:"status"`
	Services  int    `json:"services"`
	Running   int    `json:"running"`
	Stopped   int    `json:"stopped"`
}

type TerminalCloseEvent

type TerminalCloseEvent struct {
	BaseMessage
	SessionID string `json:"session_id"`
	ExitCode  int    `json:"exit_code"`
}

type TerminalInputEvent

type TerminalInputEvent struct {
	BaseMessage
	SessionID string `json:"session_id"`
	Input     []byte `json:"input"`
}

type TerminalOutputEvent

type TerminalOutputEvent struct {
	BaseMessage
	SessionID string `json:"session_id"`
	Output    []byte `json:"output"`
}

type TerminalResizeEvent

type TerminalResizeEvent struct {
	BaseMessage
	SessionID string `json:"session_id"`
	Cols      int    `json:"cols"`
	Rows      int    `json:"rows"`
}

Jump to

Keyboard shortcuts

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