parser

package
v0.2.31 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InterfaceInfo

type InterfaceInfo struct {
	Name        string
	Doc         string
	Methods     []*Method
	Package     string
	ApplyStruct []string
}

InterfaceInfo ...

func (*InterfaceInfo) IsMatchStruct

func (i *InterfaceInfo) IsMatchStruct(name string) bool

type InterfacePath

type InterfacePath struct {
	Name     string
	FullName string
	Files    []string
	Package  string
}

func GetInterfacePath

func GetInterfacePath(v interface{}) (paths []*InterfacePath, err error)

GetInterfacePath get interface's directory path and all files it contains

type InterfaceSet

type InterfaceSet struct {
	Interfaces []InterfaceInfo
}

InterfaceSet ...

func (*InterfaceSet) ParseFile

func (i *InterfaceSet) ParseFile(paths []*InterfacePath, structNames []string) error

ParseFile get interface's info from source file

func (*InterfaceSet) Visit

func (i *InterfaceSet) Visit(n ast.Node) (w ast.Visitor)

Visit ast visit function

type Method

type Method struct {
	MethodName string
	Doc        string
	Params     []Param
	Result     []Param
}

Method interface's method

type Param

type Param struct {
	PkgPath   string // package's path: internal/model
	Package   string // package's name: model
	Name      string // param's name: user
	Type      string // param's type: User
	IsArray   bool   // is array or not
	IsPointer bool   // is pointer or not
}

Param parameters in method

func (*Param) AllowType

func (p *Param) AllowType() bool

func (*Param) Eq

func (p *Param) Eq(q Param) bool

func (*Param) InMainPkg

func (p *Param) InMainPkg() bool

func (*Param) IsError

func (p *Param) IsError() bool

func (*Param) IsGenM

func (p *Param) IsGenM() bool

func (*Param) IsGenRowsAffected

func (p *Param) IsGenRowsAffected() bool

func (*Param) IsGenT

func (p *Param) IsGenT() bool

func (*Param) IsInterface

func (p *Param) IsInterface() bool

func (*Param) IsMap

func (p *Param) IsMap() bool

func (*Param) IsNull

func (p *Param) IsNull() bool

func (*Param) IsTime

func (p *Param) IsTime() bool

func (*Param) SetName

func (p *Param) SetName(name string)

func (*Param) TypeName

func (p *Param) TypeName() string

Jump to

Keyboard shortcuts

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