Versions in this module Expand all Collapse all v0 v0.1.0 Jan 18, 2021 Changes in this version + const EngineName + const TemplateFile + const Tips + var DefaultFileName = "route.entry.go" + func AddImport(f *ast.File, im string) + func GenAssign(path, pPath string, mids *[]MWTuple) *ast.AssignStmt + func GenTemplate() *ast.File + func Generate(dirList ...string) + func TraverseRawFuncList(list *[]RawFunc, h *[]HandlerFunc, m map[string]*MiddlewareFunc, ...) + func WalkFileTree(from *FileTreeNode, to *[]RawFunc) + type FileTreeNode struct + Children []*FileTreeNode + Files map[string]*ast.File + PackagePath string + func LoadFileTree(dir string) *FileTreeNode + func NewEmptyFileTree() *FileTreeNode + type Func interface + ParseRawFunc func() Func + type GenContext struct + GroupPool map[string]*GroupTree + MiddlePool map[string]*MiddlewareFunc + Root *GroupTree + func (ctx *GenContext) InitGroupTree(middles map[string]*MiddlewareFunc, handles *[]HandlerFunc) + func (ctx *GenContext) PutHandler(h *HandlerFunc) + func (ctx *GenContext) PutMiddleware(m *MiddlewareFunc) + type GroupTree struct + AbsPath string + Children map[string]*GroupTree + Ctx *GenContext + Handlers []*HandlerFunc + Middles []MWTuple + Parent *GroupTree + Path string + func NewGroupTreeNode(path, absPath string, ctx *GenContext, parent *GroupTree) *GroupTree + func (node *GroupTree) GenAST() []ast.Stmt + type HandlerFunc struct + Group *GroupTree + GroupArray []string + Method string + Middles []*MiddlewareFunc + Need []string + RelativePath string + func (h *HandlerFunc) GenAST() *ast.ExprStmt + type MWTuple struct + M *MiddlewareFunc + W int + type MiddlewareFunc struct + Group map[string]int + ID string + type RawFunc struct + Comment string + Package string + PackagePath string + Signature string + func (f RawFunc) ParseRawFunc() Func