astinfo

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPrimitive

func IsPrimitive(t string) bool

Types

type Annotation

type Annotation struct {
	Key    string
	Values []string
}

type Dir

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

A Dir describes a directory holding code by specifying the expected import path and the file system directory.

type Field

type Field struct {
	Name        string
	Type        string
	Annotations []Annotation
}

type Kind

type Kind string
const (
	Interface Kind = "interface"
	Struct    Kind = "struct"
	Alias     Kind = "alias" // type localType AnotherType
)

type Method

type Method struct {
	Name        string
	Params      []Field
	Results     []Field
	Annotations []Annotation
}

type Package

type Package struct {
	Build         *build.Package
	PkgImportPath string
	PkgName       string
	Types         map[string]*Type
}

func ParseDir

func ParseDir(path string) (*Package, error)

func ParsePkg

func ParsePkg(pkg *ast.Package, buildPkg *build.Package) (*Package, error)

type Type

type Type struct {
	Name        string
	Kind        Kind
	Annotations []Annotation

	// only for Struct
	Fields []Field

	// only for Interface
	Methods []Method
}

Jump to

Keyboard shortcuts

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