generator

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 fixes imports in and gofmts each generated file, then 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