generate

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package generate orchestrates the full gota pipeline: load packages, run router plugins to find routes, extract "gota:" comment blocks, infer defaults, merge the two, and hand the result to the emitter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(opts Options) (*model.Document, error)

Run executes the full pipeline against opts.Dir and returns the merged OpenAPI document.

Types

type Options

type Options struct {
	Dir     string
	Title   string
	Version string
	Routers []Router
}

Options controls document generation.

type Router added in v0.2.0

type Router struct {
	Plugin  router.Plugin
	Dialect inference.Dialect
}

Router pairs a router plugin (which framework's route registrations to extract) with the inference dialect recognizing that framework's request/response idioms inside handler bodies. The two are separate axes on purpose: a future Chi plugin pairs with inference.NetHTTP() unchanged (Chi handlers are plain net/http), while a Gin plugin brings its own dialect. A nil Dialect disables body inference for that plugin's routes — they're still documented from the route and any "gota:" comment.

Jump to

Keyboard shortcuts

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