loader

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package loader provides Go package loading and struct type resolution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(dir string) (*packages.Package, error)

Load parses the Go package at the given directory and returns the package object.

Types

type StructField

type StructField struct {
	Name     string // short field name used for matching (e.g. "Street")
	Accessor string // full accessor path from root (e.g. "Address.Street")
	Type     types.Type
	Tag      reflect.StructTag
	Exported bool
	Embedded bool
}

StructField represents a single field extracted from a Go struct.

type StructInfo

type StructInfo struct {
	Name    string
	PkgPath string
	Fields  []StructField // includes promoted fields from embedded structs
}

StructInfo holds the resolved struct type information.

func LookupStruct

func LookupStruct(pkg *packages.Package, name string) (*StructInfo, error)

LookupStruct finds a named struct type in the package.

Jump to

Keyboard shortcuts

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