infer

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: Apache-2.0, Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PathTemplateResult

type PathTemplateResult struct{ Normalized string }

PathTemplateResult wraps the output of TemplatePath/TemplatePathWithConfig: Normalized is the input path with numeric, UUID, and hex segments replaced by the literal placeholder "{id}".

func TemplatePath

func TemplatePath(p string) PathTemplateResult

TemplatePath replaces numeric/uuid/hex path segments with {id}

func TemplatePathWithConfig

func TemplatePathWithConfig(p string, cfg PathTemplatingConfig) PathTemplateResult

TemplatePathWithConfig splits p on "/" and replaces each non-empty segment that is purely numeric, or that matches cfg.UUIDPattern or cfg.HexPattern (whichever are non-nil), with the literal placeholder "{id}". It is the configurable form behind TemplatePath, letting callers supply their own UUID/hex detection patterns (or disable one by passing nil).

type PathTemplatingConfig

type PathTemplatingConfig struct {
	UUIDPattern *regexp.Regexp
	HexPattern  *regexp.Regexp
}

PathTemplatingConfig selects the regular expressions TemplatePathWithConfig uses to recognize UUID- and hex-shaped path segments (in addition to the always-checked purely-numeric case). Either field may be nil to skip that detection; TemplatePath uses the package defaults (defaultUUID/defaultHex).

type Result

type Result struct {
	OpenAPI     string
	WSManifest  string
	GraphQLSDL  string
	GRPCCatalog string
}

Result holds the artifacts Compute infers from a batch of captured events: an OpenAPI 3.1 YAML document (OpenAPI), an "x-websocket-events" YAML manifest (WSManifest), a GraphQL SDL fragment (GraphQLSDL), and a JSON gRPC service catalog (GRPCCatalog). Each field is independently deterministic for a given input event set.

func Compute

func Compute(evs []model.Event) Result

Compute placeholder to avoid import cycles; real exporters invoked from CLI.

Jump to

Keyboard shortcuts

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