dashboard

package
v0.21.6 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package dashboard mounts the nexus introspection surface under /__nexus. Ships a Vue dashboard (embedded from ui/dist), a JSON registry listing, and a WebSocket event stream.

Index

Constants

View Source
const Prefix = "/__nexus"

Variables

This section is empty.

Functions

func Mount

func Mount(e *gin.Engine, reg *registry.Registry, bus *trace.Bus, sched *cron.Scheduler, rl ratelimit.Store, ms metrics.Store, cfg Config)

Mount attaches:

GET  /__nexus/config           -> Config JSON
GET  /__nexus/endpoints        -> services + endpoints from the registry
GET  /__nexus/resources        -> resource snapshots (health probed live)
GET  /__nexus/middlewares      -> middleware metadata
GET  /__nexus/crons            -> cron job snapshots (schedule, next/last run, history)
POST /__nexus/crons/:name/trigger -> run a job immediately (manual tick)
POST /__nexus/crons/:name/pause   -> pause scheduled ticks (manual Trigger still works)
POST /__nexus/crons/:name/resume  -> resume scheduled ticks
GET  /__nexus/events           -> WebSocket: backlog (since=N) then live trace events
GET  /__nexus/, /assets/*      -> embedded Vue dashboard

The events endpoint is only mounted if bus != nil. The cron + rate-limit + metrics endpoints are always mounted — their stores just return empty lists when nothing has been registered.

Types

type Config

type Config struct {
	Name       string            `json:"Name"`
	Middleware []gin.HandlerFunc `json:"-"`
	// Deployment is the unit name this binary boots as ("" = monolith).
	// Surfaced over /__nexus/config so the dashboard can render the
	// active deployment, and so peer services in a split deployment
	// can introspect it via federation.
	Deployment string `json:"Deployment,omitempty"`
	// Version is the binary's release tag (defaults to "dev"). Used by
	// generated cross-service clients to detect version skew.
	Version string `json:"Version,omitempty"`
}

Config carries the dashboard's runtime knobs: the brand the client fetches at startup + any gin middleware that should guard the /__nexus surface (auth, permission, allowlist, etc.).

Jump to

Keyboard shortcuts

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