server

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package server exposes the analyzer as a REST API and a web dashboard.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server serves the dashboard and REST API. Reports are cached briefly so a busy dashboard doesn't hammer the API server.

func New

func New(client *kube.Client, opts analyzer.Options, cacheTTL time.Duration, hist *history.Store) *Server

New returns a Server that analyzes via client, caches reports for cacheTTL, and records each fresh analysis in hist (may be nil to disable history).

func (*Server) EnableFleet added in v0.2.0

func (s *Server) EnableFleet(m *fleet.Manager)

EnableFleet switches the server into fleet mode: the root page becomes the fleet overview and per-cluster routes are served from m. Call before Handler / ListenAndServe.

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler returns the HTTP routes for the dashboard, REST API and health probe.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(addr string) error

ListenAndServe blocks serving HTTP on addr.

Jump to

Keyboard shortcuts

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