ast

package
v0.0.0-...-b40fde2 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 15 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, dbName, model string)

AddRegisterTablesAst 自动为 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

NeedAppendModel 为automigrate增加实参

func RollBackAst

func RollBackAst(pk, model string)

func RollGormBack

func RollGormBack(pk, model string)

func RollRouterBack

func RollRouterBack(pk, model string)

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