parser

package
v0.0.0-...-6f83ac3 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Converter

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

Converter converts from existing parser types to clean domain types

func NewConverter

func NewConverter(fieldInfoGenerator *field.InfoGenerator) *Converter

NewConverter creates a new converter

func (*Converter) ConvertStruct

func (c *Converter) ConvertStruct(s ParsedStruct) domain.Struct

ConvertStruct converts a ParsedStruct to domain.Struct. Only includes fields that can be processed by the field info generator.

func (*Converter) ShouldGenerateQueryBuilder

func (c *Converter) ShouldGenerateQueryBuilder(doc *ast.CommentGroup) bool

ShouldGenerateQueryBuilder checks if struct should have querybuilder generated

type ParsedStruct

type ParsedStruct struct {
	TypeName string
	Fields   []StructField
	Doc      *ast.CommentGroup // line comments; or nil
}

ParsedStruct represents struct info

type Result

type Result struct {
	Structs     map[string]ParsedStruct
	PackageName string
	Types       *types.Package
}

type StructField

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

StructField represents one field in struct

func (StructField) Name

func (sf StructField) Name() string

func (StructField) Tag

func (sf StructField) Tag() reflect.StructTag

func (StructField) Type

func (sf StructField) Type() types.Type

type Structs

type Structs struct{}

func (Structs) ParseFile

func (p Structs) ParseFile(ctx context.Context, filePath string) (*Result, error)

Jump to

Keyboard shortcuts

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