analyzer

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBaseInterface

func GetBaseInterface(layer Layer) string

GetBaseInterface 获取层对应的基础接口

func GetContainerName

func GetContainerName(layer Layer) string

GetContainerName 获取容器名称

func GetRegisterFunction

func GetRegisterFunction(layer Layer) string

GetRegisterFunction 获取注册函数名

func IsLitecoreLayer

func IsLitecoreLayer(layer Layer) bool

IsLitecoreLayer 判断是否为 Litecore 标准层

Types

type Analyzer

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

Analyzer 代码分析器

func NewAnalyzer

func NewAnalyzer(projectPath, moduleName string) *Analyzer

NewAnalyzer 创建分析器

func (*Analyzer) Analyze

func (a *Analyzer) Analyze() (*ProjectInfo, error)

Analyze 分析项目

type ComponentInfo

type ComponentInfo struct {
	InterfaceName string
	InterfaceType string
	PackagePath   string
	FileName      string
	FactoryFunc   string
	Layer         Layer
}

ComponentInfo 组件信息

type Layer

type Layer string

Layer 表示代码分层

const (
	LayerEntity     Layer = "entity"
	LayerRepository Layer = "repository"
	LayerService    Layer = "service"
	LayerController Layer = "controller"
	LayerMiddleware Layer = "middleware"
	LayerListener   Layer = "listener"
	LayerScheduler  Layer = "scheduler"
)

type ProjectInfo

type ProjectInfo struct {
	ModuleName  string
	PackagePath string
	ConfigPath  string
	Layers      map[Layer][]*ComponentInfo
}

ProjectInfo 项目信息

Jump to

Keyboard shortcuts

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