common

package
v0.0.0-...-86dfa72 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

type Consumer interface {
	Accept(e *canal.RowsEvent) error
	Name() string
}

Consumer , 是最小单元, 一个Sinker对应多个Consumer

type MySQLInstance

type MySQLInstance struct {
	Host     string `json:"host" yaml:"host"`
	Port     int    `json:"port" yaml:"port"`
	Username string `json:"username" yaml:"username"`
	Password string `json:"password" yaml:"password"`
	Database string `json:"database,omitempty" yaml:"database"`
}

func (*MySQLInstance) ToDatasource

func (i *MySQLInstance) ToDatasource() *sql.DB

type Sinker

type Sinker interface {
	// Enable 是否开启
	Enable() bool

	// Disable 设置停止
	Disable()

	// OnEvent 处理事件
	OnEvent(*canal.RowsEvent) error

	// ContinueOnError 错误是否继续
	ContinueOnError() bool
}

Sinker 对应了binlog 的整体处理器 它可以是 MQ, MySQL, REDIS, 也可以是其他

Jump to

Keyboard shortcuts

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