graphviewer

package
v0.0.232 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package graphviewer exposes a local, read-only HTTP API for navigating a Comanda knowledge graph. Both the browser visualizer and future native clients (such as Canvas) consume this contract.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VisualizationHandler

func VisualizationHandler(open OpenQuerier) (http.Handler, error)

VisualizationHandler serves the interactive browser UI and its API from one localhost origin. The API remains usable independently through NewAPI.

Types

type API

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

API provides the graph navigation contract. Annotation writes are limited to durable human guidance on existing graph nodes; it never exposes files.

func NewAPI

func NewAPI(open OpenQuerier) *API

NewAPI creates a graph navigation API with these endpoints:

GET /api/v1/overview?namespace=<name>
GET /api/v1/graph?namespace=<name>
GET /api/v1/search?q=<text>&limit=<n>&namespace=<name>
GET /api/v1/query?question=<text>&namespace=<name>
GET /api/v1/neighbors?focus=<node-id-or-name>&limit=<n>&offset=<n>&namespace=<name>
GET /api/v1/subgraph?focus=<node-id-or-name>&depth=1..3&namespace=<name>

func (*API) ServeHTTP

func (a *API) ServeHTTP(w http.ResponseWriter, r *http.Request)

type OpenQuerier

type OpenQuerier func(context.Context, string) (*knowledgegraph.Querier, func() error, error)

OpenQuerier opens a read-only graph query session for namespace. A blank namespace asks the caller to select its default graph.

Jump to

Keyboard shortcuts

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