Skip to content

this is a related repository to github.com/ar-mokhtari/orginfo for domain generatre cli tool ...

License

Notifications You must be signed in to change notification settings

ar-mokhtari/orginfo-generator

Repository files navigation

orgInfo-generator

backend (Golang)


go version 

orginfo-generator is a generator tool, which create a back-end structure

Powered by

cgapp logo

please notice me if you have any other idea ...

Gmail Telegram

Quick Construction (Ubuntu 22.04.1 LTS)


  1. install go from official website https://go.dev/
  2. set $GOROOT:/usr/local/go/bin & $GOPATH/src: ~/go/src
  3. run project_creator
you can find default of file in this address: [sample structure](input_struct.json)

Domain generator


to create new domain with CRUD operation and other prerequisite:
go get -u github.com/ar-mokhtari/orginfo-generator
cd ~/go/src &&
project_name="myproject" &&
mkdir -p -m777 $project_name/cli/generator &&
echo "package main

import \"github.com/ar-mokhtari/orginfo-generator\"

func main() {
   generator.New()
}

" > $project_name/cli/generator/main.go &&
  > $project_name/go.mod && cd $project_name/cli/generator  && go mod tidy &&  go get -u github.com/ar-mokhtari/orginfo-generator && go build && export GO111MODULE="off" && go get ./. && export GO111MODULE="auto" && go mod tidy

pattern #1
input from command and flag one by one:
 cd go/src/$project_name/cli/generator/bin
./generator sub-command -domain_name="DOMAIN NAME" -fields="field1-string-field1_1,field2-uint-field1_2,..." && go mod tidy

run this for add a new domain:

./generator new -domain_name="DOMAIN_NAME" -fields="codeType-uint-code_type,code-uint-code" && go mod tidy

Also, to remove a domain run this:

./generator delete -domain_name="DOMAIN_NAME" && go mod tidy
pattern #2
import domain(s) from json type file ...
./generator new -from_file && go mod tidy
remove domain(s) from json type file ...
./generator delete -from_file && go mod tidy
the file name must be: `input.json`. in this address: `/config/cli/generator/`
you can find default of file in this address: [sample structure](input_struct.json)
[
  {
    "domain_name": "string",
    "fields": [
      {
        "name": "string",
        "type": "string",
        "json_name": "string"
      }
    ]
  }
]
generator.mp4

Json collection

To use and call from API platform like "Postman":
/docs/orginfo.postman_collection.json

Git


git 

for continue on existing repo:

cd existing_repo
git remote add origin `git address`
git branch -M main
git push -uf origin main

for clone

 git clone [email protected]:ar-mokhtari/orginfo.git

for production, there is stable main branch:

 git checkout main
 

for develop:

 git checkout -b developing
 

after all, back to main:

 git merge --no-ff developing
 

Docker (compose)


 

for detail see: docker-compose.yaml

docker compose up -d

About

this is a related repository to github.com/ar-mokhtari/orginfo for domain generatre cli tool ...

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published