Skip to content

teamlint/ardan

Repository files navigation

ardan

web rapid development framework

Deps

  • Gin HTTP web framework
  • XORM ORM Framework
  • Container Dependency injection container

CLI

ardan cli tools

Install

Go get

go get github.com/teamlint/ardan

OR Git

git clone [email protected]:teamlint/ardan.git
cd ardan
go install # OR: task install

Usages

Init Project

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

Project layout

Run

task run

OR

cd cmd/server
go run main.go

Model Sync

Create model file.

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 

view database

have fun!.

Generate Tools

genrate model query/repository/service/controller codes.

ardan gen [all|query|repository|service|controller]

ardan gen all

TODO