scan

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerField

type ContainerField struct {
	Name     string
	TypeExpr string
	Type     types.Type

	TagRaw    string
	InjectRaw string
	Inject    InjectTag

	Position string
}

ContainerField represents a field within a container struct.

type ContainerSpec

type ContainerSpec struct {
	PkgPath  string
	PkgName  string
	Name     string
	Position string
	Fields   []ContainerField
}

ContainerSpec represents a discovered container struct.

func CollectContainers

func CollectContainers(pkgs []*packages.Package) ([]ContainerSpec, error)

CollectContainers scans loaded packages and collects container structs.

type InjectTag

type InjectTag struct {
	Provider string
}

InjectTag represents a parsed `inject:"..."` struct tag.

type ProviderSpec

type ProviderSpec struct {
	PkgPath      string
	PkgName      string
	Name         string
	ResultType   types.Type
	ResultString string
	ReturnError  bool
	Params       []types.Type
	Position     string
}

ProviderSpec represents a discovered provider function.

func CollectProviders

func CollectProviders(pkgs []*packages.Package) ([]ProviderSpec, error)

CollectProviders scans loaded packages and collects provider functions.

Rule: - Top-level functions only (func Foo(...)) - Exactly 1 result - Result type can be any named type, pointer to named type, or interface type - Parameters are recorded as dependency requirements

Jump to

Keyboard shortcuts

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