integration

package
v0.15.1 Latest Latest
Warning

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

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

Documentation

Overview

nolint

Index

Constants

This section is empty.

Variables

This section is empty.

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 EqualsAST

func EqualsAST(inA, inB AST) bool

EqualsAST does deep equals between the two objects.

func EqualsBytes

func EqualsBytes(a, b Bytes) bool

EqualsBytes does deep equals between the two objects.

func EqualsInterfaceContainer

func EqualsInterfaceContainer(a, b InterfaceContainer) bool

EqualsInterfaceContainer does deep equals between the two objects.

func EqualsInterfaceSlice

func EqualsInterfaceSlice(a, b InterfaceSlice) bool

EqualsInterfaceSlice does deep equals between the two objects.

func EqualsLeafSlice

func EqualsLeafSlice(a, b LeafSlice) bool

EqualsLeafSlice does deep equals between the two objects.

func EqualsRefOfBool

func EqualsRefOfBool(a, b *bool) bool

EqualsRefOfBool does deep equals between the two objects.

func EqualsRefOfInterfaceContainer

func EqualsRefOfInterfaceContainer(a, b *InterfaceContainer) bool

EqualsRefOfInterfaceContainer does deep equals between the two objects.

func EqualsRefOfLeaf

func EqualsRefOfLeaf(a, b *Leaf) bool

EqualsRefOfLeaf does deep equals between the two objects.

func EqualsRefOfNoCloneType

func EqualsRefOfNoCloneType(a, b *NoCloneType) bool

EqualsRefOfNoCloneType does deep equals between the two objects.

func EqualsRefOfRefContainer

func EqualsRefOfRefContainer(a, b *RefContainer) bool

EqualsRefOfRefContainer does deep equals between the two objects.

func EqualsRefOfRefSliceContainer

func EqualsRefOfRefSliceContainer(a, b *RefSliceContainer) bool

EqualsRefOfRefSliceContainer does deep equals between the two objects.

func EqualsRefOfSubImpl

func EqualsRefOfSubImpl(a, b *SubImpl) bool

EqualsRefOfSubImpl does deep equals between the two objects.

func EqualsRefOfValueContainer

func EqualsRefOfValueContainer(a, b *ValueContainer) bool

EqualsRefOfValueContainer does deep equals between the two objects.

func EqualsRefOfValueSliceContainer

func EqualsRefOfValueSliceContainer(a, b *ValueSliceContainer) bool

EqualsRefOfValueSliceContainer does deep equals between the two objects.

func EqualsSliceOfAST

func EqualsSliceOfAST(a, b []AST) bool

EqualsSliceOfAST does deep equals between the two objects.

func EqualsSliceOfInt

func EqualsSliceOfInt(a, b []int) bool

EqualsSliceOfInt does deep equals between the two objects.

func EqualsSliceOfRefOfLeaf

func EqualsSliceOfRefOfLeaf(a, b []*Leaf) bool

EqualsSliceOfRefOfLeaf does deep equals between the two objects.

func EqualsSubIface

func EqualsSubIface(inA, inB SubIface) bool

EqualsSubIface does deep equals between the two objects.

func EqualsValueContainer

func EqualsValueContainer(a, b ValueContainer) bool

EqualsValueContainer does deep equals between the two objects.

func EqualsValueSliceContainer

func EqualsValueSliceContainer(a, b ValueSliceContainer) bool

EqualsValueSliceContainer does deep equals between the two objects.

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
}

These types are used to test the rewriter generator against these types. To recreate them, just run:

go run go/tools/asthelpergen -in ./go/tools/asthelpergen/integration -iface vitess.io/vitess/go/tools/asthelpergen/integration.AST -except "*NoCloneType"

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