ast

package
v0.0.0-...-1d1ce7e Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddImport

func AddImport(astNode ast.Node, imp string)

AddImport 增加 import 方法

func AddRegisterTablesAst

func AddRegisterTablesAst(path, funcName, pk, varName, dbName, model string)

自动为 gorm.go 注册一个自动迁移

func AddRouterCode

func AddRouterCode(path, funcName, pk, model string)

func AppendNodeToList

func AppendNodeToList(stmts []ast.Stmt, stmt ast.Stmt, index int) []ast.Stmt

func FindFunction

func FindFunction(astNode ast.Node, FunctionName string) *ast.FuncDecl

FindFunction 查询特定function方法

func ImportForAutoEnter

func ImportForAutoEnter(path string, funcName string, code string)

func ImportReference

func ImportReference(filepath, importCode, structName, packageName, groupName string) error

func NeedAppendModel

func NeedAppendModel(callNode ast.Node, pk string, model string) bool

为automigrate增加实参

Types

type Visitor

type Visitor struct {
	ImportCode  string
	StructName  string
	PackageName string
	GroupName   string
}

func (*Visitor) Visit

func (vi *Visitor) Visit(node ast.Node) ast.Visitor

Jump to

Keyboard shortcuts

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