ast

package
v0.0.0-...-533102b Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 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)

增加 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

查询特定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增加实参

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