mybinlog

package
v0.0.0-...-f2224d8 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRuleNotExist = errors.New("rule is not exist")

ErrRuleNotExist is the error if rule is not defined.

View Source
var ErrTableNotExist = "table is not exist"

Functions

This section is empty.

Types

type BinlogParser

type BinlogParser struct{}

func (*BinlogParser) GetBinLogData

func (m *BinlogParser) GetBinLogData(element interface{}, e *canal.RowsEvent, n int) error

type MyDumper

type MyDumper struct {
	// mysqldump execution path, like mysqldump or /usr/bin/mysqldump, etc...
	ExecutionPath string

	Addr     string
	User     string
	Password string
	Protocol string

	// Will override Databases
	Tables  []string
	TableDB string

	Databases []string

	Where   string
	Charset string

	IgnoreTables map[string][]string

	ExtraOptions []string

	ErrOut io.Writer
	// contains filtered or unexported fields
}

func NewMyDumper

func NewMyDumper(executionPath string, addr string, user string, password string) (*MyDumper, error)

func (*MyDumper) AddDatabases

func (d *MyDumper) AddDatabases(dbs ...string)

func (*MyDumper) AddIgnoreTables

func (d *MyDumper) AddIgnoreTables(db string, tables ...string)

func (*MyDumper) AddTables

func (d *MyDumper) AddTables(db string, tables ...string)

func (*MyDumper) Dump

func (d *MyDumper) Dump(w io.Writer) error

func (*MyDumper) ImportSql

func (d *MyDumper) ImportSql(sqlFilePath string, toServer string, toDB string)

func (*MyDumper) Reset

func (d *MyDumper) Reset()

func (*MyDumper) SetCharset

func (d *MyDumper) SetCharset(charset string)

func (*MyDumper) SetErrOut

func (d *MyDumper) SetErrOut(o io.Writer)

func (*MyDumper) SetExtraOptions

func (d *MyDumper) SetExtraOptions(options []string)

func (*MyDumper) SetHexBlob

func (d *MyDumper) SetHexBlob(v bool)

func (*MyDumper) SetMaxAllowedPacket

func (d *MyDumper) SetMaxAllowedPacket(i int)

func (*MyDumper) SetProtocol

func (d *MyDumper) SetProtocol(protocol string)

func (*MyDumper) SetWhere

func (d *MyDumper) SetWhere(where string)

func (*MyDumper) SkipMasterData

func (d *MyDumper) SkipMasterData(v bool)

SkipMasterData: In some cloud MySQL, we have no privilege to use `--master-data`.

func (*MyDumper) WaitDumpDone

func (d *MyDumper) WaitDumpDone() <-chan struct{}

type PipeLine

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

func NewPipeLine

func NewPipeLine() (*PipeLine, error)

NewPipeLine creates the PipeLine from config

func (*PipeLine) Close

func (r *PipeLine) Close()

Close closes the PipeLine

func (*PipeLine) Ctx

func (r *PipeLine) Ctx() context.Context

Ctx returns the internal context for outside use.

func (*PipeLine) DumpTable

func (p *PipeLine) DumpTable(db string, table string) (string, error)

func (*PipeLine) Run

func (r *PipeLine) Run() error

type QueryRequest

type QueryRequest struct {
	DBServer   string
	Query      string
	Parameters []interface{}
	Pos        mysql.Position
}

type Rule

type Rule struct {
	DB    string `toml:"db"`
	Table string `toml:"table"`

	ToDBServer string `toml:"to_dbserver"`
	ToDB       string `toml:"to_db"`

	RawKey string `toml:"keys"`

	PKColumnIds []int
	//build unique where condition base on PKColumns
	WherePK string

	// // MySQL table information
	TableInfo *schema.Table
}

type SimpleCanalDBConfig

type SimpleCanalDBConfig struct {
	Addr     string `toml:"address"`
	User     string `toml:"user"`
	Password string `toml:"password"`
}

Jump to

Keyboard shortcuts

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