astutils

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FixImport added in v0.1.4

func FixImport(src []byte, file string)

func GetImportPath

func GetImportPath(file string) string

func GetMod

func GetMod() string

func Visit

func Visit(files *[]string) filepath.WalkFunc

Types

type FieldMeta

type FieldMeta struct {
	Name     string
	Type     string
	Tag      string
	Comments []string
}

type InterfaceCollector added in v0.1.4

type InterfaceCollector struct {
	Interfaces []InterfaceMeta
	Package    PackageMeta
}

func (*InterfaceCollector) Collect added in v0.1.4

func (sc *InterfaceCollector) Collect(n ast.Node) ast.Visitor

func (*InterfaceCollector) Visit added in v0.1.4

func (ic *InterfaceCollector) Visit(n ast.Node) ast.Visitor

type InterfaceMeta added in v0.1.4

type InterfaceMeta struct {
	Name     string
	Methods  []MethodMeta
	Comments []string
}

type MethodMeta added in v0.1.4

type MethodMeta struct {
	Name     string
	Params   []FieldMeta
	Results  []FieldMeta
	Comments []string
}

type PackageMeta

type PackageMeta struct {
	Name string
}

type StructCollector

type StructCollector struct {
	Structs []StructMeta
	Methods map[string][]MethodMeta
	Package PackageMeta
}

func NewStructCollector added in v0.2.1

func NewStructCollector() *StructCollector

func (*StructCollector) Collect

func (sc *StructCollector) Collect(n ast.Node) ast.Visitor

func (*StructCollector) FlatEmbed

func (sc *StructCollector) FlatEmbed() []StructMeta

Only for ddl tool

func (*StructCollector) Visit

func (sc *StructCollector) Visit(n ast.Node) ast.Visitor

type StructMeta

type StructMeta struct {
	Name     string
	Fields   []FieldMeta
	Comments []string
	Methods  []MethodMeta
}

Jump to

Keyboard shortcuts

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