gen/

directory
v1.7.6 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0

README

DB Code generator

This package is used to generate the repository code for relation database.

Usage

The repository code can be generated by the following code.

db-code-genv2 -domain ./dbv2/gen/example/domain -persist ./dbv2/gen/example/persistence -model Income -repo IncomeRepository"

  • domain is the path of the domain package, which stores the domain struct and the repository interface.
  • persist is the path of the persistence package, which stores the entity and the repositoy.
  • model is the name of the domain struct.
  • repo is the name of the name of the repository interface.

For developer

  • The code package is used to extrat component from exist code. It will parse structs, interfaces and methods exist.
  • The generator is the controller to generate code.
  • The spec will consume the structs, interfaces and methods extracted in step 1, and create the specifices for generate code.
  • The gorm package is specific generator for generate code for gorm.

References

[1] repogen

Directories

Path Synopsis
example
persistence
Package persistence.
Package persistence.
gorm

Jump to

Keyboard shortcuts

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