graph

package
v0.4.3 Latest Latest
Warning

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

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

Documentation

Overview

Package graph holds the graph surfaces the daemon serves and the magus.graph.v1alpha1 wire mapping behind them: the GET /api/v1/graph route (a bulk subgraph document) and the GraphService RPCs (ranked retrieval - query, resolve, explain, path, stats). Both consume DOMAIN values and map them onto the versioned protobuf; the route encodes as snake_case protojson, wire-compatible with what the browser Graph Explorer already parses. The targets flavor has no proto twin, so it is written as its domain JSON directly (see the handler).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GraphHandler

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

GraphHandler serves GET /api/v1/graph.

Query params (the frozen v1 contract the browser Graph Explorer already speaks):

  • (none) -> the whole knowledge graph
  • ?level=projects -> skeleton: project nodes + project->project edges only
  • ?select=<terms> -> scoped neighborhood (graph export --select semantics)
  • ?flavor=targets -> the describe/target graph (types.TargetGraphOutput)

At most one of flavor/level/select may be set; combinations are rejected. Knowledge-graph flavors are written as magus.graph.v1alpha1 protojson (snake_case, wire-compatible). The targets flavor has no proto twin and is written as its domain JSON. ETag is sha256 of the body; If-None-Match yields a 304. Gzip is applied by the NewGraphHandler wrapper.

func NewGraphHandler

func NewGraphHandler(src graphSource, log *slog.Logger) *GraphHandler

NewGraphHandler returns the GET /api/v1/graph handler reading from src, wrapped so its body is gzip-compressed when the client accepts it.

type Service added in v0.4.0

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

Service implements graphv1alpha1connect.GraphServiceHandler over the workspace knowledge graph. Every RPC is read-only; the daemon mounts it behind the console read bearer.

func NewService added in v0.4.0

func NewService(ws resolver) *Service

NewService builds a GraphService handler reading from ws.

func (*Service) ExplainNode added in v0.4.0

func (*Service) FindAffected added in v0.4.0

func (*Service) FindDependents added in v0.4.0

func (*Service) FindPath added in v0.4.0

func (*Service) GetGraphStats added in v0.4.0

func (*Service) QueryNodes added in v0.4.0

func (*Service) ResolveNodes added in v0.4.0

Jump to

Keyboard shortcuts

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