Versions in this module Expand all Collapse all v1 v1.0.1 Aug 25, 2026 v1.0.0 Aug 25, 2026 Changes in this version + func CompileValidationErrors(payload any) map[string]string + func SetupState(s UAPIState) + type APIRouter interface + Routes func(r *chi.Mux) + Tag func() (string, string) + type AuthData struct + Authorized bool + Banned bool + Data map[string]any + ID string + TargetType string + type AuthType struct + AllowedScope string + Type string + URLVar string + type HttpResponse struct + Bytes []byte + Data string + Headers map[string]string + Json any + Redirect string + Status int + func DefaultResponse(statusCode int) HttpResponse + func MarshalReq(r *http.Request, dst any) (resp HttpResponse, ok bool) + func MarshalReqWithHeaders(r *http.Request, dst any, headers map[string]string) (resp HttpResponse, ok bool) + func ValidatorErrorResponse(compiled map[string]string, v validator.ValidationErrors) HttpResponse + type Method int + const DELETE + const GET + const HEAD + const PATCH + const POST + const PUT + func (m Method) String() string + type Route struct + Aliases map[string]string + Auth []AuthType + AuthOptional bool + DisablePathSlashCheck bool + Docs func() *docs.Doc + ExtData map[string]any + Handler func(d RouteData, r *http.Request) HttpResponse + Method Method + OpId string + Pattern string + SanityCheck func() error + Setup func() + func (r Route) Route(ro Router) + func (r Route) String() string + type RouteData struct + Auth AuthData + Context context.Context + Props map[string]string + type Router interface + Delete func(pattern string, h http.HandlerFunc) + Get func(pattern string, h http.HandlerFunc) + Head func(pattern string, h http.HandlerFunc) + Patch func(pattern string, h http.HandlerFunc) + Post func(pattern string, h http.HandlerFunc) + Put func(pattern string, h http.HandlerFunc) + type UAPIConstants struct + BadRequest string + BodyRequired string + Forbidden string + InternalServerError string + MethodNotAllowed string + ResourceNotFound string + Unauthorized string + type UAPIDefaultResponder interface + New func(msg string, ctx map[string]string) any + type UAPIInitData struct + Tag string + type UAPIState struct + AuthTypeMap map[string]string + Authorize func(r Route, req *http.Request) (AuthData, HttpResponse, bool) + BaseSanityCheck func(r Route) error + Constants *UAPIConstants + Context context.Context + DefaultResponder UAPIDefaultResponder + InitData UAPIInitData + Logger *zap.Logger + PatchDocs func(d *docs.Doc) *docs.Doc + RouteDataMiddleware func(rd *RouteData, req *http.Request) (*RouteData, error) + var State *UAPIState + func (s *UAPIState) SetCurrentTag(tag string)