link

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package link recovers inter-service integration edges that a single-process call graph cannot: in a microservice repo, one service exposes a contract (gRPC method, HTTP route, queue topic) and another consumes it over the wire. Every transport reduces to the same shape — a producer emits a key, a consumer references it — so adding a transport (Kafka, NATS, HTTP) is one Extractor, with the stitching core unchanged.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cross

type Cross struct {
	From *ssa.Function
	To   *ssa.Function
	Key  string
	Kind string
}

Cross is a stitched cross-service call: From consumes the key that To exposes.

func Stitch

func Stitch(res *analyzer.Result, extractors []Extractor) []Cross

Stitch matches each outbound link to the inbound links sharing its key, yielding a cross-service edge per (consumer, producer) pair.

type Extractor

type Extractor interface {
	Name() string
	Inbound(res *analyzer.Result) []Link  // contracts this code exposes (server / subscriber)
	Outbound(res *analyzer.Result) []Link // contracts this code consumes (client / publisher)
}

Extractor detects one transport's integration points across the whole module.

func Default

func Default() []Extractor

Default returns the built-in extractors. gRPC first; others are additive.

type Link struct {
	Key  string
	Func *ssa.Function
	Kind string // "grpc" | "http" | "kafka" | ...
}

Link is one keyed integration point: a function that exposes (inbound) or consumes (outbound) a transport key such as "grpc:UserService/GetUser".

Jump to

Keyboard shortcuts

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