Skip to content

loickal/crudist

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%