parser

package
v0.0.0-...-73c03bc Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractAnnotation

func ExtractAnnotation(doc *ast.CommentGroup) string

ExtractAnnotation extracts the automapper annotation from comments

func IsErrorReturningConverterSignature

func IsErrorReturningConverterSignature(fn types.FunctionInfo) bool

IsErrorReturningConverterSignature checks if a function matches error-returning converter signature: func(T) (U, error)

func IsSafeConverterSignature

func IsSafeConverterSignature(fn types.FunctionInfo) bool

IsSafeConverterSignature checks if a function matches safe converter signature: func(T) U

func LoadExternalPackage

func LoadExternalPackage(importPath, alias string) (map[string]types.SourceStruct, error)

LoadExternalPackage loads a package from the module system (can be remote)

func ParseFields

func ParseFields(structType *ast.StructType) []types.FieldInfo

ParseFields extracts field information including tags

func ParseFunctions

func ParseFunctions(file *ast.File) map[string]types.FunctionInfo

ParseFunctions extracts function declarations from AST

func ParsePackage

func ParsePackage(
	pkgPath string, cfg *config.Config,
) (
	[]types.DTOMapping,
	map[string]types.SourceStruct,
	map[string]types.FunctionInfo,
	string,
	error,
)

ParsePackage parses the main package and external packages

func ParseSourceList

func ParseSourceList(annotation string) []string

ParseSourceList parses a comma-separated list of source types

func ParseStruct

func ParseStruct(structType *ast.StructType) types.SourceStruct

ParseStruct extracts field information from a struct type

Types

This section is empty.

Jump to

Keyboard shortcuts

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