Versions in this module Expand all Collapse all v0 v0.11.0 Jun 24, 2026 v0.10.0 May 22, 2026 Changes in this version + func APIResource(r IRouter, name string, ctrl ResourceController) + func Auth() gin.HandlerFunc + func AuthJWT(m *auth.Manager) gin.HandlerFunc + func CORS(allowed ...string) gin.HandlerFunc + func H(h Handler) gin.HandlerFunc + func HS(handlers ...Handler) []gin.HandlerFunc + func Instrument(conn *database.Connection) *database.Connection + func ObserveQuery(conn *database.Connection) + func OpenAPI(info SpecInfo, opts ...Option) map[string]any + func QueryLog(conn *database.Connection) gin.HandlerFunc + func QueryLogN(conn *database.Connection, threshold int) gin.HandlerFunc + func RegisterRoute(method, path, resource, op string) + func RequestTimeout(d time.Duration) gin.HandlerFunc + func ResetRoutes() + func Resource(r IRouter, name string, ctrl ResourceController) + func ServeOpenAPI(r IRouter, info SpecInfo, opts ...Option) + func Validate(dst any) error + func WriteOpenAPI(path string, info SpecInfo, opts ...Option) error + type Ctx struct + func (c *Ctx) Bind(dst any) error + func (c *Ctx) BindAndValidate(dst any) error + func (c *Ctx) Created(v any) any + func (c *Ctx) Ctx() context.Context + func (c *Ctx) NoContent() + func (c *Ctx) Param(name string) string + func (c *Ctx) ParamInt(name string) int + func (c *Ctx) ParamUint(name string) uint64 + func (c *Ctx) Query(name string) string + func (c *Ctx) QueryDefault(name, fallback string) string + func (c *Ctx) QueryInt(name string, fallback int) int + func (c *Ctx) Role() string + func (c *Ctx) UserID() uint64 + type Handler func(c *Ctx) (any, error) + type IRouter interface + DELETE func(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes + GET func(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes + PATCH func(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes + POST func(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes + PUT func(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes + type Option func(*config) + func WithSchema(name string, schema any) Option + type Page struct + Data any + From int + LastPage int + Page int + PerPage int + To int + Total int64 + func Paginate[T any](c *Ctx, q *ormBuilder[T]) (Page, error) + type PaginatedQuery interface + Count func(ctx context.Context) (int64, error) + Limit func(n int) *T + Offset func(n int) *T + type ResourceController interface + Destroy func(c *Ctx) (any, error) + Index func(c *Ctx) (any, error) + Show func(c *Ctx) (any, error) + Store func(c *Ctx) (any, error) + Update func(c *Ctx) (any, error) + type RouteEntry struct + Method string + Op string + Path string + Resource string + func Routes() []RouteEntry + type SpecInfo struct + Description string + Title string + Version string + type ValidationError struct + Fields map[string]string + Message string + func (e *ValidationError) Error() string