slave

package
v0.0.0-...-be37d25 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2018 License: MIT Imports: 7 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 {
	ServerID uint32
	File     string
	Offset   uint32
	Hostname string
}

Config contains slave connection configuration. It is passed to master upon registration.

type Conn

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

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

func Connect

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

Connect esablishes a new slave connection.

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) GetVar

func (c *Conn) GetVar(name string) (string, error)

GetVar fetches value of the given variable.

func (*Conn) ReadPacket

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

ReadPacket reads next packet from the server and processes the first 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

Jump to

Keyboard shortcuts

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