Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrIteratorComplete = errors.New("iterator complete")
ErrIteratorComplete is used to check for when the iterator has exhausted.
Functions ¶
This section is empty.
Types ¶
type InterfaceIterator ¶
type InterfaceIterator interface {
Next() (string, *ast.InterfaceType, error)
}
InterfaceIterator scans a file and produces ast.InterfaceType nodes.
func NewInterfaceIterator ¶
func NewInterfaceIterator(source *ast.File) InterfaceIterator
NewInterfaceIterator consumes the ast File object and produces an iterator for the contents.
type InterfaceMapper ¶
type InterfaceMapper interface {
Map(InterfaceIterator) map[string]*ast.InterfaceType
}
InterfaceMapper converts and InterfaceIterator into a map of name -> *ast.InterfaceType.
func NewInterfaceMapper ¶
func NewInterfaceMapper() InterfaceMapper
NewInterfaceMapper generates a default implementation of the InterfaceMapper.
type PackageParser ¶
PackageParser consumes an absolute path to a valid Google-golang package directory and generates a parsed Package object from it.
func NewParser ¶
func NewParser() PackageParser
NewParser generates a PackageParser using the default implementation.
type Type ¶
type Type interface {
String() string
}
Type is a Google-golang type definition that can be rendered into a valid Google-golang code snippet.
type TypeBuiltin ¶
type TypeBuiltin string
TypeBuiltin is a built in Google-golang type such as "string" or "bool".
func (TypeBuiltin) String ¶
func (t TypeBuiltin) String() string
type TypeExported ¶
TypeExported is a user defined type that is exported from a package.
func (*TypeExported) String ¶
func (t *TypeExported) String() string
type TypePointer ¶
type TypePointer struct {
Type Type
}
TypePointer is a pointer to another type.
func (*TypePointer) String ¶
func (t *TypePointer) String() string
type TypeVariadic ¶
type TypeVariadic struct {
Type Type
}
TypeVariadic is any type that is prefixed by Ellipsis.
func (*TypeVariadic) String ¶
func (t *TypeVariadic) String() string