webserver

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WatchHeadersMiddleware

func WatchHeadersMiddleware() gin.HandlerFunc

WatchHeadersMiddleware returns a gin middleware that sets headers for watch requests.

Types

type ClientChan

type ClientChan chan Message

ClientChan represents a channel for sending messages to clients. New event messages are broadcast to all registered client connection channels

type Event

type Event struct {
	// Events are pushed to this channel by the main events-gathering routine
	Message chan Message
	// contains filtered or unexported fields
}

Event represents a server-sent event that can be broadcast to clients. It keeps a list of clients those are currently attached

type Message

type Message struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
	Kind      string `json:"kind"`
	Data      string `json:"data"`
}

Message represents a message that can be sent to clients.

type WebServer

type WebServer struct {
	client.Client
	Scheme *runtime.Scheme
	Event  *Event
}

WebServer handles the web server functionality for the dashboard and API endpoints.

func NewWebServer

func NewWebServer(mgr controllerruntime.Manager) WebServer

NewWebServer creates a new WebServer instance with the given manager.

func (*WebServer) Reconcile

func (ws *WebServer) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile handles the reconciliation logic for the WebServer controller.

func (*WebServer) SetupWithManager

func (ws *WebServer) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the WebServer controller with the given manager.

func (*WebServer) StartDashboard

func (ws *WebServer) StartDashboard(ctx context.Context, addr string) error

StartDashboard starts the dashboard web server on the specified address.

Directories

Path Synopsis
Package ginlogr provides log handling using logr package.
Package ginlogr provides log handling using logr package.

Jump to

Keyboard shortcuts

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