schema

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Structs = []Struct{}

Functions

func DetectInstanceCall

func DetectInstanceCall(expr ast.Expr, calls []platform.InstanceCall) bool

Types

type APIParam

type APIParam struct {
	StructName string
}

type APIResopnse

type APIResopnse struct {
	Code       string
	StructName string
}

type GinAPI

type GinAPI struct {
	Source      *SourceFile
	Group       string
	Method      string
	Path        string
	Node        *ast.Node
	APIParam    *APIParam
	APIResopnse []*APIResopnse
}

func NewGinRoute

func NewGinRoute() *GinAPI

type GinIdentifier

type GinIdentifier struct {
	Source         *SourceFile
	InstancingCall *ast.CallExpr
	Node           *ast.Ident
	Calls          []*ast.CallExpr
}

func NewGinIdentifier

func NewGinIdentifier() *GinIdentifier

func (*GinIdentifier) AddCall

func (g *GinIdentifier) AddCall(call *ast.CallExpr) bool

func (*GinIdentifier) Equal

func (g *GinIdentifier) Equal(another *GinIdentifier) bool

type Schema

type Schema struct {
	ModuleFilePath string
	ModulePath     string

	SourceFile     []SourceFile
	GinIdentifiers []*GinIdentifier
	GinAPIs        []*GinAPI
	// contains filtered or unexported fields
}
var ProjSchema *Schema

func NewSchema

func NewSchema(modFilePath string) *Schema

func (*Schema) AddGinIdentifier

func (s *Schema) AddGinIdentifier(source *SourceFile, ident *GinIdentifier) bool

func (*Schema) GinIdentifierWithFileIdent

func (s *Schema) GinIdentifierWithFileIdent(source *SourceFile, callExpr *ast.CallExpr) *GinIdentifier

func (*Schema) LoadSourceFiles

func (schema *Schema) LoadSourceFiles() (err error)

func (*Schema) ParseModules

func (schema *Schema) ParseModules(filename string) (err error)

type SourceFile

type SourceFile struct {
	FullPath string
	Path     string
	PkgPath  string
	Imports  []*ast.ImportSpec
	FileSet  *token.FileSet
	AstFile  *ast.File
	Content  []byte

	Decls map[string]string

	GinIdents []*ast.Ident
	// contains filtered or unexported fields
}

func (*SourceFile) BuildStacks

func (f *SourceFile) BuildStacks()

func (*SourceFile) EnumerateGinBind

func (f *SourceFile) EnumerateGinBind(Lbrace, Rbrace int) (paramName string)

func (*SourceFile) EnumerateGinHandles

func (f *SourceFile) EnumerateGinHandles()

func (*SourceFile) EnumerateGinResponse

func (f *SourceFile) EnumerateGinResponse(Lbrace, Rbrace int) (codes, structNames []string)

func (*SourceFile) EnumerateGinRoute

func (f *SourceFile) EnumerateGinRoute(groupRoute string, Lbrace, Rbrace int)

func (*SourceFile) EnumerateLazy

func (f *SourceFile) EnumerateLazy(prefix string, Lbrace, Rbrace int) (paths, methods, codes, structNames []string)

func (*SourceFile) EnumerateLazyModel

func (f *SourceFile) EnumerateLazyModel(Lbrace, Rbrace int) (modelname string)

func (*SourceFile) EnumerateStructAndGinVars

func (f *SourceFile) EnumerateStructAndGinVars()

func (*SourceFile) Equal

func (f *SourceFile) Equal(another *SourceFile) bool

func (*SourceFile) FindCallLIdent

func (f *SourceFile) FindCallLIdent(callIndex int) ast.Node

/ast.Ident

func (*SourceFile) FindGinInstance

func (f *SourceFile) FindGinInstance()

func (*SourceFile) NodeIndex

func (f *SourceFile) NodeIndex(node ast.Node) int

func (*SourceFile) ParseFile

func (f *SourceFile) ParseFile() error

func (*SourceFile) PrintNode

func (f *SourceFile) PrintNode(callIndex int)

func (*SourceFile) StacksLength

func (f *SourceFile) StacksLength() int

type Struct

type Struct struct {
	FullPath string
	Name     string
	TypePos  int
	NamePos  int
	AstFile  *ast.File
	Node     *ast.Node
}

Jump to

Keyboard shortcuts

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