Documentation ¶
Overview ¶
Package inspector hosts the interfaces which analyses existing go source files and fetches interface commands and variable setup.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AstInterface ¶
type AstInterface struct { InterfaceReference *ast.InterfaceType Docs *ast.CommentGroup Name *ast.Ident File *AstFile }
AstInterface is a simple struct describing an interface
type AstStream ¶
AstStream is a stream of nodes that can be inspected and transformed
func NewAstStream ¶
func NewAstStream(fileStream *FileStream) (astStream *AstStream)
NewAstStream creates a new ast stream instance
func (*AstStream) Find ¶
func (a *AstStream) Find() []*AstInterface
Find returns the interfaces declared in the given AstStream
type AstVariable ¶
type AstVariable struct { ValueReference *ast.ValueSpec Docs *ast.CommentGroup }
AstVariable is a variable that represents a variable
type FileStream ¶
type FileStream struct {
Files []File
}
FileStream defines a stream of files based on a provided file supplier
func NewFileStream ¶
func NewFileStream(path string) (stream *FileStream, e error)
NewFileStream creates a new file stream based on the provided paths
func (*FileStream) Filter ¶
func (f *FileStream) Filter(filter func(file File) bool) *FileStream
Filter filters the file stream and removes all files that don't match the filter
func (*FileStream) ForEach ¶
func (f *FileStream) ForEach(consumer func(file File))
ForEach executes the consumer for each file in the stream