Skip to content

Latest commit

 

History

History
43 lines (38 loc) · 952 Bytes

readme.md

File metadata and controls

43 lines (38 loc) · 952 Bytes

CRUDist - Model Driven API Development

GoReport
Automagicaly create CRUD APIs for your data models.

Currently supported

To get support for your favourite Web or Model Framework open an issue.

Web Frameworks:

  • Fiber
  • Gin

Model Frameworks:

  • GORM

Example (gorm)

(Full working examples in demo folder)

Model definition

type BaseModel struct {
	ID        uint      `gorm:"primarykey"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

type User struct {
	BaseModel
	Username string `json:"username" gorm:"size:100"`
	Password string `json:"-" gorm:"size:128"`
}

CRUD API

crudist.Handle(c, "user/", &User{})

Result routes:

GET    /user/
GET    /user/:id/
POST   /user/
DELETE /user/
DELETE /user/:id/
PATCH  /user/