Versions in this module Expand all Collapse all v0 v0.0.25 Mar 1, 2026 Changes in this version + func Optional[T any](req ...T) any type HandlerMeta + Responses []ResponseSpec + type ResponseSpec struct + Body any + Description string + MediaType string + Status int v0.0.24 Feb 25, 2026 Changes in this version type DocOpt + func WithSQLRoot(path string) DocOpt type DocsOptions + SQLRoot string type Router + func (r *Router) AttachLogger(next http.Handler) http.Handler v0.0.17 Feb 1, 2026 Changes in this version + func Cors(opts ...CORSOption) func(http.Handler) http.Handler + func Decode[T any](r *http.Request) (T, error) + func DefaultDocsHTML(openAPIPath string) string + func Encode(w http.ResponseWriter, _ *http.Request, status int, v any) + func WriteDocsHTMLFile(path, openAPIPath string) error + type CORSOption func(*CORSOptions) + func WithAllowCredentials(enabled bool) CORSOption + func WithAllowedHeaders(headers ...string) CORSOption + func WithAllowedMethods(methods ...string) CORSOption + func WithAllowedOrigins(origins ...string) CORSOption + func WithExposedHeaders(headers ...string) CORSOption + func WithMaxAgeSeconds(seconds int) CORSOption + type CORSOptions struct + AllowCredentials bool + AllowedHeaders []string + AllowedMethods []string + AllowedOrigins []string + ExposedHeaders []string + MaxAgeSeconds int + type DocOpt func(*DocsOptions) + func WithDocsFile(path string) DocOpt + func WithDocsPath(path string) DocOpt + func WithOpenAPIFile(path string) DocOpt + func WithOpenAPIPath(path string) DocOpt + type DocsOptions struct + DocsFile string + DocsPath string + OpenAPIFile string + OpenAPIPath string + type Guard = guard.Guard + type GuardSpec = guard.Spec + type HandlerMeta struct + Description string + Method string + Service string + Summary string + Tags []string + type NoResponse200 struct + type NoResponse204 struct + type NoResponse500 struct + type OpenAPIContact struct + Email string + Name string + URL string + type OpenAPIExternalDocs struct + Description string + URL string + type OpenAPILicense struct + Name string + URL string + type OpenAPIOptions struct + Contact *OpenAPIContact + Description string + ExternalDocs *OpenAPIExternalDocs + License *OpenAPILicense + Servers []OpenAPIServer + Tags []OpenAPITag + Title string + Version string + type OpenAPIServer struct + Description string + URL string + type OpenAPITag struct + Description string + Name string + type Route struct + Guards []GuardSpec + Handler TypedHandler + Meta HandlerMeta + Method string + Path string + PathParams []string + Pattern string + type Router struct + func NewRouter() *Router + func (r *Router) Handle(pattern string, h http.Handler, guards ...Guard) + func (r *Router) HandleFunc(pattern string, fn func(http.ResponseWriter, *http.Request)) + func (r *Router) HandleTyped(pattern string, h TypedHandler, guards ...Guard) + func (r *Router) OpenAPI() ([]byte, error) + func (r *Router) Routes() []Route + func (r *Router) ServeAllDocs(opts ...ServeAllDocsOpt) + func (r *Router) ServeClientJS(w http.ResponseWriter, _ *http.Request) + func (r *Router) ServeClientJSHash(w http.ResponseWriter, _ *http.Request) + func (r *Router) ServeClientPY(w http.ResponseWriter, _ *http.Request) + func (r *Router) ServeClientPYHash(w http.ResponseWriter, _ *http.Request) + func (r *Router) ServeClientTS(w http.ResponseWriter, _ *http.Request) + func (r *Router) ServeClientTSHash(w http.ResponseWriter, _ *http.Request) + func (r *Router) ServeDocs(opts ...DocOpt) + func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request) + func (r *Router) SetLogger(logger *slog.Logger) + func (r *Router) SetOpenAPIOptions(opts OpenAPIOptions) + func (r *Router) SetTypeOverrides(overrides map[string]TypeOverride) + func (r *Router) WriteClientJS(w io.Writer) error + func (r *Router) WriteClientJSFile(path string) error + func (r *Router) WriteClientJSHash(w io.Writer) error + func (r *Router) WriteClientPY(w io.Writer) error + func (r *Router) WriteClientPYFile(path string) error + func (r *Router) WriteClientPYHash(w io.Writer) error + func (r *Router) WriteClientTS(w io.Writer) error + func (r *Router) WriteClientTSFile(path string) error + func (r *Router) WriteClientTSHash(w io.Writer) error + func (r *Router) WriteOpenAPIFile(path string) error + type ServeAllDocsOpt func(*ServeAllDocsOptions) + func WithClientJSPath(path string) ServeAllDocsOpt + func WithClientPYPath(path string) ServeAllDocsOpt + func WithClientTSPath(path string) ServeAllDocsOpt + func WithDocsOptions(opts ...DocOpt) ServeAllDocsOpt + func WithoutDocs() ServeAllDocsOpt + type ServeAllDocsOptions struct + ClientJSPath string + ClientPYPath string + ClientTSPath string + DocsEnabled bool + DocsOptions []DocOpt + type TypeOverride = schema.TypeOverride + type TypedHandler interface + Metadata func() HandlerMeta + RequestType func() any + ResponseType func() any + func Wrap(handler http.Handler, req any, resp any, meta HandlerMeta) TypedHandler + func WrapFunc(handler func(http.ResponseWriter, *http.Request), req any, resp any, ...) TypedHandler + type TypedHandlerFunc struct + Handler func(http.ResponseWriter, *http.Request) + Meta HandlerMeta + Req any + Resp any + func (t TypedHandlerFunc) Metadata() HandlerMeta + func (t TypedHandlerFunc) RequestType() any + func (t TypedHandlerFunc) ResponseType() any + func (t TypedHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request)