web rapid development framework
ardan cli tools
go get github.com/teamlint/ardan
git clone [email protected]:teamlint/ardan.git
cd ardan
go install # OR: task install
initial application project layout & infrastructure codes
ardan [global options] init [all|query|repository|service|controller]
mkdir myproject
cd myproject
go mod init <name>
ardan -s -dc <db-conn> init all
task run
OR
cd cmd/server
go run main.go
Write model file in app/model/tom.go
package model
import (
"time"
)
//ardan:sync
//ardan:gen
// Tom test model
type Tom struct{
ID string `xorm:"not null pk unique CHAR(20) 'id'" json:"id"`
Username string `xorm:"not null index VARCHAR(100)" json:"username"`
CreatedAt time.Time `xorm:"not null created TIMESTAMPZ" json:"created_at"`
}
ardan -dc <db-conn> sync
have fun!.
genrate model query/repository/service/controller codes.
ardan gen [all|query|repository|service|controller]
ardan gen all