package_parser

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseTypeDeclaration

func ParseTypeDeclaration(decl *ast.GenDecl) (*StructDeclaration, *InterfaceDeclaration)

Types

type FieldDeclaration

type FieldDeclaration struct {
	Name    *string
	VarType string
	Tag     reflect.StructTag
}

func ParseFieldDeclaration

func ParseFieldDeclaration(decl *ast.Field) *FieldDeclaration

func (FieldDeclaration) String

func (f FieldDeclaration) String() string

type Function

type Function struct {
	Name          string
	Doc           *string
	ArgumentTypes []*FieldDeclaration
	ReturnTypes   []*FieldDeclaration
	Receiver      *FunctionReceiver
	Body          string
}

func ParseFunction

func ParseFunction(decl *ast.FuncDecl) *Function

func (*Function) Declaration

func (f *Function) Declaration() string

func (*Function) Signature

func (f *Function) Signature() string

func (*Function) String

func (f *Function) String() string

type FunctionReceiver

type FunctionReceiver struct {
	Name     *string
	RecvType string
	// contains filtered or unexported fields
}

func (*FunctionReceiver) String

func (r *FunctionReceiver) String() string

type GoFile

type GoFile struct {
	// contains filtered or unexported fields
}

func ParseGoFile

func ParseGoFile(packagePath string, fileName string) (*GoFile, error)

func (*GoFile) GetFunctions

func (file *GoFile) GetFunctions() []*Function

func (*GoFile) GetStructs

func (file *GoFile) GetStructs() []*StructDeclaration

func (*GoFile) String

func (file *GoFile) String() string

type GoPackage

type GoPackage struct {
	// contains filtered or unexported fields
}

func ParsePackage

func ParsePackage(packageName string, packagePath string, ignoreGenerated bool) (*GoPackage, error)

func (*GoPackage) GetFile

func (pack *GoPackage) GetFile(fileName string) (*GoFile, error)

func (*GoPackage) GetFiles

func (pack *GoPackage) GetFiles() []*GoFile

func (*GoPackage) GetFunctions

func (pack *GoPackage) GetFunctions() []*Function

func (*GoPackage) GetName

func (pack *GoPackage) GetName() string

func (*GoPackage) GetReceiverFunctions

func (pack *GoPackage) GetReceiverFunctions(recieverName string) []*Function

func (*GoPackage) GetStructs

func (pack *GoPackage) GetStructs() []*StructDeclaration

func (*GoPackage) String

func (pack *GoPackage) String() string

type Import

type Import struct {
	// contains filtered or unexported fields
}

func ParseImport

func ParseImport(imp *ast.ImportSpec) *Import

func (*Import) String

func (i *Import) String() string

type InterfaceDeclaration

type InterfaceDeclaration struct {
	Name string
	Doc  *string
}

func (*InterfaceDeclaration) String

func (s *InterfaceDeclaration) String() string

type StructDeclaration

type StructDeclaration struct {
	Name      string
	Doc       *string
	Variables []*FieldDeclaration
}

func (*StructDeclaration) String

func (s *StructDeclaration) String() string

Jump to

Keyboard shortcuts

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