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

server

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package server publishes the architecture graph over HTTP for a viewer: the graph as JSON, a stream of change notifications, and the source of the files in the graph. It watches the repositories and rebuilds the graph when a source file or a .metrics snapshot changes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server holds the latest graph and the clients listening for changes.

func New

func New(ctx context.Context, roots []string, ui string, logger *log.Logger, inputs graph.MutationInputs) (*Server, error)

New builds the first graph of roots, under ctx.

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler routes the API and the viewer at /: the one the ui directory holds, else the one the binary was built with. With neither, / says how to get one.

func (*Server) Watch

func (s *Server) Watch(ctx context.Context, interval time.Duration)

Watch rebuilds every interval under ctx until it ends. A failed build keeps the previous graph: a file caught mid-save parses on the next tick. A build ctx's end cuts short is no failure, and is not logged.

Jump to

Keyboard shortcuts

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