parse

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractTypes added in v0.2.0

func ExtractTypes(pkg *packages.Package) map[string]*StructDecl

ExtractTypes extracts types information from a package.

Types

type AstSchema

type AstSchema struct {
	ModulePath string
	Packages   map[string]Dependencies
}

AstSchema is a simpler presentation of the ast of a project.

func Parse

func Parse(pathDir string) (AstSchema, error)

Parse parses the project located under pathDir and returns an AstSchema.

type Dep

type Dep struct {
	PackageName    string
	DependencyName string
	VarName        string
	Funcs          []string
	External       bool
}

Dep represent one dependency injected.

type Dependencies

type Dependencies map[string]Dependency

Dependencies contains all the dependencies of a package.

type Dependency

type Dependency struct {
	Methods      []string
	Comment      string
	Imports      []Import
	Deps         map[string][]Dep
	ExternalDeps map[string][]Dep
}

Dependency represent a type that has been identified as a dependency.

type Import added in v0.1.0

type Import struct {
	Path     string
	External bool
}

Import represent an imported package.

type StructDecl added in v0.2.0

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

Jump to

Keyboard shortcuts

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