Documentation ¶
Index ¶
- Variables
- func Walk(n ast.Node, fset *token.FileSet, h FileHandler)
- type CommentHandler
- type CommentSpec
- type DocHandler
- type DocSpec
- type FieldCollector
- type FieldHandler
- type FieldSpec
- type FieldTypeRef
- type FieldTypeRefKind
- type FileHandler
- type FileSpec
- type RootCollector
- type RootCollectorOption
- type T
- type TestTypeHandler
- type TypeCollector
- type TypeHandler
- type TypeSpec
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAstParse = errors.New("ast parse error") ErrFieldParse = fmt.Errorf("parse field: %w", ErrAstParse) )
Functions ¶
Types ¶
type CommentHandler ¶
type CommentHandler interface {
// contains filtered or unexported methods
}
type CommentSpec ¶
type DocHandler ¶
type DocHandler interface {
// contains filtered or unexported methods
}
type FieldCollector ¶
type FieldCollector struct {
// contains filtered or unexported fields
}
type FieldHandler ¶
type FieldHandler interface {
// contains filtered or unexported methods
}
type FieldSpec ¶
type FieldSpec struct { Names []string Doc string Tag string TypeRef FieldTypeRef Fields []*FieldSpec }
type FieldTypeRef ¶
type FieldTypeRef struct { Name string Pkg string Kind FieldTypeRefKind }
func (FieldTypeRef) String ¶
func (tr FieldTypeRef) String() string
type FieldTypeRefKind ¶
type FieldTypeRefKind int
const ( FieldTypeIdent FieldTypeRefKind = iota FieldTypeSelector FieldTypePtr FieldTypeArray FieldTypeMap FieldTypeStruct )
func (*FieldTypeRefKind) ScanStr ¶
func (r *FieldTypeRefKind) ScanStr(s string) bool
func (FieldTypeRefKind) String ¶
func (i FieldTypeRefKind) String() string
type FileHandler ¶
type FileHandler interface {
// contains filtered or unexported methods
}
type FileSpec ¶
type RootCollector ¶
type RootCollector struct {
// contains filtered or unexported fields
}
func NewRootCollector ¶
func NewRootCollector(baseDir string, opts ...RootCollectorOption) *RootCollector
func (*RootCollector) Files ¶
func (c *RootCollector) Files() []*FileSpec
type RootCollectorOption ¶
type RootCollectorOption func(*RootCollector)
func WithFileGlob ¶
func WithFileGlob(glob func(string) bool) RootCollectorOption
func WithGoGenDecl ¶
func WithGoGenDecl(line int, file string) RootCollectorOption
func WithTypeGlob ¶
func WithTypeGlob(glob func(string) bool) RootCollectorOption
type T ¶
type T interface { Helper() Fatal(args ...interface{}) Fatalf(format string, args ...interface{}) }
type TestTypeHandler ¶
type TestTypeHandler interface { TypeHandler CommentHandler Types() []*TypeSpec }
type TypeCollector ¶
type TypeCollector struct {
// contains filtered or unexported fields
}
type TypeHandler ¶
type TypeHandler interface {
// contains filtered or unexported methods
}
Click to show internal directories.
Click to hide internal directories.