internal

package
v0.0.0-...-68c22f3 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDMLTestCases

func NewDMLTestCases(t testing.TB) [][]*model.RowChangedEvent

NewDMLTestCases returns a bunch of DML test cases.

func TestBatchCodec

func TestBatchCodec(
	t *testing.T,
	encoderBuilder codec.RowEventEncoderBuilder,
	newDecoder func(key []byte, value []byte) (codec.RowEventDecoder, error),
)

TestBatchCodec tests bunch of cases for RowEventDecoder.

Types

type Column

type Column struct {
	Type byte `json:"t"`
	// Deprecated: please use Flag instead.
	WhereHandle bool                 `json:"h,omitempty"`
	Flag        model.ColumnFlagType `json:"f"`
	Value       any                  `json:"v"`
}

Column is a type only used in codec internally.

func FormatColumn

func FormatColumn(c Column) Column

FormatColumn formats a codec column.

func (*Column) FromRowChangeColumn

func (c *Column) FromRowChangeColumn(col model.ColumnDataX)

FromRowChangeColumn converts from a row changed column to a codec column.

func (*Column) ToRowChangeColumn

func (c *Column) ToRowChangeColumn(name string) *model.Column

ToRowChangeColumn converts from a codec column to a row changed column.

type JavaSQLType

type JavaSQLType int32

JavaSQLType is the sql type defined in class java.sql.Types in java sdk

const (
	JavaSQLTypeBIT                     JavaSQLType = -7
	JavaSQLTypeTINYINT                 JavaSQLType = -6
	JavaSQLTypeSMALLINT                JavaSQLType = 5
	JavaSQLTypeINTEGER                 JavaSQLType = 4
	JavaSQLTypeBIGINT                  JavaSQLType = -5
	JavaSQLTypeREAL                    JavaSQLType = 7
	JavaSQLTypeDOUBLE                  JavaSQLType = 8
	JavaSQLTypeDECIMAL                 JavaSQLType = 3
	JavaSQLTypeCHAR                    JavaSQLType = 1
	JavaSQLTypeVARCHAR                 JavaSQLType = 12
	JavaSQLTypeDATE                    JavaSQLType = 91
	JavaSQLTypeTIME                    JavaSQLType = 92
	JavaSQLTypeTIMESTAMP               JavaSQLType = 93
	JavaSQLTypeBINARY                  JavaSQLType = -2
	JavaSQLTypeVARBINARY               JavaSQLType = -3
	JavaSQLTypeLONGVARBINARY           JavaSQLType = -4
	JavaSQLTypeNULL                    JavaSQLType = 0
	JavaSQLTypeBLOB                    JavaSQLType = 2004
	JavaSQLTypeCLOB                    JavaSQLType = 2005
	JavaSQLTypeFLOAT                   JavaSQLType = 6
	JavaSQLTypeNUMERIC                 JavaSQLType = 2
	JavaSQLTypeOTHER                   JavaSQLType = 1111
	JavaSQLTypeNCHAR                   JavaSQLType = -15
	JavaSQLTypeTIMESTAMP_WITH_TIMEZONE JavaSQLType = 2014 //nolint

)

jdk 1.8

func MySQLType2JdbcType

func MySQLType2JdbcType(mysqlType byte, isBinary bool) JavaSQLType

MySQLType2JdbcType converts the mysql protocol types to jdbc type

type MessageKey

type MessageKey struct {
	Ts        uint64            `json:"ts"`
	Schema    string            `json:"scm,omitempty"`
	Table     string            `json:"tbl,omitempty"`
	RowID     int64             `json:"rid,omitempty"`
	Partition *int64            `json:"ptn,omitempty"`
	Type      model.MessageType `json:"t"`
	// Only Handle Key Columns encoded in the message's value part.
	OnlyHandleKey bool `json:"ohk,omitempty"`

	// Claim check location for the message
	ClaimCheckLocation string `json:"ccl,omitempty"`
}

MessageKey defines the key for a message.

func (*MessageKey) Decode

func (m *MessageKey) Decode(data []byte) error

Decode codes a message key from a byte slice.

func (*MessageKey) Encode

func (m *MessageKey) Encode() ([]byte, error)

Encode encodes the message key to a byte slice.

Jump to

Keyboard shortcuts

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