gin

package
v0.0.0-...-a72dbf4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CRUD

func CRUD[T any](server *gin.Engine, db *gorm.DB, middleware ...gin.HandlerFunc)

CRUD registers Save, Query, and Delete routes for type T on the gin engine.

func Delete

func Delete[T any](server *gin.Engine, db *gorm.DB, middleware ...gin.HandlerFunc)

Delete registers DELETE and POST routes to remove a record of type T by ID or JSON body.

func List

func List[T any](server *gin.Engine, db *gorm.DB, middleware ...gin.HandlerFunc)

List registers a GET route to fetch a paginated, sorted list of type T.

func Log

func Log(method, path, title string)

Log prints a colorized API registration summary to stdout.

func Query

func Query[T any](server *gin.Engine, db *gorm.DB, middleware ...gin.HandlerFunc)

Query registers a GET route to fetch a single record of type T by ID.

func Save

func Save[T any](server *gin.Engine, db *gorm.DB, middleware ...gin.HandlerFunc)

Save registers POST and PUT routes to create or update a record of type T.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL