modelgen

command module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2020 License: MIT Imports: 7 Imported by: 0

README

modelgen

CircleCI Status GoDoc Go Report Card Build Status CircleCI Status standar-readme compliant

Application to create (start app) go webservice with 3-Tier Architecture.

The Generated Application inculeds :-

  • Go mod
  • Configeration file
  • Dockerfile
  • DAL,BLL,DTO,API and API_Tests for every Database Table
  • Compatalbe with mysql postgres mssql sqlite oracle
  • Using GORM as ORM

Installation

$ go get -u github.com/tarekbadrshalaan/modelgen
$ vi config.json
  
  {
    "AppName"               :   "Application",
    "Module"                :   "{{github.com/packagepath}}",
    "DBConnectionString"    :   "{{Database ConnectionString}}",
    "DBEngine"              :   "{{Database Engine}}",
    "WebAddress"            :   "0.0.0.0",
    "WebPort"               :   7070
  }

$ modelgen 
$ cd Application/
$ go build .
  go: finding github.com/tarekbadrshalaan/goStuff/configuration latest
  go: finding github.com/jinzhu/inflection latest
$ ./Application

Example

pg_restore -U postgres -d dvdrental ~/dvdrental.tar

$ vi config.json
  {
    "AppName"               :   "Application",
    "Module"                :   "github.com/Application",
    "DBConnectionString"    :   "host=127.0.0.1 port=5432 user=postgres password=postgres dbname=dvdrental sslmode=disable",
    "DBEngine"              :   "postgres",
    "WebAddress"            :   "0.0.0.0",
    "WebPort"               :   7070
  }
  
$ modelgen 
$ cd Application/
  ├──> Application
    ├──> config.json
    ├──> go.mod 
    ├──> main.go
    ├──> Dockerfile
    db
    │	├──> database.go
    api
    │	├──> ActorAPI.go
    │ ...
    bll
    │	├──> ActorBLL.go
    │ ...
    dal
    │	├──> ActorDAL.go
    │ ...
    dto
    │	├──> ActorDTO.go
    │ ...
    test
    │	├──> Actor_test.go
    │ ...
    │	├──> test.json
    ─────────────────────────────

Docker

# build docker image
docker build -t concept-api .
# run docker container 
docker run --rm -it -p 7070:7070 --env-file .env --network host concept-api

Concept

  • in standar you can find the expected result of the generator.

Contributing

PRs accepted.

License

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package database provides access to database schema metadata, for database/sql drivers.
Package database provides access to database schema metadata, for database/sql drivers.
modelgen-concept
concept-api Module
standar module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL