Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConcreteType ¶
type ConcreteType struct {
Package string `json:"Package"`
Name string `json:"Name"`
BaseType string `json:"BaseType"`
Fields map[string]string `json:"Fields"`
Methods []Method `json:"Methods"`
}
ConcreteType represents a defined type with methods on it, regardless of the base type.
type Interface ¶
type Interface struct {
Package string `json:"Package"`
Name string `json:"Name"`
BaseType string `json:"BaseType"`
Methods []Method `json:"Methods"`
}
Interface holds the information about an interface including what methods it requires.
type Method ¶
type Method struct {
Package string `json:"Package"`
Receiver string `json:"Receiver"`
Name string `json:"Name"`
Parameters []string `json:"Parameters"`
ReturnValues []string `json:"ReturnValues"`
}
Method is a type to hold all the information needed to associate a method with a type
type Typer ¶
type Typer struct {
// contains filtered or unexported fields
}
Typer can parse go files to extract the types from the file and extract all the information about each type including fields, methods, and signatures.
func NewTyper ¶
func NewTyper() *Typer
NewTyper returns an already initialized Typer, ready to parse files.
func (*Typer) GetConcreteTypes ¶
func (t *Typer) GetConcreteTypes() []ConcreteType
GetConcreteTypes returns the ConcreteTypes that Typer has parsed so far
func (*Typer) GetInterfaces ¶
GetInterfaces returns the Interfaces that Typer has parsed so far
func (*Typer) GetMethods ¶
GetMethods returns the Methods that Typer has parsed so far
func (*Typer) ResolveMethods ¶
func (t *Typer) ResolveMethods()
ResolveMethods takes the methods that have already been parsed and associate them with their respective receivers