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

httplink

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractURLPaths added in v0.1.3

func ExtractURLPaths(text string) []string

ExtractURLPaths finds URL path segments from text (exported for use by pipeline).

Types

type HTTPCallSite

type HTTPCallSite struct {
	Path                string
	Method              string // best-effort: "GET", "POST", etc. or "" if unknown
	SourceName          string
	SourceQualifiedName string
	SourceLabel         string // "Function", "Method", or "Module"
	IsAsync             bool   // true when source uses async dispatch keywords
}

HTTPCallSite represents a discovered HTTP call site.

type HTTPLink struct {
	CallerQN    string
	CallerLabel string
	HandlerQN   string
	URLPath     string
	EdgeType    string // "HTTP_CALLS" or "ASYNC_CALLS"
}

HTTPLink represents a matched HTTP call from caller to handler.

type HTTPLinkerConfig added in v0.1.3

type HTTPLinkerConfig struct {
	// ExcludePaths are route paths to exclude from HTTP_CALLS matching.
	// These are added to (not replacing) the built-in defaultExcludePaths.
	ExcludePaths []string `yaml:"exclude_paths"`

	// MinConfidence is the minimum confidence score for creating HTTP_CALLS edges.
	// Default: 0.25 (includes speculative matches).
	MinConfidence *float64 `yaml:"min_confidence"`

	// FuzzyMatching enables/disables fuzzy URL matching.
	// Default: true.
	FuzzyMatching *bool `yaml:"fuzzy_matching"`
}

HTTPLinkerConfig holds HTTP linker-specific settings.

type Linker

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

Linker discovers cross-service HTTP calls and creates HTTP_CALLS edges.

func New

func New(s *store.Store, project string) *Linker

New creates a new HTTP Linker.

func (*Linker) AddCallSites added in v0.1.3

func (l *Linker) AddCallSites(sites []HTTPCallSite)

AddCallSites allows the pipeline to inject additional call sites from infra files.

func (*Linker) Run

func (l *Linker) Run() ([]HTTPLink, error)

Run executes the HTTP linking pass.

func (*Linker) SetConfig added in v0.1.3

func (l *Linker) SetConfig(cfg *LinkerConfig)

SetConfig sets the linker configuration. If cfg is nil, defaults are used.

type LinkerConfig added in v0.1.3

type LinkerConfig struct {
	HTTPLinker HTTPLinkerConfig `yaml:"http_linker"`
}

LinkerConfig holds user-overridable HTTP linker settings. Loaded from .cgrconfig in the project root.

func DefaultConfig added in v0.1.3

func DefaultConfig() *LinkerConfig

DefaultConfig returns the default linker configuration.

func LoadConfig added in v0.1.3

func LoadConfig(dir string) *LinkerConfig

LoadConfig reads .cgrconfig from the given directory. Returns default config if the file doesn't exist.

func (*LinkerConfig) AllExcludePaths added in v0.1.3

func (c *LinkerConfig) AllExcludePaths() []string

AllExcludePaths returns the combined list of default + user-configured exclude paths.

func (*LinkerConfig) EffectiveFuzzyMatching added in v0.1.3

func (c *LinkerConfig) EffectiveFuzzyMatching() bool

EffectiveFuzzyMatching returns the configured fuzzy matching setting, or the default (true) if not set.

func (*LinkerConfig) EffectiveMinConfidence added in v0.1.3

func (c *LinkerConfig) EffectiveMinConfidence() float64

EffectiveMinConfidence returns the configured minimum confidence, or the default (0.25) if not set.

type RouteHandler

type RouteHandler struct {
	Path              string
	Method            string
	FunctionName      string
	QualifiedName     string
	HandlerRef        string // resolved handler function reference (e.g. "h.CreateOrder")
	ResolvedHandlerQN string // set by createRegistrationCallEdges — actual handler QN
	Protocol          string // "ws", "sse", or "" (standard HTTP)
}

RouteHandler represents a discovered HTTP route handler.

Jump to

Keyboard shortcuts

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