Skip to content

Latest commit

 

History

History
32 lines (28 loc) · 576 Bytes

readme.md

File metadata and controls

32 lines (28 loc) · 576 Bytes

CRUDist - Model Driven API Development

Automagicaly create CRUD APIs for your gorm models.

Example

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:"password" gorm:"size:128"`
}

CRUD API

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

Result routs:

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