Versions in this module Expand all Collapse all v0 v0.1.0 Jun 12, 2026 Changes in this version + var DataEnvelope = KeyedEnvelope + var RuleTag = "binding" + func APIKeyAuth(in, name string) *openapi3.SecurityScheme + func BearerAuth() *openapi3.SecurityScheme + func LoadBaseFile(path string) (*openapi3.T, error) + func SetErrorParser(p ErrorParser) + func SetResponseEnvelope(e ResponseEnvelope) + func SetValidator(v Validator) + func WireName(field reflect.StructField, source string) string + type App struct + func New(opts ...Option) *App + type Carrier interface + Abort func() + Body func() ([]byte, error) + ContentType func() string + Context func() context.Context + Header func(name string) string + HeaderValues func(name string) []string + Method func() string + MultipartForm func() (*multipart.Form, error) + Param func(name string) string + Query func() url.Values + RecordError func(err error) + SetContext func(ctx context.Context) + SetHeader func(key, value string) + WriteBytes func(status int, contentType string, data []byte) error + WriteEmpty func(status int) error + WriteJSON func(status int, body any) error + type Error struct + Code string + Fields []FieldError + Message string + Status int + func NewError(status int, code, message string) *Error + func NewValidationError(message string, fields []FieldError) *Error + func (e *Error) Error() string + func (e *Error) ErrorBody() any + func (e *Error) HTTPStatus() int + func (e *Error) Unwrap() error + type ErrorBody interface + ErrorBody func() any + type ErrorMapper func(error) (status int, body any, ok bool) + type ErrorParser interface + ErrorType func() reflect.Type + Resolve func(err error) (status int, body any, ok bool) + type FieldError struct + Field string + Message string + Rule string + type GenConfig struct + BaseFile string + Dir string + JSONFile string + NoValidate bool + YAMLFile string + type HTTPCarrier struct + MaxBody int64 + R *http.Request + W http.ResponseWriter + func (c *HTTPCarrier) Abort() + func (c *HTTPCarrier) Body() ([]byte, error) + func (c *HTTPCarrier) Cleanup() + func (c *HTTPCarrier) ContentType() string + func (c *HTTPCarrier) Context() context.Context + func (c *HTTPCarrier) Errors() []error + func (c *HTTPCarrier) Header(name string) string + func (c *HTTPCarrier) HeaderValues(name string) []string + func (c *HTTPCarrier) Method() string + func (c *HTTPCarrier) MultipartForm() (*multipart.Form, error) + func (c *HTTPCarrier) Query() url.Values + func (c *HTTPCarrier) RecordError(err error) + func (c *HTTPCarrier) SetContext(ctx context.Context) + func (c *HTTPCarrier) SetHeader(key, value string) + func (c *HTTPCarrier) WriteBytes(status int, contentType string, data []byte) error + func (c *HTTPCarrier) WriteEmpty(status int) error + func (c *HTTPCarrier) WriteJSON(status int, body any) error + type HTTPError interface + HTTPStatus func() int + type KeyedEnvelope struct + Constants map[string]any + DataKey string + MetaKey string + func (e KeyedEnvelope) Wrap(data, meta any) any + func (e KeyedEnvelope) WrapSchema(data, meta *openapi3.SchemaRef) *openapi3.SchemaRef + type Middleware func(ctx context.Context, req Request[Header, Param, Query, Body]) (context.Context, error) + type Option func(*appConfig) + func WithErrorParser(p ErrorParser) Option + func WithMaxRequestBytes(n int64) Option + func WithResponseEnvelope(e ResponseEnvelope) Option + func WithValidator(v Validator) Option + type PagingMeta struct + Count int64 + Current int + Pages int + PerPage int + type Registry struct + func NewRegistry(title, version string) *Registry + func (rg *Registry) Add(routes ...Route) *Registry + func (rg *Registry) AddSecurityScheme(name string, scheme *openapi3.SecurityScheme) *Registry + func (rg *Registry) AddServer(url, description string) *Registry + func (rg *Registry) AddTag(name, description string) *Registry + func (rg *Registry) Base(doc *openapi3.T) *Registry + func (rg *Registry) Contact(name, url, email string) *Registry + func (rg *Registry) Describe(description string) *Registry + func (rg *Registry) ExternalDocs(description, url string) *Registry + func (rg *Registry) JSON() ([]byte, error) + func (rg *Registry) License(name, url string) *Registry + func (rg *Registry) Logo(url string) *Registry + func (rg *Registry) LogoWith(logo map[string]any) *Registry + func (rg *Registry) OpenAPI() *openapi3.T + func (rg *Registry) Routes() []Route + func (rg *Registry) SpecBytesOnce() func() ([]byte, error) + func (rg *Registry) TagGroup(name string, tags ...string) *Registry + func (rg *Registry) TermsOfService(url string) *Registry + func (rg *Registry) UseComponents() *Registry + func (rg *Registry) Validate(ctx context.Context) error + func (rg *Registry) Write(ctx context.Context, cfg GenConfig) ([]string, error) + func (rg *Registry) YAML() ([]byte, error) + type Request struct + Body Body + Header Header + Param Param + Query Query + type RequestHandler func(ctx context.Context, req Request[Header, Param, Query, Body]) (*Response, error) + type ResponseEnvelope interface + Wrap func(data any, meta any) any + WrapSchema func(data, meta *openapi3.SchemaRef) *openapi3.SchemaRef + var RawEnvelope ResponseEnvelope = rawEnvelope{} + type Result struct + Data any + Error *json.RawMessage + Meta any + Status int + func NewDataResult(data any) *Result + func NewListDataResult(items any, count int64, perPage, current int) *Result + func NewResult(data any) *Result + func (r *Result) WithError(err error) *Result + func (r *Result) WithFile(filename string) *Result + func (r *Result) WithHeader(key, value string) *Result + func (r *Result) WithMeta(meta any) *Result + func (r *Result) WithPaging(count int64, perPage, current int) *Result + func (r *Result) WithStatus(status int) *Result + type RichHandler func(ctx context.Context, req Request[Header, Param, Query, Body]) (*Result, error) + type Route struct + func NewBodyRoute[Body, Response any](method, path string, ...) Route + func NewParamRoute[Param, Response any](method, path string, ...) Route + func NewQueryRoute[Query, Response any](method, path string, ...) Route + func NewRichRoute[Header, Param, Query, Body any](method string, path string, handler RichHandler[Header, Param, Query, Body], ...) Route + func NewRoute[Header, Param, Query, Body, Response any](method string, path string, ...) Route + func (route Route) Description() string + func (route Route) Invoke(c Carrier) + func (route Route) MaxRequestBytes() (limit int64, ok bool) + func (route Route) MaxRequestBytesOr(fallback int64) int64 + func (route Route) Method() string + func (route Route) Path() string + func (route Route) Schema() RouteSchema + func (route Route) SuccessStatus() int + func (route Route) Summary() string + func (route Route) Tags() []string + type RouteOption func(*Route) + func WithApp(a *App) RouteOption + func WithBinaryResponse(contentType, description string) RouteOption + func WithDeprecated() RouteOption + func WithDescription(description string) RouteOption + func WithEnvelope(e ResponseEnvelope) RouteOption + func WithErrorMapper(mapper ErrorMapper) RouteOption + func WithMetaType[T any]() RouteOption + func WithRawResponse() RouteOption + func WithResponseType[T any]() RouteOption + func WithResponse[T any](status int, description string) RouteOption + func WithSecurity(scheme string, scopes ...string) RouteOption + func WithSuccessStatus(status int) RouteOption + func WithSummary(summary string) RouteOption + func WithTags(tags ...string) RouteOption + func WithTypedBefore[Header, Param, Query, Body any](middlewares ...Middleware[Header, Param, Query, Body]) RouteOption + type RouteSchema struct + Body reflect.Type + Header reflect.Type + Meta reflect.Type + Param reflect.Type + Query reflect.Type + Response reflect.Type + type Validator interface + Validate func(value any, source string) error