analyzer

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APISpecification

type APISpecification struct {
	FilePath    string
	ServiceName string
	Endpoints   []Endpoint
	Types       []string
}

func ParseAPISpecification

func ParseAPISpecification(apiFile string) (*APISpecification, error)

type ConfigFile

type ConfigFile struct {
	Path string
	Type string // "yaml", "json", "toml"
}

ConfigFile represents a configuration file

type DatabaseModel

type DatabaseModel struct {
	TableName  string
	Fields     []ModelField
	PrimaryKey string
}

func ParseTableSchema

func ParseTableSchema(ddl string) (*DatabaseModel, error)

func (*DatabaseModel) GetFieldNames

func (m *DatabaseModel) GetFieldNames() []string

type Dependency

type Dependency struct {
	Name    string
	Version string
	Type    string // "direct" or "indirect"
}

Dependency represents a project dependency

type Endpoint

type Endpoint struct {
	Method   string
	Path     string
	Handler  string
	Request  string
	Response string
}

type EndpointInfo

type EndpointInfo struct {
	Method  string
	Path    string
	Handler string
}

EndpointInfo represents an API endpoint

type ModelField

type ModelField struct {
	Name    string
	Type    string
	Tag     string
	Comment string
}

type ProjectAnalysis

type ProjectAnalysis struct {
	ProjectPath  string
	Services     []ServiceInfo
	Dependencies []Dependency
	Configs      []ConfigFile
	Summary      ProjectSummary
}

ProjectAnalysis represents a comprehensive analysis of a go-zero project

func ScanProject

func ScanProject(projectPath string) (*ProjectAnalysis, error)

ScanProject analyzes a go-zero project directory

type ProjectSummary

type ProjectSummary struct {
	TotalServices     int
	APIServices       int
	RPCServices       int
	ModelServices     int
	TotalEndpoints    int
	TotalRPCMethods   int
	TotalDependencies int
	GoZeroVersion     string
}

ProjectSummary provides high-level statistics

type RPCMethod

type RPCMethod struct {
	Name     string
	Request  string
	Response string
	Stream   string
}

type RPCMethodInfo

type RPCMethodInfo struct {
	Name     string
	Request  string
	Response string
	Stream   bool
}

RPCMethodInfo represents an RPC method

type RPCService

type RPCService struct {
	FilePath    string
	ServiceName string
	Methods     []RPCMethod
	Messages    []string
}

func ParseProtoSpecification

func ParseProtoSpecification(protoFile string) (*RPCService, error)

type ServiceInfo

type ServiceInfo struct {
	Name       string
	Type       string // "api", "rpc", or "model"
	Path       string
	SpecFile   string
	Endpoints  []EndpointInfo
	RPCMethods []RPCMethodInfo
}

ServiceInfo represents information about a service in the project

Jump to

Keyboard shortcuts

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