driver

package
v0.0.0-...-e49965d Latest Latest
Warning

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

Go to latest
Published: May 9, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MySQLChange

type MySQLChange struct {
	canal.DummyEventHandler
	// contains filtered or unexported fields
}

MySQLChange represents event change listener

func NewMySQLChange

func NewMySQLChange(config *dbevent.DBConfig, tableName string) *MySQLChange

NewMySQLChange creates new instance

func (*MySQLChange) Close

func (h *MySQLChange) Close()

Close stop listening

func (*MySQLChange) OnRow

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

OnRow receives change event

func (*MySQLChange) Run

func (h *MySQLChange) Run()

Run starts listening

func (*MySQLChange) String

func (h *MySQLChange) String() string

func (*MySQLChange) WaitChange

func (h *MySQLChange) WaitChange(timeout time.Duration)

WaitChange waits for change

type MySQLDriver

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

MySQLDriver represents event database

func NewMySQLEventDriver

func NewMySQLEventDriver(dbConfig *dbevent.DBConfig, config *MySQLStoreConfig) *MySQLDriver

NewMySQLEventDriver creates new instance

func (*MySQLDriver) Close

func (db *MySQLDriver) Close() error

Close all mysql resources

func (*MySQLDriver) CommitInTrans

func (db *MySQLDriver) CommitInTrans(readGroup string, event *dbevent.Event, handler func() error) error

CommitEvent as processed

func (*MySQLDriver) Create

func (db *MySQLDriver) Create(events ...*dbevent.Event) error

Create event into database

func (*MySQLDriver) Fetch

func (db *MySQLDriver) Fetch(readGroup string, limit int) ([]*dbevent.Event, error)

Fetch events from database

func (*MySQLDriver) Provision

func (db *MySQLDriver) Provision() error

Provision prepares event tables

func (*MySQLDriver) WaitChange

func (db *MySQLDriver) WaitChange(timeout time.Duration)

WaitChange waits for event change

type MySQLStoreConfig

type MySQLStoreConfig struct {
	NodeID         string
	LockTimeoutSec int
}

MySQLStoreConfig represents sql store configuration

Jump to

Keyboard shortcuts

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