extract

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectOrmType

func DetectOrmType(servicePath string) string

DetectOrmType 自动检测源服务使用的 ORM 类型

Types

type Extractor

type Extractor struct {
	// contains filtered or unexported fields
}

Extractor 从源服务提取模块到目标服务

func NewExtractor

func NewExtractor(opts Options) *Extractor

NewExtractor 创建提取器

func (*Extractor) Run

func (e *Extractor) Run() error

Run 执行提取

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 提取选项

Jump to

Keyboard shortcuts

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