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

modulegraph

package
v1.20.2 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. * * This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.

* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. * * This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.

* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. * * This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.

Index

Constants

View Source
const (
	ModuleOutcomeResolved   = "resolved"
	ModuleOutcomeUnresolved = "unresolved"
	ModuleOutcomeUnfetched  = "unfetched"
)

Terminal outcomes for ModuleStat. One sample is recorded per unique module identity: a module declared by several callers, or reached again in a deeper frontier, is counted exactly once (K9CODESEC-5303).

Variables

This section is empty.

Functions

This section is empty.

Types

type BudgetEvent added in v1.12.0

type BudgetEvent struct {
	Source       string
	Gate         string
	Limit        string
	Maximum      int64
	Measured     int64
	SheddingRank int
}

type ModuleStat added in v1.16.0

type ModuleStat struct {
	Source      string `json:"source_type"`
	Outcome     string `json:"outcome"`
	Cache       string `json:"cache,omitempty"`
	DurationMS  int64  `json:"duration_ms"`
	FailureCode string `json:"failure_code,omitempty"`
}

ModuleStat is one terminal telemetry sample for a unique remote module identity. Source carries the resolver origin (registry, git, git_http, git_local, prefetched, ...) and never the raw module source; FailureCode carries the bounded resolver.ClassifyFailure taxonomy, never error text.

type Request

type Request struct {
	RootPaths       []string
	DiscoveryPaths  []string
	Resolver        resolver.Resolver
	MaxDepth        int
	ResourceLimits  resolver.ResourceLimits
	BaselinePaths   []string
	TotalParseBytes int64
	// MaxConfigFileBytes skips module calls in configuration files the scan will
	// not parse (see tfmodules.MaxConfigFileBytesForScan). Zero or negative
	// reads every file.
	MaxConfigFileBytes int64
	FS                 vfs.FS
}

type ResolutionFailure added in v1.13.0

type ResolutionFailure struct {
	CallerRoot        string
	CallerFile        string
	CallerPackageRoot string
	CallerLine        int
	CallerEndLine     int
	Source            string
	Version           string
	Name              string
	Reason            string
}

type ResolvedModule

type ResolvedModule struct {
	CallerRoot        string
	CallerFile        string
	CallerLine        int
	CallerEndLine     int
	Source            string
	Version           string
	ResolvedVersion   string
	ResolvedRef       string
	Name              string
	LocalPath         string
	PackageRoot       string
	ParentPackageRoot string
	Depth             int
	CanonicalSource   string
}

type Result

type Result struct {
	ScanPaths            []string
	Modules              []ResolvedModule
	Stats                []ModuleStat
	Failures             []ResolutionFailure
	SourceMappings       map[string]string
	BudgetEvents         []BudgetEvent
	BaselineParseBytes   int64
	ModuleAdmissionBytes int64
	TimedOut             bool
	Cleanup              func()
}

func Resolve

func Resolve(ctx context.Context, request *Request) Result

Jump to

Keyboard shortcuts

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