Help us shape the future of Go! Take the 2026 Go Developer Survey

dashboard

package
v2.17.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: BSD-3-Clause Imports: 52 Imported by: 0

Documentation

Overview

Package dashboard owns the dashboard snapshot assembled from the container, project, image, volume and vulnerability domains, the HTTP surface that serves it, and local inventory metrics.

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 (*DashboardHandler) RunLocalStreamProducer

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

func (*DashboardHandler) RunRemoteStreamPollers

func (h *DashboardHandler) RunRemoteStreamPollers(ctx context.Context, ps *authz.PermissionSet, debugAllGood bool, events chan<- dashboard.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 *dockerInternal.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,
	podmanService *podman.Service,
) *DashboardService

func (*DashboardService) GetSnapshot

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

GetSnapshot returns a short-TTL cached snapshot shared by all consumers; it must not be mutated. includeTables builds the first-page tables; stream subscribers pass false and read only counters.

func (*DashboardService) ObserveInventory added in v2.16.0

func (s *DashboardService) ObserveInventory(meter metric.Meter) error

ObserveInventory reports the local Docker engine's inventory through arcane.docker.* and arcane.projects gauges.

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"`
	IncludeTables bool   `query:"includeTables" default:"true" doc:"Include the first-page container and image tables"`
}

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(service *DashboardService, environmentService *environment.EnvironmentService) *Module

New wires dashboard routes around an existing service and registers its inventory metrics once.

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