common

package
v0.0.0-...-356c9a7 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DocPrefix = "//inject:"

Functions

func Gen

func Gen(path string, afterPath string, packet string, interceptors []*Interceptor) map[string]*ast.ImportSpec

func GetGenerateImportPackage

func GetGenerateImportPackage(workdir string) []string

func GetProjectPackageName

func GetProjectPackageName(projectDir string) string

func GetTyperStructIdent

func GetTyperStructIdent(typer ast.Expr) (*ast.Ident, bool)

func ParseProjectMod

func ParseProjectMod(projectDir string) *modfile.File

func WalkGoFile

func WalkGoFile(basePackage string, callback func(path string, info os.FileInfo) error) error

Types

type Interceptor

type Interceptor struct {
	InterceptorName string
	StructType      string
	StructTypePoint bool
	StructName      string
	MethodName      string
	MethodResults   []*InterceptorResult
	Params          []*InterceptorParam

	Imports []*ast.ImportSpec
	Body    *ast.BlockStmt
	Results *ast.FieldList

	Mods []module.Version
}

func GenInterceptor

func GenInterceptor(node *ast.File) []*Interceptor

type InterceptorParam

type InterceptorParam struct {
	Name  []string
	Typer string
	Point bool
}

type InterceptorResult

type InterceptorResult struct {
	Name  []string
	Typer string
	Point bool
}

Jump to

Keyboard shortcuts

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