insight

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package insight is the console-facing InsightService handler: it serves every insight lens (the four VCS-history lenses from one cached git-log scan, plus the run-outcome volatility lens folded in fresh) as the magus.insight.v1alpha1 wire type. It is READ-only and maps types.InsightView to the wire at the boundary - the console service owns assembly and caching, this owns the wire, and types/ stays free of protobuf.

It is the typed replacement for the hand-marshaled JSON GET /api/v1/insight route, which remains mounted for now: that route is documented, so retiring it is its own breaking change.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	handler.Base
	// contains filtered or unexported fields
}

Handler serves GET /api/v1/insight: every insight lens as JSON (types.InsightView) - the four VCS-history lenses (hotspots, affinity, ownership, trend) from one bounded git-log scan cached by the service, plus the run-outcome volatility lens folded in fresh. A service with no workspace yields 503, not 500.

func NewHandler

func NewHandler(src insightSource, log *slog.Logger) *Handler

NewHandler returns the GET /api/v1/insight handler reading from src.

type Service

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

Service implements insightv1alpha1connect.InsightServiceHandler over src.

func NewService

func NewService(src insightSource) *Service

NewService builds the InsightService Connect handler reading from src.

func (*Service) GetInsight

GetInsight returns every lens in one message. A daemon with no workspace cannot scan anything, which is a transient condition of THIS daemon rather than a bad request or a bug, so it maps to CodeUnavailable (the Connect twin of the JSON route's 503) and the client keeps whatever it last rendered.

Jump to

Keyboard shortcuts

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