goninja: code-first CRUD generation for Go, no reflection

작성자

카테고리:

← 피드로
DEV Community · Caspel26 · 2026-08-21 개발(SW)

Caspel26

Been building goninja, a Go framework that generates CRUD REST APIs from annotated structs — routing, validation, OpenAPI, the rest.

It’s the Go counterpart to a Python project I already maintain, django-ninja-aio-crud — same idea, define the model once and get the API. Difference here: no runtime reflection, it generates real Go code that lives in your repo, readable like anything you’d write by hand.

hand.

type Book struct {
    ID       string  `gorm:"primaryKey" goninja:"list,retrieve"`
    Title    string  `goninja:"list,retrieve,create,update" validate:"required"`
    AuthorID string  `goninja:"list,retrieve,create,update,filter"`
    Price    float64 `goninja:"list,retrieve,create,update,filter" validate:"min=0"`
}

Enter fullscreen mode Exit fullscreen mode

$ goninja generate -models-import myapp/models

Enter fullscreen mode Exit fullscreen mode

Pre-alpha, API still moving. Feedback welcome: docs github

원문에서 계속 ↗