generator

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FuncMap

func FuncMap() template.FuncMap

FuncMap returns the template.FuncMap used by all templates.

func WriteFiles

func WriteFiles(outputDir string, files []GeneratedFile) error

WriteFiles formats each generated file with goimports and writes them to outputDir.

Types

type EmbeddedCatchAll added in v0.2.6

type EmbeddedCatchAll struct {
	Guard string
	Path  string
}

EmbeddedCatchAll locates a catch-all map inside an embedded type: the Go selector path from the enclosing struct, and the nil checks any pointers on that path require.

type ErrorWrapper added in v0.2.8

type ErrorWrapper struct {
	Name   string
	Detail string
}

ErrorWrapper is one generated error type: the name it declares and the type of the body it parses into.

type GeneratedFile

type GeneratedFile struct {
	Name    string
	Content []byte
}

GeneratedFile represents a single generated output file.

type Generator

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

Generator executes templates against the IR to produce Go source files.

func New

func New(pkg *ir.Package) (*Generator, error)

New creates a Generator for the given IR package, parsing all embedded templates.

func (*Generator) Generate

func (g *Generator) Generate() ([]GeneratedFile, error)

Generate executes all templates and returns the generated files.

type InboundKind added in v0.2.9

type InboundKind struct {
	Callback bool
	Singular string
	Plural   string
	Suffix   string
}

InboundKind names one family of payloads the API sends: webhooks the document declares, or callbacks an operation registers.

Jump to

Keyboard shortcuts

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