Documentation ¶
Overview ¶
nolint
Index ¶
- Variables
- func CloneRefOfBool(n *bool) *bool
- func CloneSliceOfInt(n []int) []int
- func VisitAST(in AST, f Visit) error
- func VisitBasicType(in BasicType, f Visit) error
- func VisitBytes(in Bytes, f Visit) error
- func VisitInterfaceContainer(in InterfaceContainer, f Visit) error
- func VisitInterfaceSlice(in InterfaceSlice, f Visit) error
- func VisitLeafSlice(in LeafSlice, f Visit) error
- func VisitRefOfInterfaceContainer(in *InterfaceContainer, f Visit) error
- func VisitRefOfLeaf(in *Leaf, f Visit) error
- func VisitRefOfNoCloneType(in *NoCloneType, f Visit) error
- func VisitRefOfRefContainer(in *RefContainer, f Visit) error
- func VisitRefOfRefSliceContainer(in *RefSliceContainer, f Visit) error
- func VisitRefOfSubImpl(in *SubImpl, f Visit) error
- func VisitRefOfValueContainer(in *ValueContainer, f Visit) error
- func VisitRefOfValueSliceContainer(in *ValueSliceContainer, f Visit) error
- func VisitSubIface(in SubIface, f Visit) error
- func VisitValueContainer(in ValueContainer, f Visit) error
- func VisitValueSliceContainer(in ValueSliceContainer, f Visit) error
- type AST
- type ApplyFunc
- type BasicType
- type Bytes
- type Comparator
- func (cmp *Comparator) AST(inA, inB AST) bool
- func (cmp *Comparator) Bytes(a, b Bytes) bool
- func (cmp *Comparator) InterfaceContainer(a, b InterfaceContainer) bool
- func (cmp *Comparator) InterfaceSlice(a, b InterfaceSlice) bool
- func (cmp *Comparator) LeafSlice(a, b LeafSlice) bool
- func (cmp *Comparator) RefOfBool(a, b *bool) bool
- func (cmp *Comparator) RefOfInterfaceContainer(a, b *InterfaceContainer) bool
- func (cmp *Comparator) RefOfLeaf(a, b *Leaf) bool
- func (cmp *Comparator) RefOfNoCloneType(a, b *NoCloneType) bool
- func (cmp *Comparator) RefOfRefContainer(a, b *RefContainer) bool
- func (cmp *Comparator) RefOfRefSliceContainer(a, b *RefSliceContainer) bool
- func (cmp *Comparator) RefOfSubImpl(a, b *SubImpl) bool
- func (cmp *Comparator) RefOfValueContainer(a, b *ValueContainer) bool
- func (cmp *Comparator) RefOfValueSliceContainer(a, b *ValueSliceContainer) bool
- func (cmp *Comparator) SliceOfAST(a, b []AST) bool
- func (cmp *Comparator) SliceOfInt(a, b []int) bool
- func (cmp *Comparator) SliceOfRefOfLeaf(a, b []*Leaf) bool
- func (cmp *Comparator) SubIface(inA, inB SubIface) bool
- func (cmp *Comparator) ValueContainer(a, b ValueContainer) bool
- func (cmp *Comparator) ValueSliceContainer(a, b ValueSliceContainer) bool
- type Cursor
- type InterfaceContainer
- type InterfaceSlice
- type Leaf
- type LeafSlice
- type NoCloneType
- type RefContainer
- type RefSliceContainer
- type SubIface
- type SubImpl
- type ValueContainer
- type ValueSliceContainer
- type Visit
Constants ¶
This section is empty.
Variables ¶
var Equals = &Comparator{}
Functions ¶
func CloneRefOfBool ¶
CloneRefOfBool creates a deep clone of the input.
func CloneSliceOfInt ¶
CloneSliceOfInt creates a deep clone of the input.
func VisitBasicType ¶
func VisitBytes ¶
func VisitInterfaceContainer ¶
func VisitInterfaceContainer(in InterfaceContainer, f Visit) error
func VisitInterfaceSlice ¶
func VisitInterfaceSlice(in InterfaceSlice, f Visit) error
func VisitLeafSlice ¶
func VisitRefOfInterfaceContainer ¶
func VisitRefOfInterfaceContainer(in *InterfaceContainer, f Visit) error
func VisitRefOfLeaf ¶
func VisitRefOfNoCloneType ¶
func VisitRefOfNoCloneType(in *NoCloneType, f Visit) error
func VisitRefOfRefContainer ¶
func VisitRefOfRefContainer(in *RefContainer, f Visit) error
func VisitRefOfRefSliceContainer ¶
func VisitRefOfRefSliceContainer(in *RefSliceContainer, f Visit) error
func VisitRefOfSubImpl ¶
func VisitRefOfValueContainer ¶
func VisitRefOfValueContainer(in *ValueContainer, f Visit) error
func VisitRefOfValueSliceContainer ¶
func VisitRefOfValueSliceContainer(in *ValueSliceContainer, f Visit) error
func VisitSubIface ¶
func VisitValueContainer ¶
func VisitValueContainer(in ValueContainer, f Visit) error
func VisitValueSliceContainer ¶
func VisitValueSliceContainer(in ValueSliceContainer, f Visit) error
Types ¶
type AST ¶
type AST interface {
String() string
}
AST is the interface all interface types implement
func CloneSliceOfAST ¶
CloneSliceOfAST creates a deep clone of the input.
type Bytes ¶
type Bytes []byte
We need to support these types - a slice of AST elements can implement the interface
type Comparator ¶
type Comparator struct{}
func (*Comparator) AST ¶
func (cmp *Comparator) AST(inA, inB AST) bool
AST does deep equals between the two objects.
func (*Comparator) Bytes ¶
func (cmp *Comparator) Bytes(a, b Bytes) bool
Bytes does deep equals between the two objects.
func (*Comparator) InterfaceContainer ¶
func (cmp *Comparator) InterfaceContainer(a, b InterfaceContainer) bool
InterfaceContainer does deep equals between the two objects.
func (*Comparator) InterfaceSlice ¶
func (cmp *Comparator) InterfaceSlice(a, b InterfaceSlice) bool
InterfaceSlice does deep equals between the two objects.
func (*Comparator) LeafSlice ¶
func (cmp *Comparator) LeafSlice(a, b LeafSlice) bool
LeafSlice does deep equals between the two objects.
func (*Comparator) RefOfBool ¶
func (cmp *Comparator) RefOfBool(a, b *bool) bool
RefOfBool does deep equals between the two objects.
func (*Comparator) RefOfInterfaceContainer ¶
func (cmp *Comparator) RefOfInterfaceContainer(a, b *InterfaceContainer) bool
RefOfInterfaceContainer does deep equals between the two objects.
func (*Comparator) RefOfLeaf ¶
func (cmp *Comparator) RefOfLeaf(a, b *Leaf) bool
RefOfLeaf does deep equals between the two objects.
func (*Comparator) RefOfNoCloneType ¶
func (cmp *Comparator) RefOfNoCloneType(a, b *NoCloneType) bool
RefOfNoCloneType does deep equals between the two objects.
func (*Comparator) RefOfRefContainer ¶
func (cmp *Comparator) RefOfRefContainer(a, b *RefContainer) bool
RefOfRefContainer does deep equals between the two objects.
func (*Comparator) RefOfRefSliceContainer ¶
func (cmp *Comparator) RefOfRefSliceContainer(a, b *RefSliceContainer) bool
RefOfRefSliceContainer does deep equals between the two objects.
func (*Comparator) RefOfSubImpl ¶
func (cmp *Comparator) RefOfSubImpl(a, b *SubImpl) bool
RefOfSubImpl does deep equals between the two objects.
func (*Comparator) RefOfValueContainer ¶
func (cmp *Comparator) RefOfValueContainer(a, b *ValueContainer) bool
RefOfValueContainer does deep equals between the two objects.
func (*Comparator) RefOfValueSliceContainer ¶
func (cmp *Comparator) RefOfValueSliceContainer(a, b *ValueSliceContainer) bool
RefOfValueSliceContainer does deep equals between the two objects.
func (*Comparator) SliceOfAST ¶
func (cmp *Comparator) SliceOfAST(a, b []AST) bool
SliceOfAST does deep equals between the two objects.
func (*Comparator) SliceOfInt ¶
func (cmp *Comparator) SliceOfInt(a, b []int) bool
SliceOfInt does deep equals between the two objects.
func (*Comparator) SliceOfRefOfLeaf ¶
func (cmp *Comparator) SliceOfRefOfLeaf(a, b []*Leaf) bool
SliceOfRefOfLeaf does deep equals between the two objects.
func (*Comparator) SubIface ¶
func (cmp *Comparator) SubIface(inA, inB SubIface) bool
SubIface does deep equals between the two objects.
func (*Comparator) ValueContainer ¶
func (cmp *Comparator) ValueContainer(a, b ValueContainer) bool
ValueContainer does deep equals between the two objects.
func (*Comparator) ValueSliceContainer ¶
func (cmp *Comparator) ValueSliceContainer(a, b ValueSliceContainer) bool
ValueSliceContainer does deep equals between the two objects.
type Cursor ¶
type Cursor struct {
// contains filtered or unexported fields
}
Cursor is cursor
func (*Cursor) Replace ¶
Replace replaces the current node in the parent field with this new object. The user needs to make sure to not replace the object with something of the wrong type, or the visitor will panic.
func (*Cursor) ReplaceAndRevisit ¶
ReplaceAndRevisit replaces the current node in the parent field with this new object. When used, this will abort the visitation of the current node - no post or children visited, and the new node visited.
type InterfaceContainer ¶
type InterfaceContainer struct {
// contains filtered or unexported fields
}
func CloneInterfaceContainer ¶
func CloneInterfaceContainer(n InterfaceContainer) InterfaceContainer
CloneInterfaceContainer creates a deep clone of the input.
func CloneRefOfInterfaceContainer ¶
func CloneRefOfInterfaceContainer(n *InterfaceContainer) *InterfaceContainer
CloneRefOfInterfaceContainer creates a deep clone of the input.
func (InterfaceContainer) String ¶
func (r InterfaceContainer) String() string
type InterfaceSlice ¶
type InterfaceSlice []AST
We need to support these types - a slice of AST elements can implement the interface
func CloneInterfaceSlice ¶
func CloneInterfaceSlice(n InterfaceSlice) InterfaceSlice
CloneInterfaceSlice creates a deep clone of the input.
func (InterfaceSlice) String ¶
func (r InterfaceSlice) String() string
type Leaf ¶
type Leaf struct {
// contains filtered or unexported fields
}
Empty struct impl of the iface
func CloneRefOfLeaf ¶
CloneRefOfLeaf creates a deep clone of the input.
func CloneSliceOfRefOfLeaf ¶
CloneSliceOfRefOfLeaf creates a deep clone of the input.
type LeafSlice ¶
type LeafSlice []*Leaf
func CloneLeafSlice ¶
CloneLeafSlice creates a deep clone of the input.
type NoCloneType ¶
type NoCloneType struct {
// contains filtered or unexported fields
}
func CloneRefOfNoCloneType ¶
func CloneRefOfNoCloneType(n *NoCloneType) *NoCloneType
CloneRefOfNoCloneType creates a deep clone of the input.
func (*NoCloneType) String ¶
func (r *NoCloneType) String() string
type RefContainer ¶
Container implements the interface ByRef
func CloneRefOfRefContainer ¶
func CloneRefOfRefContainer(n *RefContainer) *RefContainer
CloneRefOfRefContainer creates a deep clone of the input.
func (*RefContainer) String ¶
func (r *RefContainer) String() string
type RefSliceContainer ¶
type RefSliceContainer struct { ASTElements []AST NotASTElements []int ASTImplementationElements []*Leaf }
Container implements the interface ByRef
func CloneRefOfRefSliceContainer ¶
func CloneRefOfRefSliceContainer(n *RefSliceContainer) *RefSliceContainer
CloneRefOfRefSliceContainer creates a deep clone of the input.
func (*RefSliceContainer) String ¶
func (r *RefSliceContainer) String() string
type SubIface ¶
type SubIface interface { AST // contains filtered or unexported methods }
We want to support all types that are used as field types, which can include interfaces. Example would be sqlparser.Expr that implements sqlparser.SQLNode
func CloneSubIface ¶
CloneSubIface creates a deep clone of the input.
type SubImpl ¶
type SubImpl struct {
// contains filtered or unexported fields
}
func CloneRefOfSubImpl ¶
CloneRefOfSubImpl creates a deep clone of the input.
type ValueContainer ¶
Container implements the interface ByValue
func CloneRefOfValueContainer ¶
func CloneRefOfValueContainer(n *ValueContainer) *ValueContainer
CloneRefOfValueContainer creates a deep clone of the input.
func CloneValueContainer ¶
func CloneValueContainer(n ValueContainer) ValueContainer
CloneValueContainer creates a deep clone of the input.
func (ValueContainer) String ¶
func (r ValueContainer) String() string
type ValueSliceContainer ¶
type ValueSliceContainer struct { ASTElements []AST NotASTElements []int ASTImplementationElements []*Leaf }
Container implements the interface ByValue
func CloneRefOfValueSliceContainer ¶
func CloneRefOfValueSliceContainer(n *ValueSliceContainer) *ValueSliceContainer
CloneRefOfValueSliceContainer creates a deep clone of the input.
func CloneValueSliceContainer ¶
func CloneValueSliceContainer(n ValueSliceContainer) ValueSliceContainer
CloneValueSliceContainer creates a deep clone of the input.
func (ValueSliceContainer) String ¶
func (r ValueSliceContainer) String() string