analyzer

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: Apache-2.0 Imports: 20 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	SeverityError   = core.SeverityError
	SeverityWarning = core.SeverityWarning
)

Variables

This section is empty.

Functions

func ApplyAPISurfaceManifest added in v0.9.0

func ApplyAPISurfaceManifest(report *Report, manifest APISurfaceManifest) error

ApplyAPISurfaceManifest replaces the scanned route set with an explicit public surface. This supports routes created dynamically at runtime and prevents server-only routes or duplicate scanner declarations from leaking into the SDK.

func ApplyContractManifest added in v0.9.0

func ApplyContractManifest(report *Report, manifest ContractManifest) error

ApplyContractManifest merges explicit wire types into analyzed actions. It only fills missing types (or confirms an identical inferred type), never changes action scope or route metadata, and refuses to override NFlow boundary schemas. The operation is atomic: report.Actions is unchanged on error. Action names may appear more than once in the report when one action has multiple route bindings; a manifest entry applies to each binding.

func ContentIsUnmodified

func ContentIsUnmodified(onDisk []byte) bool

func ExcludeFlowPipelines added in v0.2.0

func ExcludeFlowPipelines(report *Report, names []string)

ExcludeFlowPipelines removes named NFlow pipelines and their route-derived action contracts from an analysis report. This is useful when runtime flags conditionally mount a development pipeline that is not part of the default production API surface.

func GenerateTypeScriptAPICompatibilityFacade added in v0.9.0

func GenerateTypeScriptAPICompatibilityFacade(indexImportPath, endpointsImportPath string) []byte

func ReadNFlowSource

func ReadNFlowSource(path string) (string, error)

ReadNFlowSource is an exported helper used by the SDK generation command's integration tests to exercise the exact Flow preprocessing path.

func RenderEnhancedReport

func RenderEnhancedReport(report *Report, actionFilter string) string

func RenderSummaryTable

func RenderSummaryTable(report *Report, actionFilter string) string

func StampContent

func StampContent(content []byte, path string) []byte

Types

type APISurfaceManifest added in v0.9.0

type APISurfaceManifest struct {
	Actions []ActionContract      `json:"actions"`
	Types   []core.APISurfaceType `json:"types,omitempty"`
	Client  *core.APIClientConfig `json:"client,omitempty"`
}

APISurfaceManifest is the complete public HTTP API emitted by `nexssp sdk api`. Its actions use the same wire-contract and metadata fields as analyzer reports.

type ActionContract

type ActionContract = core.ActionContract

type Analyzer

type Analyzer struct {
	*core.Analyzer
	// contains filtered or unexported fields
}

func New

func New() *Analyzer

func (*Analyzer) ScanFlowFiles

func (a *Analyzer) ScanFlowFiles(root string)

type ContractManifest added in v0.9.0

type ContractManifest struct {
	Actions []ContractManifestAction `json:"actions"`
}

ContractManifest describes explicit wire-contract types for actions that the source analyzer cannot fully infer. A nil type means "not specified"; use the literal "struct{}" to explicitly declare an empty request or response.

type ContractManifestAction added in v0.9.0

type ContractManifestAction struct {
	Name       string   `json:"name"`
	ReqType    *string  `json:"req_type,omitempty"`
	ResType    *string  `json:"res_type,omitempty"`
	ReqTypeRef *TypeRef `json:"req_type_ref,omitempty"`
	ResTypeRef *TypeRef `json:"res_type_ref,omitempty"`
}

ContractManifestAction supplies optional request and response types for one action name. Type references are optional disambiguators for Go DTOs.

type DSLConfig

type DSLConfig = core.DSLConfig

type Diagnostic

type Diagnostic = core.Diagnostic

func ValidatePublicAPI added in v0.2.0

func ValidatePublicAPI(report *Report) []Diagnostic

type DiagnosticSeverity

type DiagnosticSeverity = core.DiagnosticSeverity

type EnumDefinition

type EnumDefinition = core.EnumDefinition

type EnumValue

type EnumValue = core.EnumValue

type FieldContract

type FieldContract = core.FieldContract

type FlowHTTPRoute

type FlowHTTPRoute = core.FlowHTTPRoute

type GeneratedFile

type GeneratedFile = core.GeneratedFile

func GenerateTypeScriptAPI added in v0.5.0

func GenerateTypeScriptAPI(report *Report) []GeneratedFile

func GenerateTypeScriptAPISDK added in v0.2.0

func GenerateTypeScriptAPISDK(report *Report) []GeneratedFile

func GenerateTypeScriptSDK

func GenerateTypeScriptSDK(report *Report) []GeneratedFile

type PackageInfo

type PackageInfo = core.PackageInfo

type Report

type Report = core.Report

func Analyze

func Analyze(root string) (*Report, error)

Analyze preserves the existing Flow-aware single-root API.

func AnalyzeAll

func AnalyzeAll(roots ...string) (*Report, error)

AnalyzeAll analyzes Go contracts and merges Flow DSL and NFlow inputs.

type ReportStats

type ReportStats = core.ReportStats

type StoreCluster

type StoreCluster = core.StoreCluster

type StructDefinition

type StructDefinition = core.StructDefinition

type StructKey

type StructKey = core.StructKey

type TransportBinding

type TransportBinding = core.TransportBinding

type TypeRef

type TypeRef = core.TypeRef

Directories

Path Synopsis
Package core analyzes Go AST contracts and generates SDK artifacts without parsing Flow source or embedded DSL manifests.
Package core analyzes Go AST contracts and generates SDK artifacts without parsing Flow source or embedded DSL manifests.
Package dsl contains OPS's compatibility parser for older action-oriented route manifests.
Package dsl contains OPS's compatibility parser for older action-oriented route manifests.

Jump to

Keyboard shortcuts

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