sync

package
v1.262.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateEngine

func CreateEngine(dataSourceName string) (*xorm.Engine, error)

func GetCanalConfig added in v1.260.0

func GetCanalConfig(username string, password string, host string, port int, database string) *canal.Config

func GetDeleteSql

func GetDeleteSql(schemaName string, tableName string, pkColumnNames []string, pkColumnValue []interface{}) (string, []interface{}, error)

func GetInsertSql

func GetInsertSql(schemaName string, tableName string, columnNames []string, columnValue []interface{}) (string, []interface{}, error)

func GetPKColumnNames added in v1.260.0

func GetPKColumnNames(columnNames []string, PKColumns []int) []string

func GetPKColumnValues added in v1.260.0

func GetPKColumnValues(columnValues []interface{}, PKColumns []int) []interface{}

func GetServerId added in v1.260.0

func GetServerId(engin *xorm.Engine) (uint32, error)

func GetServerUUID added in v1.260.0

func GetServerUUID(engin *xorm.Engine) (string, error)

func GetUpdateSql

func GetUpdateSql(schemaName string, tableName string, columnNames []string, newColumnVal []interface{}, pkColumnNames []string, pkColumnValue []interface{}) (string, []interface{}, error)

func StartBinlogSync

func StartBinlogSync() error

func StartCanal added in v1.260.0

func StartCanal(cfg *canal.Config, username string, password string, host string, port int, database string) error

Types

type MyEventHandler

type MyEventHandler struct {
	GTID string
	canal.DummyEventHandler
	// contains filtered or unexported fields
}

func GetMyEventHandler added in v1.260.0

func GetMyEventHandler(username string, password string, host string, port int, database string) MyEventHandler

func (*MyEventHandler) OnGTID added in v1.260.0

func (h *MyEventHandler) OnGTID(header *replication.EventHeader, gtid mysql.GTIDSet) error

func (*MyEventHandler) OnRow

func (h *MyEventHandler) OnRow(e *canal.RowsEvent) error

func (*MyEventHandler) String

func (h *MyEventHandler) String() string

Jump to

Keyboard shortcuts

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