Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FieldProcessor ¶
type FieldProcessor interface {
Process(n *types.Named, f *types.Var, tag string, comment string, parentFields ...string) error
}
FieldProcessor takes all information related to a field and processes it.
type FieldProcessorChain ¶
type FieldProcessorChain []FieldProcessor
FieldProcessorChain runs multiple FieldProcessor in order.
type NamedProcessor ¶
NamedProcessor takes a named struct with its comments and processes it. For example, you might want to take an action depending on its comments or make an in-place change on the *types.Named object if it satisfies certain criteria.
type NamedProcessorChain ¶
type NamedProcessorChain []NamedProcessor
NamedProcessorChain runs multiple NamedProcessors in order.
type ProcessorConfig ¶
type ProcessorConfig struct { Named NamedProcessor Field FieldProcessor }
ProcessorConfig lets you configure what processors will be run in given traversal.
type Traverser ¶
type Traverser struct {
// contains filtered or unexported fields
}
Traverser goes through all fields of given type recursively. It runs the field processor for every field and named processor for every type it encounters during its depth-first traversal.
func NewTraverser ¶
NewTraverser returns a new Traverser.