codegen

package
v0.0.0-...-18f2f0e Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

* GoAstra CLI - Go Parser * * Parses Go source files to extract struct definitions * for TypeScript code generation.

* GoAstra CLI - Service Generator * * Generates Angular services from Go type definitions. * Creates type-safe API clients with CRUD operations.

* GoAstra CLI - TypeScript Generator * * Converts Go type definitions to TypeScript interfaces. * Generates type-safe models for Angular frontend.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldDef

type FieldDef struct {
	Name     string
	Type     string
	JSONName string
	Optional bool
	Doc      string
}

* FieldDef represents a struct field definition.

type GoParser

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

* GoParser extracts type definitions from Go source files.

func NewGoParser

func NewGoParser(schemaPath string) *GoParser

* NewGoParser creates a new parser instance.

func (*GoParser) Parse

func (p *GoParser) Parse() ([]TypeDef, error)

* Parse reads all Go files in the schema path and extracts types.

type ServiceGenerator

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

* ServiceGenerator creates Angular service files from Go types.

func NewServiceGenerator

func NewServiceGenerator(outputPath string) *ServiceGenerator

* NewServiceGenerator creates a new generator instance.

func (*ServiceGenerator) Generate

func (g *ServiceGenerator) Generate(types []TypeDef) error

* Generate creates Angular service files for applicable types.

type TypeDef

type TypeDef struct {
	Name   string
	Fields []FieldDef
	Doc    string
}

* TypeDef represents a parsed Go type definition.

type TypeScriptGenerator

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

* TypeScriptGenerator creates TypeScript files from Go types.

func NewTypeScriptGenerator

func NewTypeScriptGenerator(outputPath string) *TypeScriptGenerator

* NewTypeScriptGenerator creates a new generator instance.

func (*TypeScriptGenerator) Generate

func (g *TypeScriptGenerator) Generate(types []TypeDef) error

* Generate creates TypeScript interface files for all types.

Jump to

Keyboard shortcuts

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