webui

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SSEBroker

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

SSEBroker manages Server-Sent Events connections and broadcasts.

func NewSSEBroker

func NewSSEBroker() *SSEBroker

NewSSEBroker creates a new SSE broker instance.

func (*SSEBroker) Broadcast

func (b *SSEBroker) Broadcast(message []byte)

Broadcast sends a message to all connected clients.

func (*SSEBroker) ClientCount

func (b *SSEBroker) ClientCount() int

ClientCount returns the number of connected clients.

func (*SSEBroker) ServeHTTP

func (b *SSEBroker) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP handles SSE connection requests.

func (*SSEBroker) Start

func (b *SSEBroker) Start(ctx context.Context)

Start starts the SSE broker event loop.

type SSEClient

type SSEClient struct {
	ID       string
	Messages chan []byte
}

SSEClient represents a connected SSE client.

type Server

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

Server represents the Web UI HTTP server.

func NewServer

func NewServer(k8sClient client.Client, namespace string, bindAddress string, apiHandler http.Handler) *Server

NewServer creates a new Web UI server instance. apiHandler is optional - if provided, it will be mounted at /api/v1/.

func (*Server) GetSSEBroker

func (s *Server) GetSSEBroker() *SSEBroker

GetSSEBroker returns the SSE broker for testing.

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start starts the Web UI HTTP server in a goroutine.

Directories

Path Synopsis
templ: version: v0.3.960
templ: version: v0.3.960

Jump to

Keyboard shortcuts

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