Documentation
¶
Overview ¶
Package codegen generates Go code from parsed handler information using extractors
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 wrapper code for handlers using http.Handler
func NewWithFramework ¶
NewWithFramework creates a new code generator for the specified framework Supported frameworks: http (default), fiber, gin, echo
type HandlerData ¶
type HandlerData struct {
Name string
WrapperName string
ParseFuncName string
ParamType string
ReturnType string
HasExtractionCode bool
ExtractionCode string
HasBody bool
BodyFieldName string
HasRawBody bool
RawBodyFieldName string
HasValidation bool
HasResponseWriter bool
HasRequest bool
HasMultipartForm bool
MaxMemory int64 // Max memory for multipart form parsing (default 32MB)
}
HandlerData holds data for a single handler
type TemplateData ¶
type TemplateData struct {
PackageName string
Imports []string
Handlers []HandlerData
Framework string
}
TemplateData holds data for template execution
Click to show internal directories.
Click to hide internal directories.