httpinoapi

package
v2.0.0-b6 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

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

Generator generates OpenAPI documentation from HTTP handlers.

func NewGenerator

func NewGenerator() *Generator

NewGenerator creates a new Generator.

func (*Generator) Build

func (g *Generator) Build() (*v3.Document, error)

Build returns a complete OpenAPI 3.1 document with all registered handlers.

func (*Generator) Operation

func (g *Generator) Operation(verb string, path string, handler interface{}, opts ...Option) error

Operation registers an HTTP handler in the group.

type Option

type Option func(*options)

Option configures handler registration

func WithInputStruct

func WithInputStruct(inputStruct any) Option

WithInputStruct specifies the input struct for request parameters

func WithInputType

func WithInputType(inputType reflect.Type) Option

WithInputType specifies the input type for request parameters

func WithOutputStruct

func WithOutputStruct(outputStruct any) Option

WithOutputStruct specifies the output struct for responses

func WithOutputType

func WithOutputType(outputType reflect.Type) Option

WithOutputType specifies the output type for responses

func WithTags

func WithTags(tags ...string) Option

WithTags adds OpenAPI tags to the handler

Jump to

Keyboard shortcuts

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