integration

package
v0.16.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

nolint

Index

Constants

This section is empty.

Variables

View Source
var Equals = &Comparator{}

Functions

func CloneRefOfBool

func CloneRefOfBool(n *bool) *bool

CloneRefOfBool creates a deep clone of the input.

func CloneSliceOfInt

func CloneSliceOfInt(n []int) []int

CloneSliceOfInt creates a deep clone of the input.

func VisitAST

func VisitAST(in AST, f Visit) error

func VisitBasicType

func VisitBasicType(in BasicType, f Visit) error

func VisitBytes

func VisitBytes(in Bytes, f Visit) error

func VisitInterfaceContainer

func VisitInterfaceContainer(in InterfaceContainer, f Visit) error

func VisitInterfaceSlice

func VisitInterfaceSlice(in InterfaceSlice, f Visit) error

func VisitLeafSlice

func VisitLeafSlice(in LeafSlice, f Visit) error

func VisitRefOfInterfaceContainer

func VisitRefOfInterfaceContainer(in *InterfaceContainer, f Visit) error

func VisitRefOfLeaf

func VisitRefOfLeaf(in *Leaf, f Visit) error

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 VisitRefOfSubImpl(in *SubImpl, f Visit) error

func VisitRefOfValueContainer

func VisitRefOfValueContainer(in *ValueContainer, f Visit) error

func VisitRefOfValueSliceContainer

func VisitRefOfValueSliceContainer(in *ValueSliceContainer, f Visit) error

func VisitSubIface

func VisitSubIface(in SubIface, f Visit) error

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 CloneAST

func CloneAST(in AST) AST

CloneAST creates a deep clone of the input.

func CloneSliceOfAST

func CloneSliceOfAST(n []AST) []AST

CloneSliceOfAST creates a deep clone of the input.

func Rewrite

func Rewrite(node AST, pre, post ApplyFunc) AST

Rewrite is the api.

type ApplyFunc

type ApplyFunc func(*Cursor) bool

ApplyFunc is apply function

type BasicType

type BasicType int

func (BasicType) String

func (r BasicType) String() string

type Bytes

type Bytes []byte

We need to support these types - a slice of AST elements can implement the interface

func CloneBytes

func CloneBytes(n Bytes) Bytes

CloneBytes creates a deep clone of the input.

func (Bytes) String

func (r Bytes) String() string

type Comparator added in v0.16.0

type Comparator struct{}

func (*Comparator) AST added in v0.16.0

func (cmp *Comparator) AST(inA, inB AST) bool

AST does deep equals between the two objects.

func (*Comparator) Bytes added in v0.16.0

func (cmp *Comparator) Bytes(a, b Bytes) bool

Bytes does deep equals between the two objects.

func (*Comparator) InterfaceContainer added in v0.16.0

func (cmp *Comparator) InterfaceContainer(a, b InterfaceContainer) bool

InterfaceContainer does deep equals between the two objects.

func (*Comparator) InterfaceSlice added in v0.16.0

func (cmp *Comparator) InterfaceSlice(a, b InterfaceSlice) bool

InterfaceSlice does deep equals between the two objects.

func (*Comparator) LeafSlice added in v0.16.0

func (cmp *Comparator) LeafSlice(a, b LeafSlice) bool

LeafSlice does deep equals between the two objects.

func (*Comparator) RefOfBool added in v0.16.0

func (cmp *Comparator) RefOfBool(a, b *bool) bool

RefOfBool does deep equals between the two objects.

func (*Comparator) RefOfInterfaceContainer added in v0.16.0

func (cmp *Comparator) RefOfInterfaceContainer(a, b *InterfaceContainer) bool

RefOfInterfaceContainer does deep equals between the two objects.

func (*Comparator) RefOfLeaf added in v0.16.0

func (cmp *Comparator) RefOfLeaf(a, b *Leaf) bool

RefOfLeaf does deep equals between the two objects.

func (*Comparator) RefOfNoCloneType added in v0.16.0

func (cmp *Comparator) RefOfNoCloneType(a, b *NoCloneType) bool

RefOfNoCloneType does deep equals between the two objects.

func (*Comparator) RefOfRefContainer added in v0.16.0

func (cmp *Comparator) RefOfRefContainer(a, b *RefContainer) bool

RefOfRefContainer does deep equals between the two objects.

func (*Comparator) RefOfRefSliceContainer added in v0.16.0

func (cmp *Comparator) RefOfRefSliceContainer(a, b *RefSliceContainer) bool

RefOfRefSliceContainer does deep equals between the two objects.

func (*Comparator) RefOfSubImpl added in v0.16.0

func (cmp *Comparator) RefOfSubImpl(a, b *SubImpl) bool

RefOfSubImpl does deep equals between the two objects.

func (*Comparator) RefOfValueContainer added in v0.16.0

func (cmp *Comparator) RefOfValueContainer(a, b *ValueContainer) bool

RefOfValueContainer does deep equals between the two objects.

func (*Comparator) RefOfValueSliceContainer added in v0.16.0

func (cmp *Comparator) RefOfValueSliceContainer(a, b *ValueSliceContainer) bool

RefOfValueSliceContainer does deep equals between the two objects.

func (*Comparator) SliceOfAST added in v0.16.0

func (cmp *Comparator) SliceOfAST(a, b []AST) bool

SliceOfAST does deep equals between the two objects.

func (*Comparator) SliceOfInt added in v0.16.0

func (cmp *Comparator) SliceOfInt(a, b []int) bool

SliceOfInt does deep equals between the two objects.

func (*Comparator) SliceOfRefOfLeaf added in v0.16.0

func (cmp *Comparator) SliceOfRefOfLeaf(a, b []*Leaf) bool

SliceOfRefOfLeaf does deep equals between the two objects.

func (*Comparator) SubIface added in v0.16.0

func (cmp *Comparator) SubIface(inA, inB SubIface) bool

SubIface does deep equals between the two objects.

func (*Comparator) ValueContainer added in v0.16.0

func (cmp *Comparator) ValueContainer(a, b ValueContainer) bool

ValueContainer does deep equals between the two objects.

func (*Comparator) ValueSliceContainer added in v0.16.0

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) Node

func (c *Cursor) Node() AST

Node returns the current Node.

func (*Cursor) Parent

func (c *Cursor) Parent() AST

Parent returns the parent of the current Node.

func (*Cursor) Replace

func (c *Cursor) Replace(newNode AST)

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 added in v0.13.0

func (c *Cursor) ReplaceAndRevisit(newNode AST)

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

func CloneRefOfLeaf(n *Leaf) *Leaf

CloneRefOfLeaf creates a deep clone of the input.

func CloneSliceOfRefOfLeaf

func CloneSliceOfRefOfLeaf(n []*Leaf) []*Leaf

CloneSliceOfRefOfLeaf creates a deep clone of the input.

func (*Leaf) String

func (l *Leaf) String() string

type LeafSlice

type LeafSlice []*Leaf

func CloneLeafSlice

func CloneLeafSlice(n LeafSlice) LeafSlice

CloneLeafSlice creates a deep clone of the input.

func (LeafSlice) String

func (r LeafSlice) String() string

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

type RefContainer struct {
	ASTType               AST
	NotASTType            int
	ASTImplementationType *Leaf
}

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

func CloneSubIface(in SubIface) SubIface

CloneSubIface creates a deep clone of the input.

type SubImpl

type SubImpl struct {
	// contains filtered or unexported fields
}

func CloneRefOfSubImpl

func CloneRefOfSubImpl(n *SubImpl) *SubImpl

CloneRefOfSubImpl creates a deep clone of the input.

func (*SubImpl) String

func (r *SubImpl) String() string

type ValueContainer

type ValueContainer struct {
	ASTType               AST
	NotASTType            int
	ASTImplementationType *Leaf
}

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

type Visit

type Visit func(node AST) (bool, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL