loader

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 29 Imported by: 0 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 ModeEnvVar = "WIRE_LOADER_MODE"

Variables

This section is empty.

Functions

func WithTiming

func WithTiming(ctx context.Context, logf func(string, time.Duration)) context.Context

Types

type DiscoverySnapshot

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

type FallbackReason

type FallbackReason string
const (
	FallbackReasonNone                 FallbackReason = ""
	FallbackReasonForcedFallback       FallbackReason = "forced_fallback"
	FallbackReasonCustomNotImplemented FallbackReason = "custom_not_implemented"
	FallbackReasonCustomUnsupported    FallbackReason = "custom_unsupported"
)

type LazyLoadRequest

type LazyLoadRequest struct {
	WD         string
	Env        []string
	Tags       string
	Package    string
	Mode       packages.LoadMode
	LoaderMode Mode
	Fset       *token.FileSet
	ParseFile  ParseFileFunc
	Discovery  *DiscoverySnapshot
}

type LazyLoadResult

type LazyLoadResult struct {
	Packages       []*packages.Package
	Backend        Mode
	FallbackReason FallbackReason
	FallbackDetail string
}

type Loader

type Loader interface {
	LoadPackages(context.Context, PackageLoadRequest) (*PackageLoadResult, error)
	LoadRootGraph(context.Context, RootLoadRequest) (*RootLoadResult, error)
	LoadTypedPackageGraph(context.Context, LazyLoadRequest) (*LazyLoadResult, error)
	ValidateTouchedPackages(context.Context, TouchedValidationRequest) (*TouchedValidationResult, error)
}

func New

func New() Loader

type LocalPackageFingerprint

type LocalPackageFingerprint struct {
	PkgPath     string
	ContentHash string
	ShapeHash   string
	Files       []string
}

type Mode

type Mode string
const (
	ModeAuto     Mode = "auto"
	ModeCustom   Mode = "custom"
	ModeFallback Mode = "fallback"
)

func ModeFromEnv

func ModeFromEnv(env []string) Mode

type PackageLoadRequest

type PackageLoadRequest struct {
	WD         string
	Env        []string
	Tags       string
	Patterns   []string
	Mode       packages.LoadMode
	LoaderMode Mode
	Fset       *token.FileSet
	ParseFile  ParseFileFunc
	Discovery  *DiscoverySnapshot
}

type PackageLoadResult

type PackageLoadResult struct {
	Packages       []*packages.Package
	Backend        Mode
	FallbackReason FallbackReason
	FallbackDetail string
}

type ParseFileFunc

type ParseFileFunc func(*token.FileSet, string, []byte) (*ast.File, error)

type RootLoadRequest

type RootLoadRequest struct {
	WD       string
	Env      []string
	Tags     string
	Patterns []string
	NeedDeps bool
	Mode     Mode
	Fset     *token.FileSet
}

type RootLoadResult

type RootLoadResult struct {
	Packages       []*packages.Package
	Backend        Mode
	FallbackReason FallbackReason
	FallbackDetail string
	Discovery      *DiscoverySnapshot
}

type TouchedValidationRequest

type TouchedValidationRequest struct {
	WD      string
	Env     []string
	Tags    string
	Touched []string
	Local   []LocalPackageFingerprint
	Mode    Mode
}

type TouchedValidationResult

type TouchedValidationResult struct {
	Packages       []*packages.Package
	Backend        Mode
	FallbackReason FallbackReason
	FallbackDetail string
}

Jump to

Keyboard shortcuts

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