Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Extractor ¶
type Extractor struct {
// contains filtered or unexported fields
}
Extractor 从源服务提取模块到目标服务
type Options ¶
type Options struct {
// 项目根路径
RootPath string
// 项目模块路径 (go.mod 中的 module)
ModulePath string
// 项目名称 (从 module path 提取的最后一段)
ProjectName string
// 源服务名
SourceService string
// 目标服务名
TargetService string
// 要提取的模型名列表 (单数形式, 如 "role", "user")
Models []string
// ORM 类型: "ent" | "gorm"
OrmType string
// 服务器类型 (用于创建新服务时): ["grpc"], ["grpc","rest"], ...
Servers []string
// 数据库客户端类型 (用于创建新服务时): ["ent"], ["gorm"], ...
DbClients []string
// 是否保留源文件(默认 false = 删除)
KeepSource bool
}
Options 提取选项
type Plan ¶ added in v1.0.2
type Plan struct {
SourceService string
TargetService string
OrmType string
Models []string
KeepSource bool
// TargetWillBeCreated 目标服务不存在,执行时会先创建服务脚手架。
TargetWillBeCreated bool
// CopyFiles 源 -> 目标复制(含 import 改写)。
CopyFiles []FileCopy
// ModifiedFiles 目标/源端就地修改的文件(装配登记、server 注册等)。
ModifiedFiles []string
// DeletedFiles !KeepSource 时将被删除的源端文件。
DeletedFiles []string
// Warnings 计划期发现的问题(如源文件缺失,执行时将失败)。
Warnings []string
}
Plan 一次提取将发生的文件动作(只读计算,不写盘、不删除)。
Click to show internal directories.
Click to hide internal directories.