codegen

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 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 Config

type Config struct {
	// OutputDir é o diretório onde os arquivos gerados serão salvos
	OutputDir string
	// PackageName é o nome do pacote para o código gerado (auto-detectado se vazio)
	PackageName string
}

Config contém as configurações para o gerador de código.

type FieldInfo

type FieldInfo struct {
	Name       string // Nome do campo Go (ex: "Name")
	ColumnName string // Nome da coluna no DB (ex: "name")
	Type       string // Tipo Go (ex: "string", "int64", "core.Optional[string]")
	FieldType  string // Tipo do campo query (ex: "StringField", "OptionalStringField")
}

FieldInfo contém informações sobre um campo de struct.

type Generator

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

Generator gera código de campos tipados a partir de structs Go.

func NewGenerator

func NewGenerator(config Config) *Generator

NewGenerator cria um novo gerador.

func (*Generator) GenerateFromPath

func (g *Generator) GenerateFromPath(path string) error

GenerateFromPath gera código a partir de um caminho (arquivo ou diretório).

type StructInfo

type StructInfo struct {
	Name       string      // Nome da struct (ex: "User")
	Fields     []FieldInfo // Campos da struct
	Package    string      // Nome do pacote
	ImportCore bool        // Se precisa importar o pacote core
}

StructInfo contém informações sobre uma struct.

Jump to

Keyboard shortcuts

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