Skip to content

artileda/paich

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Paich

Simple code generator using Go's text/template library. Field descriptor inspired by Ruby on Rails.

Simple Usage

  • ./paich [model name] [field name]:[field type]:[field attr] --template=[template name]
  • ./paich generate test test:test --template=hello-world

Usage using go run

  • go run main.go generate test name:Pavolia' 'Reine age:Expired --template=json
  • Output
{ 
    "name":"Pavolia Reine",
    "age":"Expired", 
}

Folder template contain template following text/template format, and filename will be considered as template name.

Create your template and place it in template folder or assign environment variable PAICH_TEMPLATE_DIR with you template path then place you template in it.

PAICH_TEMPLATE_DIR="/home/user/template" ./paich 

How to build

  • go build
  • ./paich

Resource

License

MIT

Releases

No releases published

Packages

No packages published

Languages