driver

package
v0.0.0-...-1e4b8bd Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// File and offset describe current state.
	// File is the name of the binary log file.
	File string
	// Offset is the binary offset of the first event in the binary log file,
	// a starting point at which processing should begin.
	Offset uint32
	// ServerID should be a unique replica server identifier (i guess).
	ServerID uint32
	// Hostname along with server ID is used to identify the replica server
	// connection.
	Hostname string
}

Config contains all the details necessary to establish a replica connection.

type Conn

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

Conn is a connection used to issue a binlog dump command.

func Connect

func Connect(dsn string, conf Config) (*Conn, error)

Connect esablishes a new database connection. It is a go-sql-driver connection with a few low level functions exposed and with a high level wrapper that allows to execute just a few commands that are required for operation.

func (*Conn) Close

func (c *Conn) Close() error

Close the connection.

func (*Conn) DisableChecksum

func (c *Conn) DisableChecksum() error

DisableChecksum disables CRC32 checksums for this connection.

func (*Conn) ReadPacket

func (c *Conn) ReadPacket(ctx context.Context) ([]byte, error)

ReadPacket reads next packet from the server and peeks at the status byte.

func (*Conn) RegisterSlave

func (c *Conn) RegisterSlave() error

RegisterSlave issues a REGISTER_SLAVE command to master. Spec: https://dev.mysql.com/doc/internals/en/com-register-slave.html

func (*Conn) SetVar

func (c *Conn) SetVar(name, val string) error

SetVar assigns a new value to the given variable.

func (*Conn) StartBinlogDump

func (c *Conn) StartBinlogDump() error

StartBinlogDump issues a BINLOG_DUMP command to master. Spec: https://dev.mysql.com/doc/internals/en/com-binlog-dump.html TODO: https://dev.mysql.com/doc/internals/en/com-binlog-dump-gtid.html

Directories

Path Synopsis
internal
mysql
Package mysql provides a MySQL driver for Go's database/sql package.
Package mysql provides a MySQL driver for Go's database/sql package.

Jump to

Keyboard shortcuts

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