program

package
v0.0.0-...-dc6a6cc Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainType

func ContainType(name string, types []*ast.TypeSpec) bool

func ExtractStruct

func ExtractStruct(node ast.Node, sub *[]*ast.TypeSpec)

ExtractStruct extract struct spec to all type spec it depends (including itself)

func FindMatchStruct

func FindMatchStruct(files []*ast.File, match FuncMatchStruct) []*ast.TypeSpec

func GetStructByName

func GetStructByName(f *ast.File, structName string) (*ast.TypeSpec, error)

Types

type FuncMatchStruct

type FuncMatchStruct func(structName string) bool

type Program

type Program struct {
	*loader.Program
}

func NewProgram

func NewProgram(pkgs []string) (*Program, error)

func (*Program) ExtractStruct

func (p *Program) ExtractStruct(node ast.Node, sub *[]*ast.TypeSpec)

ExtractStruct extract struct spec to all type spec it depends (including itself)

func (*Program) GetFuncByName

func (p *Program) GetFuncByName(pkgName, funcName string) (*ast.FuncDecl, error)

func (*Program) GetPkgByName

func (p *Program) GetPkgByName(name string) (*loader.PackageInfo, error)

func (*Program) GetStructByName

func (p *Program) GetStructByName(pkgName, structName string) (typeSpec *ast.TypeSpec, err error)

func (*Program) GetStructByNameFromPkgs

func (p *Program) GetStructByNameFromPkgs(pkgs []string, structName string) (*ast.TypeSpec, error)

func (*Program) GetValueByName

func (p *Program) GetValueByName(pkgName, valueName string) (*ast.ValueSpec, error)

Jump to

Keyboard shortcuts

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