module

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package module provides the functions to merge the code of two files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseErrorCode

func ParseErrorCode(srcFile string, genFile string) (*patch.ErrorCodeOffsetAst, bool, error)

ParseErrorCode parse error code from srcFile and genFile, and merge them.

Types

type CodeAst

type CodeAst struct {
	FilePath string
	SrcCode  string
	FileSize int
	AstInfos []*goast.AstInfo
	// contains filtered or unexported fields
}

CodeAst is the struct for code

func NewCodeAst

func NewCodeAst(filePath string) (*CodeAst, error)

func ParseGRPCMethodsTestAndBenchmarkCode

func ParseGRPCMethodsTestAndBenchmarkCode(srcFile string, genFile string) (*CodeAst, error)

ParseGRPCMethodsTestAndBenchmarkCode parses the source code and generated code of the service file

func ParseHandlerAndServiceCode

func ParseHandlerAndServiceCode(srcFile string, genFile string) (*CodeAst, error)

ParseHandlerAndServiceCode parses the source code and generated code of the handler and service file,

type RouterCodeAst

type RouterCodeAst struct {
	FilePath string
	SrcCode  string
	FileSize int
	AstInfos []*goast.AstInfo
	// contains filtered or unexported fields
}

RouterCodeAst is the struct for router code

func NewRouterCodeAst

func NewRouterCodeAst(filePath string) (*RouterCodeAst, error)

func ParseRouterCode

func ParseRouterCode(srcFile string, genFile string) (*RouterCodeAst, error)

ParseRouterCode parse router code from source and generated file, and merge them.

func (*RouterCodeAst) CompareExistedMiddlewareFunc

func (a *RouterCodeAst) CompareExistedMiddlewareFunc(genAst *RouterCodeAst) error

CompareExistedMiddlewareFunc compare the existed middlewareFunc in the source code and generated code, and find the non-existed singlePaths

func (*RouterCodeAst) FindNonExistedName

func (a *RouterCodeAst) FindNonExistedName(genAsts []*goast.AstInfo)

FindNonExistedName find non-existed names in the src code

Jump to

Keyboard shortcuts

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