-
Notifications
You must be signed in to change notification settings - Fork 0
Features added for kratos
leanfra edited this page Nov 30, 2024
·
2 revisions
- generate model struct code under
internal/biz
for each service
- For the message with the specific comment in the proto file (see option
-c
), generate the corresponding golang struct code in specific file(set option-m
).
- generate biz code under
internal/biz
for each service
- Generate the corresponding biz/usecase layer code based on RPC service.
- Also including
Repo
interface need implemented in data layer.
- generate data code under
internal/data
for each service
- Generate the corresponding data layer code based on RPC service.
- add overwrite flag
- Enable force overwrite the existing files.
❯ gratos proto server --help
Generate the proto server implementations. Example: kratos proto server api/xxx.proto --target-dir=internal/service
Usage:
kratos proto server [flags]
Flags:
-b, --biz-dir string generated biz directory. one file per service (default "internal/biz")
-d, --data-dir string generated data directory. one file per service (default "internal/data")
-h, --help help for server
-c, --model-comment string comment tag to message converted to model (default "gratos::model")
-m, --model-file string generated model file under biz directory (default "models.go")
-f, --over-write force over write existed file
-t, --service-dir string generated service directory. one file per service (default "internal/service")