dashboard

package
v2.8.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: BSD-3-Clause Imports: 41 Imported by: 0

Documentation

Overview

Package dashboard owns the dashboard snapshot: the service that assembles it from the container, project, image, volume and vulnerability domains, and the HTTP surface that serves it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterDashboard

func RegisterDashboard(api huma.API, dashboardService *DashboardService, environmentService *environment.EnvironmentService)

Types

type DashboardActionItemsOptions

type DashboardActionItemsOptions struct {
	DebugAllGood bool
}

type DashboardHandler

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

func NewHandler

func NewHandler(dashboardService *DashboardService, environmentService *environment.EnvironmentService) *DashboardHandler

NewHandler builds the dashboard HTTP handler. Cross-domain handlers (the multiplexed client stream) compose it rather than reaching into its fields.

func (*DashboardHandler) GetDashboard

func (h *DashboardHandler) GetDashboard(ctx context.Context, input *GetDashboardInput) (*GetDashboardOutput, error)

func (*DashboardHandler) RunLocalStreamProducer

func (h *DashboardHandler) RunLocalStreamProducer(ctx context.Context, debugAllGood bool, events chan<- dashboardtypes.StreamEvent)

func (*DashboardHandler) RunRemoteStreamPollers

func (h *DashboardHandler) RunRemoteStreamPollers(ctx context.Context, ps *authz.PermissionSet, debugAllGood bool, events chan<- dashboardtypes.StreamEvent)

RunRemoteStreamPollers keeps one poller goroutine per enabled remote environment, re-listing periodically so environments added or removed while the stream is open are picked up without a reconnect.

type DashboardService

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

func NewDashboardService

func NewDashboardService(
	db *database.DB,
	dockerService *docker.DockerClientService,
	containerService *container.ContainerService,
	projectService *project.ProjectService,
	imageService *image.ImageService,
	settingsService *settings.SettingsService,
	vulnerabilityService *vulnerability.VulnerabilityService,
	environmentService *environment.EnvironmentService,
	versionService *version.VersionService,
	volumeService *volume.VolumeService,
) *DashboardService

func (*DashboardService) GetSnapshot

func (s *DashboardService) GetSnapshot(ctx context.Context, options DashboardActionItemsOptions, includeTables bool) (*dashboardtypes.Snapshot, error)

GetSnapshot returns the dashboard snapshot, shared across all concurrent consumers (HTTP first paint + every stream subscriber) through a short-TTL cache; the result is a shared pointer and must not be mutated. includeTables controls whether the first-page container/image tables are built: stream subscribers pass false since the all-environments dashboard only reads the aggregate counters, skipping the per-container DTO builds, sorting, and icon resolution entirely.

type Dependencies

Dependencies are the collaborators the dashboard domain needs.

type GetDashboardInput

type GetDashboardInput struct {
	EnvironmentID string `path:"id" doc:"Environment ID"`
	DebugAllGood  bool   `query:"debugAllGood" default:"false" doc:"Debug mode: force an empty action item list"`
}

type GetDashboardOutput

type GetDashboardOutput struct {
	Body base.ApiResponse[dashboardtypes.Snapshot]
}

type Module

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

Module is the dashboard domain's wiring seam: it owns the service and the handler, and mounts the domain's routes.

func New

func New(deps Dependencies) *Module

New builds the dashboard domain from its dependencies.

func (*Module) Handler

func (m *Module) Handler() *DashboardHandler

Handler exposes the dashboard stream producer.

func (*Module) RegisterRoutes

func (m *Module) RegisterRoutes(api huma.API)

RegisterRoutes mounts the dashboard endpoints. A nil module still registers, so OpenAPI spec generation can discover the routes without a service graph.

func (*Module) Service

func (m *Module) Service() *DashboardService

Service exposes the dashboard service to collaborators that compose its producers, such as the multiplexed client stream.

Jump to

Keyboard shortcuts

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