myasthurts

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2019 License: MIT Imports: 3 Imported by: 0

README

go-my-ast-hurts

A helper for dealing with Go AST

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(file *ast.File, definitions *Environment)

Types

type Constant

type Constant struct {
	Name string
	Type Type
}

type Environment

type Environment struct {
	Packages []*Package
}

type Field

type Field struct {
	Name    string
	Type    *RefType
	Tag     Tag
	Comment string
}

type File

type File struct {
	Package    *Package
	FileName   string
	Comment    string
	Variables  []*Variable
	Constants  []*Constant
	Structs    []*Struct
	Interfaces []*Interface
	Files      []*File
}

type Interface

type Interface struct {
	Methods []MethodDescriptor
	Comment string
	// contains filtered or unexported fields
}

func NewInterface

func NewInterface(pkg *Package, name string) *Interface

func (*Interface) Name

func (i *Interface) Name() string

func (*Interface) Package

func (i *Interface) Package() *Package

type MethodArgument

type MethodArgument struct {
	Name string
	Type *RefType
}

type MethodDescriptor

type MethodDescriptor struct {
	Comment   string
	Recv      []MethodArgument
	Arguments []MethodArgument
	Result    []MethodResult
	Tag       Tag
	// contains filtered or unexported fields
}

func NewMethodDescriptor

func NewMethodDescriptor(pkg *Package, name string) *MethodDescriptor

func (*MethodDescriptor) Name

func (method *MethodDescriptor) Name() string

func (*MethodDescriptor) Package

func (method *MethodDescriptor) Package() *Package

type MethodResult

type MethodResult struct {
	Name string
	Type Type
}

type Package

type Package struct {
	Name        string
	Comment     string
	Directory   string
	Variables   []*Variable
	Constants   []*Constant
	Methods     []*MethodDescriptor
	Structs     []*Struct
	Interfaces  []*Interface
	RefType     []*RefType
	Types       []Type
	Files       []*File
	Parent      *Package
	Subpackages []*Package
}

type RefType

type RefType struct {
	Name string
	Pkg  []*Package
	Type []Type
}

func NewRefType

func NewRefType(pkg *Package) *RefType

type Struct

type Struct struct {
	Comment    string
	Fields     []*Field
	Methods    []*StructMethod
	Interfaces []*Interface
	// contains filtered or unexported fields
}

func NewStruct

func NewStruct(pkg *Package, name string) *Struct

func (*Struct) Name

func (s *Struct) Name() string

func (*Struct) Package

func (s *Struct) Package() *Package

type StructMethod

type StructMethod struct {
	Descriptor *MethodDescriptor
}

type Tag

type Tag struct {
	Raw    string
	Params []TagParam
}

type TagParam

type TagParam struct {
	Name    string
	Value   string
	Options []string
}

type Type

type Type interface {
	Package() *Package
	Name() string
}

type Variable

type Variable struct {
	Name string
	Type *RefType
}

Jump to

Keyboard shortcuts

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