generator

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldTemplateData

type FieldTemplateData struct {
	Name         string
	LogStatement string
}

FieldTemplateData represents data for a single field

type GenerationResult

type GenerationResult struct {
	PackageName string // Name of the package
	FilePath    string // Path where the generated file should be written
	Content     string // Generated Go code content
}

GenerationResult represents the result of code generation

type Generator

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

Generator handles code generation for LogValue methods

func New

func New(cfg *config.Config) *Generator

New creates a new Generator instance

func (*Generator) GenerateForStructs

func (g *Generator) GenerateForStructs(structs []parser.StructInfo) (*GenerationResult, error)

GenerateForStructs generates LogValue methods for a list of structs

type StructTemplateData

type StructTemplateData struct {
	Name         string
	ReceiverName string
	Fields       []FieldTemplateData
}

StructTemplateData represents data for a single struct

type TemplateData

type TemplateData struct {
	PackageName string
	Structs     []StructTemplateData
}

TemplateData represents data passed to the template

Jump to

Keyboard shortcuts

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