This is a Go application for creating a clean architecture of the application being developed.
⚠ Currently only MySQL is supported
make && sudo mv bin/clar /usr/local/bin/
clar i [-d dbtype|--db=dbtype] [-i|--internal]
or
clar init [-d dbtype|--db=dbtype] [-i|--internal]
dbtype
- for what type of database (default:mysql
).-i
,--internal
- put the code in theinternal
directory.
Will be created:
Creating a entity with repository.
clar e [-n name|--name=name] [-i|--internal]
or
clar entity -n name|--name=name [-d dbtype|--db=dbtype] [-i|--internal] [-s|--simple] or [-e|--empty]
name
- entity name (required).dbtype
- for what type of database (default:mysql
).-s
,--simple
- simple entity.-e
,--empty
- empty entity.-i
,--internal
- put the code in theinternal
directory.
Will be created (example clar i -nuser
):
domain/repository/user_repository.go
or if the-e
flag is specifieduser_repository.go
domain/repository/entity/user.go
or if the-s
flag is specifieduser.go
or if the-e
flag is specifieduser.go
- For MySQL: domain/repository/mysql/user.go or if the
-e
flag is specified user.go
if there was no initialization, there will be automatic initialization for the selected database.
Creating an array structure for a json column.
clar a -n name|--name=name [-i|--internal]
or
clar array -n name|--name=name [-i|--internal]
name
- struct name (required).-i
,--internal
- put the code in theinternal
directory.
Will be created (example clar i -nmyArr
) domain/entity/my_arr.go
.
Creating a structure for a json column.
clar s -n name|--name=name [-i|--internal]
or
clar struct -n name|--name=name [-i|--internal]
name
- struct name (required).-i
,--internal
- put the code in theinternal
directory.
Will be created (example clar i -nmyStruct
) domain/entity/my_struct.go
.
Creating migration tools code.
clar m [-d dbtype|--db=dbtype] [-i|--internal]
or
clar migrate [-d dbtype|--db=dbtype] [-i|--internal]
dbtype
- for what type of database (default:mysql
).-i
,--internal
- put the code in theinternal
directory.
Will be created (for MySQL):
Any of the options:
clar -h|--help
MIT License © Roman Novikov